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]
Message-ID: <f3155983-cf67-2f78-f0f5-7a3acb041ab2@mev.co.uk>
Date:   Tue, 13 Mar 2018 10:35:29 +0000
From:   Ian Abbott <abbotti@....co.uk>
To:     Colin King <colin.king@...onical.com>,
        H Hartley Sweeten <hsweeten@...ionengravers.com>,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        devel@...verdev.osuosl.org
Cc:     kernel-janitors@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] staging: comedi: adl_pci6208: remove redundant
 initialization of 'val'

On 12/03/18 23:36, Colin King wrote:
> From: Colin Ian King <colin.king@...onical.com>
> 
> Variable 'val' is initialized with a value that is never read, it is
> updated with a new value again after intitialization. Remove the
> redundant initialization and move the declaration and assignment into
> the scope of the for-loop.
> 
> Cleans up clang warning:
> drivers/staging/comedi/drivers/adl_pci6208.c:61:15: warning: Value
> stored to 'val' during its initialization is never read
> 
> Signed-off-by: Colin Ian King <colin.king@...onical.com>
> ---
>   drivers/staging/comedi/drivers/adl_pci6208.c | 3 +--
>   1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/drivers/staging/comedi/drivers/adl_pci6208.c b/drivers/staging/comedi/drivers/adl_pci6208.c
> index d39b4eabce8d..e21840e9002d 100644
> --- a/drivers/staging/comedi/drivers/adl_pci6208.c
> +++ b/drivers/staging/comedi/drivers/adl_pci6208.c
> @@ -58,12 +58,11 @@ static int pci6208_ao_insn_write(struct comedi_device *dev,
>   				 unsigned int *data)
>   {
>   	unsigned int chan = CR_CHAN(insn->chanspec);
> -	unsigned int val = s->readback[chan];
>   	int ret;
>   	int i;
>   
>   	for (i = 0; i < insn->n; i++) {
> -		val = data[i];
> +		unsigned int val = data[i];
>   
>   		/* D/A transfer rate is 2.2us */
>   		ret = comedi_timeout(dev, s, insn, pci6208_ao_eoc, 0);
> 

Looks good, thanks!

Reviewed-by: Ian Abbott <abbotti@....co.uk>

-- 
-=( Ian Abbott @ MEV Ltd.    E-mail: <abbotti@....co.uk> )=-
-=(                          Web: http://www.mev.co.uk/  )=-

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ