public inbox for linux-staging@lists.linux.dev
 help / color / mirror / Atom feed
* [PATCH] staging: rtl8723bs: fix comparison order in rtw_ieee80211.c
@ 2026-01-11  9:00 Anubhav Kokane
  2026-01-11 13:00 ` Greg KH
  0 siblings, 1 reply; 2+ messages in thread
From: Anubhav Kokane @ 2026-01-11  9:00 UTC (permalink / raw)
  To: gregkh; +Cc: linux-staging, linux-kernel, Anubhav Kokane

Fix checkpatch warning: "Comparisons should place the constant on the
right side of the test".

Move the constant _SUCCESS to the right side of the comparison
operator.

Also fix whitespace around binary operator '+' and wrap lines to fit
coding style limits.

Signed-off-by: Anubhav Kokane <dev.anubhavk@gmail.com>
---
 drivers/staging/rtl8723bs/core/rtw_ieee80211.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/rtl8723bs/core/rtw_ieee80211.c b/drivers/staging/rtl8723bs/core/rtw_ieee80211.c
index 8fdeeda88..f45ae5d5f 100644
--- a/drivers/staging/rtl8723bs/core/rtw_ieee80211.c
+++ b/drivers/staging/rtl8723bs/core/rtw_ieee80211.c
@@ -1009,7 +1009,8 @@ static int rtw_get_cipher_info(struct wlan_network *pnetwork)
 	pbuf = rtw_get_wpa_ie(&pnetwork->network.ies[12], &wpa_ielen, pnetwork->network.ie_length-12);
 
 	if (pbuf && (wpa_ielen > 0)) {
-		if (_SUCCESS == rtw_parse_wpa_ie(pbuf, wpa_ielen+2, &group_cipher, &pairwise_cipher, &is8021x)) {
+		if (rtw_parse_wpa_ie(pbuf, wpa_ielen + 2, &group_cipher,
+				     &pairwise_cipher, &is8021x) == _SUCCESS) {
 			pnetwork->bcn_info.pairwise_cipher = pairwise_cipher;
 			pnetwork->bcn_info.group_cipher = group_cipher;
 			pnetwork->bcn_info.is_8021x = is8021x;
@@ -1019,7 +1020,8 @@ static int rtw_get_cipher_info(struct wlan_network *pnetwork)
 		pbuf = rtw_get_wpa2_ie(&pnetwork->network.ies[12], &wpa_ielen, pnetwork->network.ie_length-12);
 
 		if (pbuf && (wpa_ielen > 0)) {
-			if (_SUCCESS == rtw_parse_wpa2_ie(pbuf, wpa_ielen+2, &group_cipher, &pairwise_cipher, &is8021x)) {
+			if (rtw_parse_wpa2_ie(pbuf, wpa_ielen + 2, &group_cipher,
+					      &pairwise_cipher, &is8021x) == _SUCCESS) {
 				pnetwork->bcn_info.pairwise_cipher = pairwise_cipher;
 				pnetwork->bcn_info.group_cipher = group_cipher;
 				pnetwork->bcn_info.is_8021x = is8021x;
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] staging: rtl8723bs: fix comparison order in rtw_ieee80211.c
  2026-01-11  9:00 [PATCH] staging: rtl8723bs: fix comparison order in rtw_ieee80211.c Anubhav Kokane
@ 2026-01-11 13:00 ` Greg KH
  0 siblings, 0 replies; 2+ messages in thread
From: Greg KH @ 2026-01-11 13:00 UTC (permalink / raw)
  To: Anubhav Kokane; +Cc: linux-staging, linux-kernel

On Sun, Jan 11, 2026 at 09:00:34AM +0000, Anubhav Kokane wrote:
> Fix checkpatch warning: "Comparisons should place the constant on the
> right side of the test".
> 
> Move the constant _SUCCESS to the right side of the comparison
> operator.
> 
> Also fix whitespace around binary operator '+' and wrap lines to fit
> coding style limits.
> 
> Signed-off-by: Anubhav Kokane <dev.anubhavk@gmail.com>
> ---
>  drivers/staging/rtl8723bs/core/rtw_ieee80211.c | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/staging/rtl8723bs/core/rtw_ieee80211.c b/drivers/staging/rtl8723bs/core/rtw_ieee80211.c
> index 8fdeeda88..f45ae5d5f 100644
> --- a/drivers/staging/rtl8723bs/core/rtw_ieee80211.c
> +++ b/drivers/staging/rtl8723bs/core/rtw_ieee80211.c
> @@ -1009,7 +1009,8 @@ static int rtw_get_cipher_info(struct wlan_network *pnetwork)
>  	pbuf = rtw_get_wpa_ie(&pnetwork->network.ies[12], &wpa_ielen, pnetwork->network.ie_length-12);
>  
>  	if (pbuf && (wpa_ielen > 0)) {
> -		if (_SUCCESS == rtw_parse_wpa_ie(pbuf, wpa_ielen+2, &group_cipher, &pairwise_cipher, &is8021x)) {
> +		if (rtw_parse_wpa_ie(pbuf, wpa_ielen + 2, &group_cipher,
> +				     &pairwise_cipher, &is8021x) == _SUCCESS) {
>  			pnetwork->bcn_info.pairwise_cipher = pairwise_cipher;
>  			pnetwork->bcn_info.group_cipher = group_cipher;
>  			pnetwork->bcn_info.is_8021x = is8021x;
> @@ -1019,7 +1020,8 @@ static int rtw_get_cipher_info(struct wlan_network *pnetwork)
>  		pbuf = rtw_get_wpa2_ie(&pnetwork->network.ies[12], &wpa_ielen, pnetwork->network.ie_length-12);
>  
>  		if (pbuf && (wpa_ielen > 0)) {
> -			if (_SUCCESS == rtw_parse_wpa2_ie(pbuf, wpa_ielen+2, &group_cipher, &pairwise_cipher, &is8021x)) {
> +			if (rtw_parse_wpa2_ie(pbuf, wpa_ielen + 2, &group_cipher,
> +					      &pairwise_cipher, &is8021x) == _SUCCESS) {
>  				pnetwork->bcn_info.pairwise_cipher = pairwise_cipher;
>  				pnetwork->bcn_info.group_cipher = group_cipher;
>  				pnetwork->bcn_info.is_8021x = is8021x;
> -- 
> 2.43.0
> 
> 

Does not apply to my tree anymore, due to someone else sending this
same change right before you did, sorry.

greg k-h

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-01-11 13:00 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-01-11  9:00 [PATCH] staging: rtl8723bs: fix comparison order in rtw_ieee80211.c Anubhav Kokane
2026-01-11 13:00 ` Greg KH

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox