All of lore.kernel.org
 help / color / mirror / Atom feed
From: Marcos Antonio de Jesus Filho <mdejesusfilho@gmail.com>
To: Julia Lawall <julia.lawall@inria.fr>
Cc: Forest Bond <forest@alittletooquiet.net>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	outreachy-kernel@googlegroups.com
Subject: Re: [Outreachy kernel] [PATCH 3/3] staging: vt6655: Remove useless else
Date: Sat, 31 Oct 2020 07:48:06 -0700	[thread overview]
Message-ID: <20201031144806.GC1965@Zangetsu> (raw)
In-Reply-To: <alpine.DEB.2.22.394.2010311027260.2733@hadrien>

On Sat, Oct 31, 2020 at 10:28:18AM +0100, Julia Lawall wrote:
> 
> 
> On Sat, 31 Oct 2020, Marcos Antonio de Jesus Filho wrote:
> 
> > The else statement is not useful due to the presence of a return
> > statement on the if block. Remove the else statement, adjust the
> > indentation of the code and remove useless return statement. Reported by checkpatch.
> >
> > Signed-off-by: Marcos Antonio de Jesus Filho <mdejesusfilho@gmail.com>
> > ---
> >  drivers/staging/vt6655/rxtx.c | 38 +++++++++++++++++------------------
> >  1 file changed, 19 insertions(+), 19 deletions(-)
> >
> > diff --git a/drivers/staging/vt6655/rxtx.c b/drivers/staging/vt6655/rxtx.c
> > index 9db4317f9a42..508e1bd7d76e 100644
> > --- a/drivers/staging/vt6655/rxtx.c
> > +++ b/drivers/staging/vt6655/rxtx.c
> > @@ -440,6 +440,8 @@ s_uFillDataHead(
> >  	bool is_pspoll
> >  )
> >  {
> > +	struct vnt_tx_datahead_ab *buf = pTxDataHead;
> > +
> 
> I'm not sure what was the goal of the above addition, but it also looks
> strange to declare the variable buf and then, on immediately the next
> line, not to use it.

The goal of this change is to make the fix and not introduce a build warning,
because I can not mix variable declaration and code, otherwise I would get an
"ISO C90 forbids mixed declarations and code in C" warning.

Marcos



  reply	other threads:[~2020-10-31 14:48 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-31  9:00 [PATCH 0/3] staging: vt6655: Remove else after return Marcos Antonio de Jesus Filho
2020-10-31  9:00 ` [PATCH 1/3] staging: vt6655: Remove useless else Marcos Antonio de Jesus Filho
2020-10-31  9:01 ` [PATCH 2/3] " Marcos Antonio de Jesus Filho
2020-10-31  9:01 ` [PATCH 3/3] " Marcos Antonio de Jesus Filho
2020-10-31  9:25   ` [Outreachy kernel] " Julia Lawall
2020-10-31  9:28   ` Julia Lawall
2020-10-31 14:48     ` Marcos Antonio de Jesus Filho [this message]
2020-10-31  9:37 ` [Outreachy kernel] [PATCH 0/3] staging: vt6655: Remove else after return Julia Lawall
2020-10-31 14:25   ` Marcos Antonio de Jesus Filho
2020-10-31 15:05     ` Julia Lawall

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=20201031144806.GC1965@Zangetsu \
    --to=mdejesusfilho@gmail.com \
    --cc=forest@alittletooquiet.net \
    --cc=gregkh@linuxfoundation.org \
    --cc=julia.lawall@inria.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.