From: Rebecca Mckeever <remckee0@gmail.com>
To: Alison Schofield <alison.schofield@intel.com>
Cc: Larry Finger <Larry.Finger@lwfinger.net>,
Phillip Potter <phil@philpotter.co.uk>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org,
outreachy@lists.linux.dev
Subject: Re: [PATCH] staging: r8188eu: fix suspect code indent for conditional statements
Date: Tue, 29 Mar 2022 19:48:03 -0500 [thread overview]
Message-ID: <YkOowzOkAE5Fr1dW@bertie> (raw)
In-Reply-To: <20220329161632.GA1169956@alison-desk>
On Tue, Mar 29, 2022 at 09:16:32AM -0700, Alison Schofield wrote:
> On Tue, Mar 29, 2022 at 02:53:36AM -0500, Rebecca Mckeever wrote:
> > Align the if and else if branches of the conditional statement
> > to improve readability. Prevent bugs that could be introduced
> > if developers misread the code. Issue found by checkpatch.
>
> Thanks for the patch Rebecca!
>
> Lots of stuff done right - passes chkp, compiles, patch is sent to
> correct recipients, the commit message follows the format of the file.
>
> Let's set a pattern here for all checkpatch related cleanups,
> for you and others that follow.(Thanks for being the first ;))
>
> Commit msg says 'what'. Commit log says 'why'. Acknowledge that
> it was found using checkpatch in the commit log also. (In the future
> you may be acknowledging use of other tools like sparse, coccinelle.)
>
> Note that the 'why' is never that a tool reported an error. The 'why'
> for these checkpatch reports is usually to follow the Linux Kernel
> Coding Style.
>
> 'Fix' in the commit message is needlessly generic. Perhaps:
> [PATCH] staging: r8188eu: align both branches of a conditional statement
>
> Commit log: (what you have is fine in the log)
> I usually paste in the checkpatch error explicitly so it can be grep'd
> for. Something like:
>
> Issue found by checkpatch:
> WARNING: suspect code indent for conditional statements
There was a section of https://kernelnewbies.org/PatchPhilosophy that suggested
putting the warning message in the subject line. I thought it would be
redundant to also put it in the body. Is it a good practice to include the
warning message in both places?
>
> Thanks,
> Alison
>
> >
> > Signed-off-by: Rebecca Mckeever <remckee0@gmail.com>
> > ---
> > drivers/staging/r8188eu/core/rtw_cmd.c | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/drivers/staging/r8188eu/core/rtw_cmd.c b/drivers/staging/r8188eu/core/rtw_cmd.c
> > index 6eca30124ee8..ccc43c0ba433 100644
> > --- a/drivers/staging/r8188eu/core/rtw_cmd.c
> > +++ b/drivers/staging/r8188eu/core/rtw_cmd.c
> > @@ -1408,7 +1408,7 @@ void rtw_survey_cmd_callback(struct adapter *padapter, struct cmd_obj *pcmd)
> > /* TODO: cancel timer and do timeout handler directly... */
> > /* need to make timeout handlerOS independent */
> > _set_timer(&pmlmepriv->scan_to_timer, 1);
> > - } else if (pcmd->res != H2C_SUCCESS) {
> > + } else if (pcmd->res != H2C_SUCCESS) {
> > _set_timer(&pmlmepriv->scan_to_timer, 1);
> > }
> >
> > --
> > 2.32.0
> >
> >
>
Thanks,
Rebecca
next prev parent reply other threads:[~2022-03-30 0:48 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-03-29 7:53 [PATCH] staging: r8188eu: fix suspect code indent for conditional statements Rebecca Mckeever
2022-03-29 16:16 ` Alison Schofield
2022-03-30 0:48 ` Rebecca Mckeever [this message]
2022-03-30 1:09 ` Alison Schofield
2022-03-30 6:28 ` Dan Carpenter
2022-03-31 12:06 ` Rebecca Mckeever
2022-03-31 12:21 ` Dan Carpenter
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=YkOowzOkAE5Fr1dW@bertie \
--to=remckee0@gmail.com \
--cc=Larry.Finger@lwfinger.net \
--cc=alison.schofield@intel.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-staging@lists.linux.dev \
--cc=outreachy@lists.linux.dev \
--cc=phil@philpotter.co.uk \
/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;
as well as URLs for NNTP newsgroup(s).