public inbox for linux-staging@lists.linux.dev
 help / color / mirror / Atom feed
From: "Ethan Tidmore" <ethantidmore06@gmail.com>
To: "Nikolay Kulikov" <nikolayof23@gmail.com>, <gregkh@linuxfoundation.org>
Cc: <linux-staging@lists.linux.dev>
Subject: Re: [PATCH] staging: rtl8723bs: fix spaces around binary operators
Date: Wed, 18 Feb 2026 12:34:56 -0600	[thread overview]
Message-ID: <DGIAYPXFFQ1Q.1J195CKVQVKWI@gmail.com> (raw)
In-Reply-To: <20260218113229.9171-1-nikolayof23@gmail.com>

On Wed Feb 18, 2026 at 5:30 AM :
> Add missing spaces to comply with kernel coding style.
>
> Signed-off-by: Nikolay Kulikov <nikolayof23@gmail.com>
> ---

...

>  
>  	while (cnt < in_len) {
>  		if (eid == in_ie[cnt]
> -			&& (!oui || !memcmp(&in_ie[cnt+2], oui, oui_len))) {
> +			&& (!oui || !memcmp(&in_ie[cnt + 2], oui, oui_len))) {
>  			target_ie = &in_ie[cnt];

Logical continuations should be on the previous line:

while (cnt < in_len) {
	if (eid == in_ie[cnt] &&
		(!oui || !memcmp(&in_ie[cnt + 2], oui, oui_len))) {

...

>  
> -	if ((*wpa_ie != WLAN_EID_VENDOR_SPECIFIC) || (*(wpa_ie+1) != (u8)(wpa_ie_len - 2)) ||
> -	   (memcmp(wpa_ie+2, RTW_WPA_OUI_TYPE, WPA_SELECTOR_LEN))) {
> +	if ((*wpa_ie != WLAN_EID_VENDOR_SPECIFIC) || (*(wpa_ie + 1) != (u8)(wpa_ie_len - 2)) ||
> +	   (memcmp(wpa_ie + 2, RTW_WPA_OUI_TYPE, WPA_SELECTOR_LEN))) {
>  		return _FAIL;
>  	}

Alignment should match open parenthesis:

if ((*wpa_ie != WLAN_EID_VENDOR_SPECIFIC) || (*(wpa_ie + 1) != (u8)(wpa_ie_len - 2)) ||
	(memcmp(wpa_ie+2, RTW_WPA_OUI_TYPE, WPA_SELECTOR_LEN))) {

...

>  
>  		/* if (authmode == WLAN_EID_BSS_AC_ACCESS_DELAY) */
> -		if (authmode == WLAN_EID_BSS_AC_ACCESS_DELAY && (!memcmp(&in_ie[cnt+6], wapi_oui1, 4) ||
> -					!memcmp(&in_ie[cnt+6], wapi_oui2, 4))) {
> +		if (authmode == WLAN_EID_BSS_AC_ACCESS_DELAY && (!memcmp(&in_ie[cnt + 6], wapi_oui1, 4) ||
> +					!memcmp(&in_ie[cnt + 6], wapi_oui2, 4))) {

Ditto.

...

>  
>  	if (MCS_rate[0] & BIT(7))
> -		max_rate = (bw_40MHz) ? ((short_GI)?1500:1350):((short_GI)?722:650);
> +		max_rate = (bw_40MHz) ? ((short_GI) ? 1500:1350) : ((short_GI) ? 722:650);

You only fixed half of the problem here, you need to space out the other
ternary operator conditions too:

max_rate = (bw_40MHz) ? ((short_GI) ? 1500 : 1350) : ((short_GI) ? 722 : 650);

>  	else if (MCS_rate[0] & BIT(6))
> -		max_rate = (bw_40MHz) ? ((short_GI)?1350:1215):((short_GI)?650:585);
> +		max_rate = (bw_40MHz) ? ((short_GI) ? 1350:1215) : ((short_GI) ? 650:585);
>  	else if (MCS_rate[0] & BIT(5))
> -		max_rate = (bw_40MHz) ? ((short_GI)?1200:1080):((short_GI)?578:520);
> +		max_rate = (bw_40MHz) ? ((short_GI) ? 1200:1080) : ((short_GI) ? 578:520);
>  	else if (MCS_rate[0] & BIT(4))
> -		max_rate = (bw_40MHz) ? ((short_GI)?900:810):((short_GI)?433:390);
> +		max_rate = (bw_40MHz) ? ((short_GI) ? 900:810) : ((short_GI) ? 433:390);
>  	else if (MCS_rate[0] & BIT(3))
> -		max_rate = (bw_40MHz) ? ((short_GI)?600:540):((short_GI)?289:260);
> +		max_rate = (bw_40MHz) ? ((short_GI) ? 600:540) : ((short_GI) ? 289:260);
>  	else if (MCS_rate[0] & BIT(2))
> -		max_rate = (bw_40MHz) ? ((short_GI)?450:405):((short_GI)?217:195);
> +		max_rate = (bw_40MHz) ? ((short_GI) ? 450:405) : ((short_GI) ? 217:195);
>  	else if (MCS_rate[0] & BIT(1))
> -		max_rate = (bw_40MHz) ? ((short_GI)?300:270):((short_GI)?144:130);
> +		max_rate = (bw_40MHz) ? ((short_GI) ? 300:270) : ((short_GI) ? 144:130);
>  	else if (MCS_rate[0] & BIT(0))
> -		max_rate = (bw_40MHz) ? ((short_GI)?150:135):((short_GI)?72:65);
> +		max_rate = (bw_40MHz) ? ((short_GI) ? 150:135) : ((short_GI) ? 72:65);
>  
>  	return max_rate;
>  }

Ditto.

Next time before sending patches off, use:

$ ./scripts/checkpatch.pl --strict <patch>

All the problems I cited here could be found with that.

Thanks,

ET

  reply	other threads:[~2026-02-18 18:35 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-18 11:30 [PATCH] staging: rtl8723bs: fix spaces around binary operators Nikolay Kulikov
2026-02-18 18:34 ` Ethan Tidmore [this message]
2026-02-19  9:17   ` Nikolay Kulikov
2026-02-20 18:21     ` Ethan Tidmore
2026-02-21 11:02       ` Nikolay Kulikov
2026-02-19 17:14 ` [PATCH v2] " Nikolay Kulikov
2026-02-21 17:24 ` [PATCH v3] " Nikolay Kulikov
2026-02-21 18:57   ` Ethan Tidmore

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=DGIAYPXFFQ1Q.1J195CKVQVKWI@gmail.com \
    --to=ethantidmore06@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-staging@lists.linux.dev \
    --cc=nikolayof23@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