All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: Anirudh Rayabharam <anirudh.rayabharam@gmail.com>
Cc: gregkh@linuxfoundation.org, Larry.Finger@lwfinger.net,
	hadess@hadess.net, hdegoede@redhat.com,
	devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] staging: rtl8723bs: core: fix line over 80 characters warning
Date: Wed, 27 Mar 2019 09:36:06 +0300	[thread overview]
Message-ID: <20190327063606.GD32590@kadam> (raw)
In-Reply-To: <20190326182309.GA33380@auvm>

On Tue, Mar 26, 2019 at 11:55:07PM +0530, Anirudh Rayabharam wrote:
> Shorten the expression by re-using the part that was already computed to

This confused me.  Better to phrase it like:

Shorten the expression by using the "psecuritypriv" pointer.

> fix the line over 80 characters warning reported by checkpatch.pl.
> 
> Signed-off-by: Anirudh Rayabharam <anirudh.rayabharam@gmail.com>
> ---
>  drivers/staging/rtl8723bs/core/rtw_ap.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/staging/rtl8723bs/core/rtw_ap.c b/drivers/staging/rtl8723bs/core/rtw_ap.c
> index 18fabf5ff44b..bc0230672457 100644
> --- a/drivers/staging/rtl8723bs/core/rtw_ap.c
> +++ b/drivers/staging/rtl8723bs/core/rtw_ap.c
> @@ -2336,8 +2336,8 @@ void rtw_ap_restore_network(struct adapter *padapter)
>  			Update_RA_Entry(padapter, psta);
>  			/* pairwise key */
>  			/* per sta pairwise key and settings */
> -			if ((padapter->securitypriv.dot11PrivacyAlgrthm == _TKIP_) ||
> -				(padapter->securitypriv.dot11PrivacyAlgrthm == _AES_)) {
> +			if ((psecuritypriv->dot11PrivacyAlgrthm == _TKIP_) ||
> +				(psecuritypriv->dot11PrivacyAlgrthm == _AES_)) {

It's better to align it slightly different as well.  In the kernel we
would normally align the second condition to match the first one.

I probably would have gotten rid of the parenthesis as well.  I don't
like double parenthesis around == because I reserve that for =
assignment conditions.

			if (psecuritypriv->dot11PrivacyAlgrthm == _TKIP_ ||
			    psecuritypriv->dot11PrivacyAlgrthm == _AES_) {
				rtw_setstakey_cmd(padapter, psta, true, false);

When you're changing just a couple lines like this you can get away with
making multiple white space changes at the same time because the One
Thing that the patch does is "Clean up a Condition".  There is some
flexibility in the One thing Per Patch rule, but you have to sell it in
the right way.  The patch description would be:

  Checkpatch.pl complains that this line is over 80 characters.  We
  should use the "psecuritypriv" for consistency.  It's not aligned
  properly and there are too many parenthesis.

  This patch just cleans up a condition, it doesn't affect runtime.

regards,
dan carpenter

  reply	other threads:[~2019-03-27  6:36 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-26 18:25 [PATCH] staging: rtl8723bs: core: fix line over 80 characters warning Anirudh Rayabharam
2019-03-27  6:36 ` Dan Carpenter [this message]
2019-03-27 18:19 ` [PATCH v2] " Anirudh Rayabharam
2019-03-28  2:07   ` Dan Carpenter
2019-03-28  2:13   ` Joe Perches
2019-03-29 16:13   ` Greg KH
2019-03-30 11:58   ` Anirudh Rayabharam
2019-03-29 21:16 ` [PATCH] " Mukesh Ojha

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=20190327063606.GD32590@kadam \
    --to=dan.carpenter@oracle.com \
    --cc=Larry.Finger@lwfinger.net \
    --cc=anirudh.rayabharam@gmail.com \
    --cc=devel@driverdev.osuosl.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=hadess@hadess.net \
    --cc=hdegoede@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    /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.