mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Dan Carpenter <error27@gmail.com>
To: "Rareș-Mihai Vladu" <vladurares@gmail.com>
Cc: gregkh@linuxfoundation.org, linux-staging@lists.linux.dev,
	linux-kernel@vger.kernel.org, lkp@intel.com
Subject: Re: [PATCH v2] staging: rtl8723bs: fix lines exceeding 100 columns in rtw_security.c
Date: Tue, 15 Sep 2026 10:58:17 +0300	[thread overview]
Message-ID: <aqj6mUt9Q5hO8abv@stanley.mountain> (raw)
In-Reply-To: <20260915072923.1014216-1-vladurares@gmail.com>

On Tue, Sep 15, 2026 at 07:29:23AM +0000, Rareș-Mihai Vladu wrote:
> Reformat long lines in rtw_security.c to fit within the 100-column
> limit by splitting function arguments, expressions, and moving
> 
> Signed-off-by: Rareș-Mihai Vladu <vladurares@gmail.com>
> ---

What changed?
https://staticthinking.wordpress.com/2022/07/27/how-to-send-a-v2-patch/

> @@ -112,9 +119,16 @@ void rtw_wep_decrypt(struct adapter  *padapter, u8 *precvframe)
>  		keyindex = prxattrib->key_index;
>  		keylength = psecuritypriv->dot11DefKeylen[keyindex];
>  		memcpy(&wepkey[0], iv, 3);
> -		/* memcpy(&wepkey[3], &psecuritypriv->dot11DefKey[psecuritypriv->dot11PrivacyKeyIndex].skey[0], keylength); */
> -		memcpy(&wepkey[3], &psecuritypriv->dot11DefKey[keyindex].skey[0], keylength);
> -		length = ((union recv_frame *)precvframe)->u.hdr.len - prxattrib->hdrlen - prxattrib->iv_len;
> +		/*
> +		 *  memcpy(&wepkey[3],
> +		 *         &psecuritypriv->dot11DefKey[psecuritypriv->dot11PrivacyKeyIndex].skey[0],
> +		 *         keylength);
> +		 */

Don't worry about polishing dead code, just delete it.  (In a separate
patch).

> +		memcpy(&wepkey[3],
> +		       &psecuritypriv->dot11DefKey[keyindex].skey[0],
> +		       keylength);
> +		length = ((union recv_frame *)precvframe)->u.hdr.len -
> +			 prxattrib->hdrlen - prxattrib->iv_len;
>  
>  		payload = pframe + prxattrib->iv_len + prxattrib->hdrlen;
>  

[ snip ]

> @@ -1300,8 +1334,10 @@ u32 rtw_BIP_verify(struct adapter *padapter, u8 *precvframe)
>  		/* conscruct AAD, copy address 1 to address 3 */
>  		memcpy(BIP_AAD + 2, &pwlanhdr->addrs, sizeof(pwlanhdr->addrs));
>  
> -		if (omac1_aes_128(padapter->securitypriv.dot11wBIPKey[padapter->securitypriv.dot11wBIPKeyid].skey
> -			, BIP_AAD, ori_len, mic))
> +		int bip_keyid = padapter->securitypriv.dot11wBIPKeyid;
> +		u8 *bip_key = padapter->securitypriv.dot11wBIPKey[bip_keyid].skey;

Don't declare variables in the middle of code unless it's a __cleanup
variable.

> +
> +		if (omac1_aes_128(bip_key, BIP_AAD, ori_len, mic))
>  			goto BIP_exit;
>  
>  		/* MIC field should be last 8 bytes of packet (packet without FCS) */

regards,
dan carpenter

      reply	other threads:[~2026-09-15  7:58 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-15  7:29 Rareș-Mihai Vladu
2026-09-15  7:58 ` Dan Carpenter [this message]

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=aqj6mUt9Q5hO8abv@stanley.mountain \
    --to=error27@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-staging@lists.linux.dev \
    --cc=lkp@intel.com \
    --cc=vladurares@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

all inboxes | Powered by JetHome®