2019-06-11 17:16:55

by Colin King

[permalink] [raw]
Subject: [PATCH][next] video: fbdev: atmel_lcdfb: remove redundant initialization to variable ret

From: Colin Ian King <[email protected]>

Currently variable ret is being initialized with -ENOENT however that
value is never read and ret is being re-assigned later on. Hence this
assignment is redundant and can be removed.

Addresses-Coverity: ("Unused value")
Signed-off-by: Colin Ian King <[email protected]>
---
drivers/video/fbdev/atmel_lcdfb.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/video/fbdev/atmel_lcdfb.c b/drivers/video/fbdev/atmel_lcdfb.c
index fb117ccbeab3..930cc3f92e01 100644
--- a/drivers/video/fbdev/atmel_lcdfb.c
+++ b/drivers/video/fbdev/atmel_lcdfb.c
@@ -950,7 +950,7 @@ static int atmel_lcdfb_of_init(struct atmel_lcdfb_info *sinfo)
struct fb_videomode fb_vm;
struct gpio_desc *gpiod;
struct videomode vm;
- int ret = -ENOENT;
+ int ret;
int i;

sinfo->config = (struct atmel_lcdfb_config*)
--
2.20.1


2019-06-12 08:40:55

by Nicolas Ferre

[permalink] [raw]
Subject: Re: [PATCH][next] video: fbdev: atmel_lcdfb: remove redundant initialization to variable ret

On 11/06/2019 at 19:09, Colin King wrote:
> External E-Mail
>
>
> From: Colin Ian King <[email protected]>
>
> Currently variable ret is being initialized with -ENOENT however that
> value is never read and ret is being re-assigned later on. Hence this
> assignment is redundant and can be removed.
>
> Addresses-Coverity: ("Unused value")
> Signed-off-by: Colin Ian King <[email protected]>

Indeed:
Acked-by: Nicolas Ferre <[email protected]>

Thanks, best regards,
Nicolas


> ---
> drivers/video/fbdev/atmel_lcdfb.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/video/fbdev/atmel_lcdfb.c b/drivers/video/fbdev/atmel_lcdfb.c
> index fb117ccbeab3..930cc3f92e01 100644
> --- a/drivers/video/fbdev/atmel_lcdfb.c
> +++ b/drivers/video/fbdev/atmel_lcdfb.c
> @@ -950,7 +950,7 @@ static int atmel_lcdfb_of_init(struct atmel_lcdfb_info *sinfo)
> struct fb_videomode fb_vm;
> struct gpio_desc *gpiod;
> struct videomode vm;
> - int ret = -ENOENT;
> + int ret;
> int i;
>
> sinfo->config = (struct atmel_lcdfb_config*)
>


--
Nicolas Ferre

2019-06-12 18:00:29

by Ludovic Desroches

[permalink] [raw]
Subject: Re: [PATCH][next] video: fbdev: atmel_lcdfb: remove redundant initialization to variable ret

On Wed, Jun 12, 2019 at 09:55:30AM +0200, Nicolas Ferre - M43238 wrote:
> On 11/06/2019 at 19:09, Colin King wrote:
> > External E-Mail
> >
> >
> > From: Colin Ian King <[email protected]>
> >
> > Currently variable ret is being initialized with -ENOENT however that
> > value is never read and ret is being re-assigned later on. Hence this
> > assignment is redundant and can be removed.
> >
> > Addresses-Coverity: ("Unused value")
> > Signed-off-by: Colin Ian King <[email protected]>
>
> Indeed:
> Acked-by: Nicolas Ferre <[email protected]>

Acked-by: Ludovic Desroches <[email protected]>

Thanks

>
> Thanks, best regards,
> Nicolas
>
>
> > ---
> > drivers/video/fbdev/atmel_lcdfb.c | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/drivers/video/fbdev/atmel_lcdfb.c b/drivers/video/fbdev/atmel_lcdfb.c
> > index fb117ccbeab3..930cc3f92e01 100644
> > --- a/drivers/video/fbdev/atmel_lcdfb.c
> > +++ b/drivers/video/fbdev/atmel_lcdfb.c
> > @@ -950,7 +950,7 @@ static int atmel_lcdfb_of_init(struct atmel_lcdfb_info *sinfo)
> > struct fb_videomode fb_vm;
> > struct gpio_desc *gpiod;
> > struct videomode vm;
> > - int ret = -ENOENT;
> > + int ret;
> > int i;
> >
> > sinfo->config = (struct atmel_lcdfb_config*)
> >
>
>
> --
> Nicolas Ferre

Subject: Re: [PATCH][next] video: fbdev: atmel_lcdfb: remove redundant initialization to variable ret


On 6/12/19 4:13 PM, Ludovic Desroches wrote:
> On Wed, Jun 12, 2019 at 09:55:30AM +0200, Nicolas Ferre - M43238 wrote:
>> On 11/06/2019 at 19:09, Colin King wrote:
>>> External E-Mail
>>>
>>>
>>> From: Colin Ian King <[email protected]>
>>>
>>> Currently variable ret is being initialized with -ENOENT however that
>>> value is never read and ret is being re-assigned later on. Hence this
>>> assignment is redundant and can be removed.
>>>
>>> Addresses-Coverity: ("Unused value")
>>> Signed-off-by: Colin Ian King <[email protected]>
>>
>> Indeed:
>> Acked-by: Nicolas Ferre <[email protected]>
>
> Acked-by: Ludovic Desroches <[email protected]>

Patch queued for v5.3, thanks.

Best regards,
--
Bartlomiej Zolnierkiewicz
Samsung R&D Institute Poland
Samsung Electronics