All of lore.kernel.org
 help / color / mirror / Atom feed
From: Madhumthia Prabakaran <madhumithabiw@gmail.com>
To: Julia Lawall <julia.lawall@lip6.fr>, outreachy-kernel@googlegroups.com
Subject: Re: [Outreachy kernel] [PATCH] Staging: rtl872bs: Remove local variables in functions
Date: Wed, 13 Mar 2019 16:49:46 -0500	[thread overview]
Message-ID: <20190313214945.GB5065@madhuleo> (raw)
In-Reply-To: <alpine.DEB.2.21.1903132045230.2515@hadrien>

On Wed, Mar 13, 2019 at 08:48:09PM +0100, Julia Lawall wrote:
> 
> 
> On Wed, 13 Mar 2019, Madhumitha Prabakaran wrote:
> 
> > Remove declarations of local variables in functions rtw_init_cmd_priv
> > and rtw_init_evt_priv.
> > Issue suggested by Coccinelle using ret.cocci.
> >
> > Signed-off-by: Madhumitha Prabakaran <madhumithabiw@gmail.com>
> > ---
> >  drivers/staging/rtl8723bs/core/rtw_cmd.c | 10 ++--------
> >  1 file changed, 2 insertions(+), 8 deletions(-)
> >
> > diff --git a/drivers/staging/rtl8723bs/core/rtw_cmd.c b/drivers/staging/rtl8723bs/core/rtw_cmd.c
> > index 91520ca3bbad..814a4b7677a9 100644
> > --- a/drivers/staging/rtl8723bs/core/rtw_cmd.c
> > +++ b/drivers/staging/rtl8723bs/core/rtw_cmd.c
> > @@ -297,18 +297,12 @@ struct	cmd_obj	*_rtw_dequeue_cmd(struct __queue *queue)
> >
> >  u32 rtw_init_cmd_priv(struct cmd_priv *pcmdpriv)
> >  {
> > -	u32 res;
> > -
> > -	res = _rtw_init_cmd_priv(pcmdpriv);
> > -	return res;
> > +	return _rtw_init_cmd_priv(pcmdpriv);
> >  }
> >
> >  u32 rtw_init_evt_priv(struct	evt_priv *pevtpriv)
> >  {
> > -	int	res;
> > -
> > -	res = _rtw_init_evt_priv(pevtpriv);
> > -	return res;
> > +	return _rtw_init_evt_priv(pevtpriv);
> >  }
> 
> I wonder if there is something more drastic that you could do here.  The
> functions that these functions call (the ones with the _s) are called only
> once.  They have a different return type (sint) than these functions
> (u32).  They are declared as extern, but they are only used in the file in
> which they are defined.  It looks like things could be greatly simplified.
> 
> julia
> 
> 
> >
> >  void rtw_free_evt_priv(struct	evt_priv *pevtpriv)
> > --
> > 2.17.1
> >
> > --
> > You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
> > To unsubscribe from this group and stop receiving emails from it, send an email to outreachy-kernel+unsubscribe@googlegroups.com.
> > To post to this group, send email to outreachy-kernel@googlegroups.com.
> > To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/20190313155425.5548-1-madhumithabiw%40gmail.com.
> > For more options, visit https://groups.google.com/d/optout.
> >
> 
> -- 
> You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to outreachy-kernel+unsubscribe@googlegroups.com.
> To post to this group, send email to outreachy-kernel@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/alpine.DEB.2.21.1903132045230.2515%40hadrien.
> For more options, visit https://groups.google.com/d/optout.

Should I submit this as patch series, along with other modified file.

Thanks,
Madhumitha


  reply	other threads:[~2019-03-13 21:49 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-13 15:54 [PATCH] Staging: rtl872bs: Remove local variables in functions Madhumitha Prabakaran
2019-03-13 19:48 ` [Outreachy kernel] " Julia Lawall
2019-03-13 21:49   ` Madhumthia Prabakaran [this message]
2019-03-13 22:06     ` Julia Lawall
2019-03-13 22:36       ` Madhumthia Prabakaran
2019-03-14  6:15         ` Julia Lawall
2019-03-14 16:03           ` Madhumthia Prabakaran
2019-03-14 19:52             ` Julia Lawall
2019-03-14 22:14               ` Madhumthia Prabakaran

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=20190313214945.GB5065@madhuleo \
    --to=madhumithabiw@gmail.com \
    --cc=julia.lawall@lip6.fr \
    --cc=outreachy-kernel@googlegroups.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.