[PATCH] leds: Fix uninitialized variable 'ret' in mt6370_mc_pattern_clear

SurajSonawane2415 posted 1 patch 1 month, 3 weeks ago
There is a newer version of this series
drivers/leds/rgb/leds-mt6370-rgb.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
[PATCH] leds: Fix uninitialized variable 'ret' in mt6370_mc_pattern_clear
Posted by SurajSonawane2415 1 month, 3 weeks ago
Fix the uninitialized symbol 'ret' in the function mt6370_mc_pattern_clear
to resolve the following warning:
drivers/leds/rgb/leds-mt6370-rgb.c:604 mt6370_mc_pattern_clear()
error: uninitialized symbol 'ret'.
Initialize 'ret' to 0 to prevent undefined behavior from uninitialized
access.

Signed-off-by: SurajSonawane2415 <surajsonawane0215@gmail.com>
---
 drivers/leds/rgb/leds-mt6370-rgb.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/leds/rgb/leds-mt6370-rgb.c b/drivers/leds/rgb/leds-mt6370-rgb.c
index 10a0b5b45..87805c21e 100644
--- a/drivers/leds/rgb/leds-mt6370-rgb.c
+++ b/drivers/leds/rgb/leds-mt6370-rgb.c
@@ -587,7 +587,7 @@ static inline int mt6370_mc_pattern_clear(struct led_classdev *lcdev)
 	struct mt6370_led *led = container_of(mccdev, struct mt6370_led, mc);
 	struct mt6370_priv *priv = led->priv;
 	struct mc_subled *subled;
-	int i, ret;
+	int i, ret = 0;
 
 	mutex_lock(&led->priv->lock);
 
-- 
2.34.1
Re: (subset) [PATCH] leds: Fix uninitialized variable 'ret' in mt6370_mc_pattern_clear
Posted by Lee Jones 1 month, 2 weeks ago
On Sun, 06 Oct 2024 18:43:37 +0530, SurajSonawane2415 wrote:
> Fix the uninitialized symbol 'ret' in the function mt6370_mc_pattern_clear
> to resolve the following warning:
> drivers/leds/rgb/leds-mt6370-rgb.c:604 mt6370_mc_pattern_clear()
> error: uninitialized symbol 'ret'.
> Initialize 'ret' to 0 to prevent undefined behavior from uninitialized
> access.
> 
> [...]

Applied, thanks!

[1/1] leds: Fix uninitialized variable 'ret' in mt6370_mc_pattern_clear
      commit: b5a5659aebfffbcddb81abafe042fb4044b6ff9e

--
Lee Jones [李琼斯]

Re: (subset) [PATCH] leds: Fix uninitialized variable 'ret' in mt6370_mc_pattern_clear
Posted by Suraj Sonawane 1 month, 2 weeks ago
On 11/10/24 14:39, Lee Jones wrote:
> On Sun, 06 Oct 2024 18:43:37 +0530, SurajSonawane2415 wrote:
>> Fix the uninitialized symbol 'ret' in the function mt6370_mc_pattern_clear
>> to resolve the following warning:
>> drivers/leds/rgb/leds-mt6370-rgb.c:604 mt6370_mc_pattern_clear()
>> error: uninitialized symbol 'ret'.
>> Initialize 'ret' to 0 to prevent undefined behavior from uninitialized
>> access.
>>
>> [...]
> 
> Applied, thanks!
> 
> [1/1] leds: Fix uninitialized variable 'ret' in mt6370_mc_pattern_clear
>        commit: b5a5659aebfffbcddb81abafe042fb4044b6ff9e
> 
> --
> Lee Jones [李琼斯]
> 
Thank you! I'm glad the patch was applied. I'll ensure future patches 
follow the necessary guidelines.

Best regards,
Suraj Sonawane
Re: (subset) [PATCH] leds: Fix uninitialized variable 'ret' in mt6370_mc_pattern_clear
Posted by Lee Jones 1 month, 1 week ago
On Fri, 11 Oct 2024, Suraj Sonawane wrote:

> On 11/10/24 14:39, Lee Jones wrote:
> > On Sun, 06 Oct 2024 18:43:37 +0530, SurajSonawane2415 wrote:
> > > Fix the uninitialized symbol 'ret' in the function mt6370_mc_pattern_clear
> > > to resolve the following warning:
> > > drivers/leds/rgb/leds-mt6370-rgb.c:604 mt6370_mc_pattern_clear()
> > > error: uninitialized symbol 'ret'.
> > > Initialize 'ret' to 0 to prevent undefined behavior from uninitialized
> > > access.
> > > 
> > > [...]
> > 
> > Applied, thanks!
> > 
> > [1/1] leds: Fix uninitialized variable 'ret' in mt6370_mc_pattern_clear
> >        commit: b5a5659aebfffbcddb81abafe042fb4044b6ff9e
> > 
> > --
> > Lee Jones [李琼斯]
> > 
> Thank you! I'm glad the patch was applied. I'll ensure future patches follow
> the necessary guidelines.

Sorry, this is a tooling error.  The patch was not meant to be applied.

Please resubmit it using your updated .gitconfig file.

-- 
Lee Jones [李琼斯]
Re: (subset) [PATCH] leds: Fix uninitialized variable 'ret' in mt6370_mc_pattern_clear
Posted by Suraj Sonawane 1 month, 1 week ago
On 15/10/24 14:28, Lee Jones wrote:
>> On 11/10/24 14:39, Lee Jones wrote:
>>> On Sun, 06 Oct 2024 18:43:37 +0530, SurajSonawane2415 wrote:
>>>> Fix the uninitialized symbol 'ret' in the function mt6370_mc_pattern_clear
>>>> to resolve the following warning:
>>>> drivers/leds/rgb/leds-mt6370-rgb.c:604 mt6370_mc_pattern_clear()
>>>> error: uninitialized symbol 'ret'.
>>>> Initialize 'ret' to 0 to prevent undefined behavior from uninitialized
>>>> access.
>>>>
>>>> [...]
>>> Applied, thanks!
>>>
>>> [1/1] leds: Fix uninitialized variable 'ret' in mt6370_mc_pattern_clear
>>>         commit: b5a5659aebfffbcddb81abafe042fb4044b6ff9e
>>>
>>> --
>>> Lee Jones [李琼斯]
>>>
>> Thank you! I'm glad the patch was applied. I'll ensure future patches follow
>> the necessary guidelines.
> Sorry, this is a tooling error.  The patch was not meant to be applied.
> 
> Please resubmit it using your updated .gitconfig file.
Thank you. I have updated my .gitconfig to use my real name "Suraj 
Sonawane" as requested and have resubmitted the patch.

Best regards,
Suraj Sonawane
[PATCH v2] leds: Fix uninitialized variable 'ret' in mt6370_mc_pattern_clear
Posted by Suraj Sonawane 1 month, 1 week ago
Fix the uninitialized symbol 'ret' in the function mt6370_mc_pattern_clear
to resolve the following warning:
drivers/leds/rgb/leds-mt6370-rgb.c:604 mt6370_mc_pattern_clear()
error: uninitialized symbol 'ret'.
Initialize 'ret' to 0 to prevent undefined behavior from uninitialized
access.

Signed-off-by: Suraj Sonawane <surajsonawane0215@gmail.com>
---
V1 : https://lore.kernel.org/linux-arm-kernel/83572cde-19a1-4089-b02b-361a8ef40bee@gmail.com/T/
V2 : Updated .gitconfig to use the real name "Suraj Sonawane" as per the feedback.

 drivers/leds/rgb/leds-mt6370-rgb.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/leds/rgb/leds-mt6370-rgb.c b/drivers/leds/rgb/leds-mt6370-rgb.c
index 10a0b5b45..87805c21e 100644
--- a/drivers/leds/rgb/leds-mt6370-rgb.c
+++ b/drivers/leds/rgb/leds-mt6370-rgb.c
@@ -587,7 +587,7 @@ static inline int mt6370_mc_pattern_clear(struct led_classdev *lcdev)
 	struct mt6370_led *led = container_of(mccdev, struct mt6370_led, mc);
 	struct mt6370_priv *priv = led->priv;
 	struct mc_subled *subled;
-	int i, ret;
+	int i, ret = 0;
 
 	mutex_lock(&led->priv->lock);
 
-- 
2.34.1
Re: (subset) [PATCH v2] leds: Fix uninitialized variable 'ret' in mt6370_mc_pattern_clear
Posted by Lee Jones 1 month, 1 week ago
On Wed, 16 Oct 2024 09:51:42 +0530, Suraj Sonawane wrote:
> Fix the uninitialized symbol 'ret' in the function mt6370_mc_pattern_clear
> to resolve the following warning:
> drivers/leds/rgb/leds-mt6370-rgb.c:604 mt6370_mc_pattern_clear()
> error: uninitialized symbol 'ret'.
> Initialize 'ret' to 0 to prevent undefined behavior from uninitialized
> access.
> 
> [...]

Applied, thanks!

[1/1] leds: Fix uninitialized variable 'ret' in mt6370_mc_pattern_clear
      commit: 6cbf5c99541ac681cf5c6155b582dfbcd879eae3

--
Lee Jones [李琼斯]

Re: (subset) [PATCH v2] leds: Fix uninitialized variable 'ret' in mt6370_mc_pattern_clear
Posted by Suraj Sonawane 1 month, 1 week ago
On 16/10/24 13:23, Lee Jones wrote:
> On Wed, 16 Oct 2024 09:51:42 +0530, Suraj Sonawane wrote:
>> Fix the uninitialized symbol 'ret' in the function mt6370_mc_pattern_clear
>> to resolve the following warning:
>> drivers/leds/rgb/leds-mt6370-rgb.c:604 mt6370_mc_pattern_clear()
>> error: uninitialized symbol 'ret'.
>> Initialize 'ret' to 0 to prevent undefined behavior from uninitialized
>> access.
>>
>> [...]
> 
> Applied, thanks!
> 
> [1/1] leds: Fix uninitialized variable 'ret' in mt6370_mc_pattern_clear
>        commit: 6cbf5c99541ac681cf5c6155b582dfbcd879eae3
> 
> --
> Lee Jones [李琼斯]
> 
Thanks a lot!
Re: [PATCH] leds: Fix uninitialized variable 'ret' in mt6370_mc_pattern_clear
Posted by Lee Jones 1 month, 2 weeks ago
On Sun, 06 Oct 2024, SurajSonawane2415 wrote:

> Fix the uninitialized symbol 'ret' in the function mt6370_mc_pattern_clear
> to resolve the following warning:
> drivers/leds/rgb/leds-mt6370-rgb.c:604 mt6370_mc_pattern_clear()
> error: uninitialized symbol 'ret'.
> Initialize 'ret' to 0 to prevent undefined behavior from uninitialized
> access.
> 
> Signed-off-by: SurajSonawane2415 <surajsonawane0215@gmail.com>

Real names only.  Please update your .gitconfig.

> ---
>  drivers/leds/rgb/leds-mt6370-rgb.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/leds/rgb/leds-mt6370-rgb.c b/drivers/leds/rgb/leds-mt6370-rgb.c
> index 10a0b5b45..87805c21e 100644
> --- a/drivers/leds/rgb/leds-mt6370-rgb.c
> +++ b/drivers/leds/rgb/leds-mt6370-rgb.c
> @@ -587,7 +587,7 @@ static inline int mt6370_mc_pattern_clear(struct led_classdev *lcdev)
>  	struct mt6370_led *led = container_of(mccdev, struct mt6370_led, mc);
>  	struct mt6370_priv *priv = led->priv;
>  	struct mc_subled *subled;
> -	int i, ret;
> +	int i, ret = 0;
>  
>  	mutex_lock(&led->priv->lock);
>  
> -- 
> 2.34.1
> 

-- 
Lee Jones [李琼斯]
Re: [PATCH] leds: Fix uninitialized variable 'ret' in mt6370_mc_pattern_clear
Posted by Suraj Sonawane 1 month, 2 weeks ago
On 11/10/24 13:17, Lee Jones wrote:
> On Sun, 06 Oct 2024, SurajSonawane2415 wrote:
> 
>> Fix the uninitialized symbol 'ret' in the function mt6370_mc_pattern_clear
>> to resolve the following warning:
>> drivers/leds/rgb/leds-mt6370-rgb.c:604 mt6370_mc_pattern_clear()
>> error: uninitialized symbol 'ret'.
>> Initialize 'ret' to 0 to prevent undefined behavior from uninitialized
>> access.
>>
>> Signed-off-by: SurajSonawane2415 <surajsonawane0215@gmail.com>
> 
> Real names only.  Please update your .gitconfig.
> 
>> ---
>>   drivers/leds/rgb/leds-mt6370-rgb.c | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/leds/rgb/leds-mt6370-rgb.c b/drivers/leds/rgb/leds-mt6370-rgb.c
>> index 10a0b5b45..87805c21e 100644
>> --- a/drivers/leds/rgb/leds-mt6370-rgb.c
>> +++ b/drivers/leds/rgb/leds-mt6370-rgb.c
>> @@ -587,7 +587,7 @@ static inline int mt6370_mc_pattern_clear(struct led_classdev *lcdev)
>>   	struct mt6370_led *led = container_of(mccdev, struct mt6370_led, mc);
>>   	struct mt6370_priv *priv = led->priv;
>>   	struct mc_subled *subled;
>> -	int i, ret;
>> +	int i, ret = 0;
>>   
>>   	mutex_lock(&led->priv->lock);
>>   
>> -- 
>> 2.34.1
>>
> 

Thanks for the feedback. I'll update my .gitconfig to use my real name 
for future patches.

Best regards,
Suraj Sonawane