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 17:36:01 -0500 [thread overview]
Message-ID: <20190313223559.GC5065@madhuleo> (raw)
In-Reply-To: <alpine.DEB.2.21.1903132304420.2515@hadrien>
On Wed, Mar 13, 2019 at 11:06:53PM +0100, Julia Lawall wrote:
>
>
> On Wed, 13 Mar 2019, Madhumthia Prabakaran wrote:
>
> > 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.
>
> I'm not sure to understand the question. I expect that the changes I
> suggest above would need to be in one patch, because the kernel has to be
> able to compiler after each patch is applied.
>
> Please respond to messages right below the text you are responding to, and
> not at the end of the message. There is currently a good chance that your
> comments will be missed, because one doesn't pay much attention to what
> comes after the bla bla bla information about the group.
>
> julia
>
> --
> 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.1903132304420.2515%40hadrien.
> For more options, visit https://groups.google.com/d/optout.
The change need to be made in two files - drivers/staging/rtl8723bs/core/rtw_cmd.c
1) drivers/staging/rtl8723bs/core/rtw_cmd.c
2) drivers/staging/rtl8723bs/include/cmd_osdep.h (to remove extern from function prototypes)
So that's reason why I asked whether it has to be send as patch series or I can submit it as individual patches.
In rtw_cmd.c, along with the change already made, I will change the return expression. i.e.
next prev parent reply other threads:[~2019-03-13 22:36 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
2019-03-13 22:06 ` Julia Lawall
2019-03-13 22:36 ` Madhumthia Prabakaran [this message]
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=20190313223559.GC5065@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.