Re: [PATCH v2] staging: rtl8723bs: fix lines exceeding 100 columns in rtw_security.c

From: Dan Carpenter

Date: Tue Sep 15 2026 - 03:58:30 EST


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@xxxxxxxxx>
> ---

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