DriverDev-Devel Archive mirror
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: tangbin <tangbin@cmss.chinamobile.com>
Cc: devel@driverdev.osuosl.org, lars@metafoo.de,
	Michael.Hennerich@analog.com, linux-iio@vger.kernel.org,
	gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org,
	pmeerw@pmeerw.net, knaack.h@gmx.de,
	Dan Carpenter <dan.carpenter@oracle.com>
Subject: Re: [PATCH] staging: iio: cdc: ad7746: Fix unnecessary check andassignment in ad7746_probe()
Date: Tue, 18 May 2021 18:59:33 +0100	[thread overview]
Message-ID: <20210518185933.7839f848@jic23-huawei> (raw)
In-Reply-To: <dfb7d829-94e6-2051-8795-79402160afdb@cmss.chinamobile.com>

On Tue, 18 May 2021 17:27:07 +0800
tangbin <tangbin@cmss.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
> 
> 
> 

_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

      reply	other threads:[~2021-05-18 17:58 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-17 15:00 [PATCH] staging: iio: cdc: ad7746: Fix unnecessary check and assignment in ad7746_probe() Tang Bin
2021-05-17 22:14 ` Marcelo Schmitt
2021-05-18  3:19   ` [PATCH] staging: iio: cdc: ad7746: Fix unnecessary check andassignment " tangbin
2021-05-18  7:52 ` [PATCH] staging: iio: cdc: ad7746: Fix unnecessary check and assignment " Dan Carpenter
2021-05-18  9:27   ` [PATCH] staging: iio: cdc: ad7746: Fix unnecessary check andassignment " tangbin
2021-05-18 17:59     ` Jonathan Cameron [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210518185933.7839f848@jic23-huawei \
    --to=jic23@kernel.org \
    --cc=Michael.Hennerich@analog.com \
    --cc=dan.carpenter@oracle.com \
    --cc=devel@driverdev.osuosl.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=knaack.h@gmx.de \
    --cc=lars@metafoo.de \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pmeerw@pmeerw.net \
    --cc=tangbin@cmss.chinamobile.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).