public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: Kushal Kothari <kushalkothari285@gmail.com>
Cc: gregkh@linuxfoundation.org, kush19992810@gmail.com,
	outreachy-kernel@googlegroups.com, fabioaiuto83@gmail.com,
	ross.schm.dev@gmail.com, fmdefrancesco@gmail.com,
	marcocesati@gmail.com, straube.linux@gmail.com,
	philippesdixon@gmail.com, manuelpalenzuelamerino@gmail.com,
	linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org,
	mike.rapoport@gmail.com, kushalkotharitest@googlegroups.com
Subject: Re: [PATCH v4 1/4] staging: rtl8723bs: core: Remove true and false comparison
Date: Wed, 3 Nov 2021 15:21:59 +0300	[thread overview]
Message-ID: <20211103122159.GT2794@kadam> (raw)
In-Reply-To: <47dd38847c4e36742f88f4493773fef602ca079b.1634967010.git.kushalkothari285@gmail.com>

On Sat, Oct 23, 2021 at 01:05:47PM +0530, Kushal Kothari wrote:
>  	struct mlme_priv *pmlmepriv = &(padapter->mlmepriv);
>  	u8 mstatus;
>  
> -	if ((check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE) == true)
> -		|| (check_fwstate(pmlmepriv, WIFI_ADHOC_STATE) == true)) {
> +	if ((check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE)) ||
> +		(check_fwstate(pmlmepriv, WIFI_ADHOC_STATE))) {
>  		return;
>  	}
>  

This is a "let it slide" moment.

Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>

Normally would keep my mouth shut but we had already discussed it a bit
and it's really important to know the rules.  In your original patch
you did this correctly, and then a reviewer made a comment about a
different set of parentheses and you modified this one as well so now
it's wrong.  The extra parens get removed in [PATCH 2/2] so, whatever,
it's fine.

The rule is that if you change a line of code you are allowed to make
small changes to fix the style to make checkpatch happy about *THAT
LINE*.  It's not required.  Try to avoid making too many unrelated
changes if it's going to make reviewing difficult.

But I don't want to see three patches fixing the style for a single line
of code.  You can take it too far in either direction.  We had a guy
who was re-writing all the error handling for a function but he would do
it in 5 to 8 patches.  It was crazy hard to review.  He introduced a lot
of bugs as well.  It would have been easier to review as one patch.

But if you change a line and your change introduces a checkpatch warning
then you *must* change the line.  So here, removing the == true, means
you *must* remove the extra parentheses.

But it's fine.  Now you know the rules and can do correctly going
forward.

regards,
dan carpenter

  reply	other threads:[~2021-11-03 12:23 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-23  7:35 [PATCH v4 0/4] staging: rtl8723bs: core: Cleanup patchset for style issues in rtw_cmd.c Kushal Kothari
2021-10-23  7:35 ` [PATCH v4 1/4] staging: rtl8723bs: core: Remove true and false comparison Kushal Kothari
2021-11-03 12:21   ` Dan Carpenter [this message]
2021-10-23  7:35 ` [PATCH v4 2/4] staging: rtl8723bs: core: Remove unnecessary parentheses Kushal Kothari
2021-10-23  7:35 ` [PATCH v4 3/4] staging: rtl8723bs: core: Remove unnecessary space after a cast Kushal Kothari
2021-11-03 12:04   ` Dan Carpenter
2021-10-23  7:35 ` [PATCH v4 4/4] staging: rtl8723bs: core: Remove unnecessary blank lines Kushal Kothari

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=20211103122159.GT2794@kadam \
    --to=dan.carpenter@oracle.com \
    --cc=fabioaiuto83@gmail.com \
    --cc=fmdefrancesco@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=kush19992810@gmail.com \
    --cc=kushalkothari285@gmail.com \
    --cc=kushalkotharitest@googlegroups.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-staging@lists.linux.dev \
    --cc=manuelpalenzuelamerino@gmail.com \
    --cc=marcocesati@gmail.com \
    --cc=mike.rapoport@gmail.com \
    --cc=outreachy-kernel@googlegroups.com \
    --cc=philippesdixon@gmail.com \
    --cc=ross.schm.dev@gmail.com \
    --cc=straube.linux@gmail.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