lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:   Mon, 11 Nov 2019 16:40:37 +0100
From:   Greg KH <gregkh@...uxfoundation.org>
To:     Zheng Yongjun <zhengyongjun3@...wei.com>
Cc:     dri-devel@...ts.freedesktop.org, davem@...emloft.net,
        linux-kernel@...r.kernel.org, Hulk Robot <hulkci@...wei.com>
Subject: Re: [PATCH] staging: fbtft: Remove set but not used variable 'ret'

On Sun, Nov 10, 2019 at 06:57:07PM +0800, Zheng Yongjun wrote:
> Fixes gcc '-Wunused-but-set-variable' warning:
> 
> drivers/staging/fbtft/fb_ili9320.c: In function read_devicecode:
> drivers/staging/fbtft/fb_ili9320.c:25:6: warning: variable ret set but not used [-Wunused-but-set-variable]
> 
> ret is never used, so remove it.
> 
> Reported-by: Hulk Robot <hulkci@...wei.com>
> Signed-off-by: Zheng Yongjun <zhengyongjun3@...wei.com>
> ---
>  drivers/staging/fbtft/fb_ili9320.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/drivers/staging/fbtft/fb_ili9320.c b/drivers/staging/fbtft/fb_ili9320.c
> index f2e72d14431d..f0ebc40857b3 100644
> --- a/drivers/staging/fbtft/fb_ili9320.c
> +++ b/drivers/staging/fbtft/fb_ili9320.c
> @@ -22,11 +22,10 @@
>  
>  static unsigned int read_devicecode(struct fbtft_par *par)
>  {
> -	int ret;
>  	u8 rxbuf[8] = {0, };
>  
>  	write_reg(par, 0x0000);
> -	ret = par->fbtftops.read(par, rxbuf, 4);
> +	par->fbtftops.read(par, rxbuf, 4);
>  	return (rxbuf[2] << 8) | rxbuf[3];
>  }
>  

If the read call can fail, shouldn't you be passing back the error
value instead?

thanks,

greg k-h

> -- 
> 2.23.0
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ