public inbox for kernel-janitors@vger.kernel.org
 help / color / mirror / Atom feed
From: Julia Lawall <julia.lawall@lip6.fr>
To: walter harms <wharms@bfs.de>
Cc: Colin King <colin.king@canonical.com>,
	Mauro Carvalho Chehab <mchehab@kernel.org>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Alan Cox <alan@linux.intel.com>,
	linux-media@vger.kernel.org, devel@driverdev.osuosl.org,
	kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] staging: atomisp: clean up return logic, remove redunant code
Date: Sun, 12 Mar 2017 15:00:23 +0000	[thread overview]
Message-ID: <alpine.DEB.2.20.1703121559470.2174@hadrien> (raw)
In-Reply-To: <58C561B5.8080102@bfs.de>



On Sun, 12 Mar 2017, walter harms wrote:

>
>
> Am 11.03.2017 20:32, schrieb Colin King:
> > From: Colin Ian King <colin.king@canonical.com>
> >
> > There is no need to check if ret is non-zero, remove this
> > redundant check and just return the error status from the call
> > to mt9m114_write_reg_array.
> >
> > Detected by CoverityScan, CID#1416577 ("Identical code for
> > different branches")
> >
> > Signed-off-by: Colin Ian King <colin.king@canonical.com>
> > ---
> >  drivers/staging/media/atomisp/i2c/mt9m114.c | 6 +-----
> >  1 file changed, 1 insertion(+), 5 deletions(-)
> >
> > diff --git a/drivers/staging/media/atomisp/i2c/mt9m114.c b/drivers/staging/media/atomisp/i2c/mt9m114.c
> > index 8762124..a555aec 100644
> > --- a/drivers/staging/media/atomisp/i2c/mt9m114.c
> > +++ b/drivers/staging/media/atomisp/i2c/mt9m114.c
> > @@ -444,12 +444,8 @@ static int mt9m114_set_suspend(struct v4l2_subdev *sd)
> >  static int mt9m114_init_common(struct v4l2_subdev *sd)
> >  {
> >  	struct i2c_client *client = v4l2_get_subdevdata(sd);
> > -	int ret;
> >
> > -	ret = mt9m114_write_reg_array(client, mt9m114_common, PRE_POLLING);
> > -	if (ret)
> > -		return ret;
> > -	return ret;
> > +	return mt9m114_write_reg_array(client, mt9m114_common, PRE_POLLING);
> >  }
>
>
> any use for "client" ?

I guess the code would be on two lines in any case.  It looks like a nice
decomposition as is.

julia

      reply	other threads:[~2017-03-12 15:00 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-11 19:32 [PATCH] staging: atomisp: clean up return logic, remove redunant code Colin King
2017-03-12 14:56 ` walter harms
2017-03-12 15:00   ` Julia Lawall [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=alpine.DEB.2.20.1703121559470.2174@hadrien \
    --to=julia.lawall@lip6.fr \
    --cc=alan@linux.intel.com \
    --cc=colin.king@canonical.com \
    --cc=devel@driverdev.osuosl.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@kernel.org \
    --cc=wharms@bfs.de \
    /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