public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
From: Deepak R Varma <drv@mailo.com>
To: Fabio Estevam <festevam@gmail.com>
Cc: Steve Longerbeam <slongerbeam@gmail.com>,
	Philipp Zabel <p.zabel@pengutronix.de>,
	Mauro Carvalho Chehab <mchehab@kernel.org>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Shawn Guo <shawnguo@kernel.org>,
	Sascha Hauer <s.hauer@pengutronix.de>,
	Pengutronix Kernel Team <kernel@pengutronix.de>,
	NXP Linux Team <linux-imx@nxp.com>,
	linux-media@vger.kernel.org, linux-staging@lists.linux.dev,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org,
	Saurabh Singh Sengar <ssengar@microsoft.com>,
	Praveen Kumar <kumarpraveen@linux.microsoft.com>,
	Deepak R Varma <drv@mailo.com>
Subject: Re: [PATCH] staging: media: imx: remove unnecessary return variable
Date: Tue, 3 Jan 2023 17:27:14 +0530	[thread overview]
Message-ID: <Y7QYGjc+arvVvR3U@qemulion> (raw)
In-Reply-To: <CAOMZO5Adkz2ZZaWF1VQgTZ43LB-+MqLxp+smS_zFBSJK+x7bjA@mail.gmail.com>

On Tue, Jan 03, 2023 at 08:50:51AM -0300, Fabio Estevam wrote:
> On Tue, Jan 3, 2023 at 8:45 AM Deepak R Varma <drv@mailo.com> wrote:
> >
> > The function imx_media_fim_set_stream() can directly return 0 instead of
> > using a ret variable which never changes its value. Issue identified
> > using the returnvar.cocci Coccinelle semantic patch.
> >
> > Signed-off-by: Deepak R Varma <drv@mailo.com>
> > ---
> >  drivers/staging/media/imx/imx-media-fim.c | 3 +--
> >  1 file changed, 1 insertion(+), 2 deletions(-)
> >
> > diff --git a/drivers/staging/media/imx/imx-media-fim.c b/drivers/staging/media/imx/imx-media-fim.c
> > index fb6590dcfc36..e719227d4323 100644
> > --- a/drivers/staging/media/imx/imx-media-fim.c
> > +++ b/drivers/staging/media/imx/imx-media-fim.c
> > @@ -373,7 +373,6 @@ int imx_media_fim_set_stream(struct imx_media_fim *fim,
> >                              bool on)
> >  {
> >         unsigned long flags;
> > -       int ret = 0;
> >
> >         v4l2_ctrl_lock(fim->ctrl[FIM_CL_ENABLE]);
> >
> > @@ -393,7 +392,7 @@ int imx_media_fim_set_stream(struct imx_media_fim *fim,
> >         fim->stream_on = on;
> >  out:
> >         v4l2_ctrl_unlock(fim->ctrl[FIM_CL_ENABLE]);
> > -       return ret;
> > +       return 0;
>
> Maybe you could change imx_media_fim_set_stream() to a void function instead?

That sounds more accurate. I will send in the revision as v2. Thank you so much
for the feedback.

Regards,
./drv

>



_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

      reply	other threads:[~2023-01-03 15:58 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-03 11:44 [PATCH] staging: media: imx: remove unnecessary return variable Deepak R Varma
2023-01-03 11:50 ` Fabio Estevam
2023-01-03 11:57   ` Deepak R Varma [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=Y7QYGjc+arvVvR3U@qemulion \
    --to=drv@mailo.com \
    --cc=festevam@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=kernel@pengutronix.de \
    --cc=kumarpraveen@linux.microsoft.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-imx@nxp.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=linux-staging@lists.linux.dev \
    --cc=mchehab@kernel.org \
    --cc=p.zabel@pengutronix.de \
    --cc=s.hauer@pengutronix.de \
    --cc=shawnguo@kernel.org \
    --cc=slongerbeam@gmail.com \
    --cc=ssengar@microsoft.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