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:   Tue, 18 May 2021 18:59:33 +0100
From:   Jonathan Cameron <jic23@...nel.org>
To:     tangbin <tangbin@...s.chinamobile.com>
Cc:     Dan Carpenter <dan.carpenter@...cle.com>, lars@...afoo.de,
        Michael.Hennerich@...log.com, knaack.h@....de, pmeerw@...erw.net,
        gregkh@...uxfoundation.org, linux-iio@...r.kernel.org,
        devel@...verdev.osuosl.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] staging: iio: cdc: ad7746: Fix unnecessary check
 andassignment in ad7746_probe()

On Tue, 18 May 2021 17:27:07 +0800
tangbin <tangbin@...s.chinamobile.com> wrote:

> Hi Dan:
> 
> On 2021/5/18 15:52, Dan Carpenter wrote:
> > On Mon, May 17, 2021 at 11:00:06PM +0800, Tang Bin wrote:  
> >> @@ -730,11 +730,7 @@ static int ad7746_probe(struct i2c_client *client,
> >>   	if (ret < 0)
> >>   		return ret;
> >>   
> >> -	ret = devm_iio_device_register(indio_dev->dev.parent, indio_dev);
> >> -	if (ret)
> >> -		return ret;
> >> -
> >> -	return 0;
> >> +	return devm_iio_device_register(indio_dev->dev.parent, indio_dev);
> >>   }  
> > This sort of thing is done deliberately as a style choice...  I probably
> > wouldn't have written it that way myself, but there really isn't a
> > downside to leaving it as-is.
> >
> > The unused "int ret = 0;" just introduces a static checker warning about
> > unused assignments and disables the static checker warning for
> > uninitialized variables so we want to remove that.
> >  
> Got it, I will send this patch for you.

I fall a bit different on this and would consider the above a cleanup
though one I'd prefer to get with more significant stuff rather
than on it's own.  However, there is already a patch in revision
that includes the same change from Lucas Stankus.

> 
> Thanks
> 
> Tang Bin
> 
> 
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ