Skip to contentSkip to conversation

staging: rtl8723bs: modify struct field to use standard bool type

PATCH Superseded Abraham Samuel Adekunle 2 participants 3 messages Apr 4, 2025 Staging

v4 of 5 Superseded Latest is v5 →

lore
Share & tools
lore
#0 lore raw

PATCH v4 1/1 staging: rtl8723bs: modify struct field to use standard bool type

The struct sta_info field ieee8021x_blocked uses the uint values 0 and 1 to represent false and true values respectively.

Convert cases to use the bool type instead to ensure consistency with other parts of the containing code where true or false have been used.

This change causes the struct field to change size from a 32bit to an 8bit. However, the change is safe to make because the sta_info struct is not read from the hardware.

reported by Coccinelle:

---
Changes in v4:
- Added information about changing size of struct field in commit message and why it is safe to do so as suggested by Julia Lawall
Changes in v3:
- Added more patch recipients
Changes in v2:
- Improved commit message based on suggestion from Julia Lawall
- Clarity was provided to Greg kroah-Hartman by Dan Carpenter on why it is safe to make the change to the struct field.

 drivers/staging/rtl8723bs/core/rtw_ap.c      | 2 +-
 drivers/staging/rtl8723bs/include/sta_info.h | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
drivers/staging/rtl8723bs/core/rtw_ap.c +1 -1
index ed6942e289a5..82f54f769ed1 100644
@@ -389,7 +389,7 @@ void update_bmc_sta(struct adapter *padapter)
 		psta->qos_option = 0;
 		psta->htpriv.ht_option = false;
 
-		psta->ieee8021x_blocked = 0;
+		psta->ieee8021x_blocked = false;
 
 		memset((void *)&psta->sta_stats, 0, sizeof(struct stainfo_stats));
 
drivers/staging/rtl8723bs/include/sta_info.h +1 -1
index b3535fed3de7..63343998266a 100644
@@ -86,7 +86,7 @@ struct sta_info {
 	uint qos_option;
 	u8 hwaddr[ETH_ALEN];
 
-	uint	ieee8021x_blocked;	/* 0: allowed, 1:blocked */
+	bool ieee8021x_blocked;
 	uint	dot118021XPrivacy; /* aes, tkip... */
 	union Keytype	dot11tkiptxmickey;
 	union Keytype	dot11tkiprxmickey;
Signature · 1 line
2.34.1
maintainer
#1 lore raw
Quoted 2 lines · Abraham Samuel Adekunle

The struct sta_info field ieee8021x_blocked uses the uint values 0 and 1 to represent false and true values respectively.

Nit, you don't say "PATCH" in the subject line, why not?

Quoted 10 lines

Convert cases to use the bool type instead to ensure consistency with other parts of the containing code where true or false have been used.

This change causes the struct field to change size from a 32bit to an 8bit. However, the change is safe to make because the sta_info struct is not read from the hardware.

reported by Coccinelle:

Shouldn't something come after a ":"?

thanks,

greg k-h

#2 lore raw
Quoted 6 lines · Greg KH
Quoted 2 lines · Abraham Samuel Adekunle

The struct sta_info field ieee8021x_blocked uses the uint values 0 and 1 to represent false and true values respectively.

Nit, you don't say "PATCH" in the subject line, why not?

Argh, Sorry

Quoted 6 lines
Quoted 6 lines

Convert cases to use the bool type instead to ensure consistency with other parts of the containing code where true or false have been used.

Quoted 7 lines
Quoted 5 lines

This change causes the struct field to change size from a 32bit to an 8bit. However, the change is safe to make because the sta_info struct is not read from the hardware.

reported by Coccinelle:

Shouldn't something come after a ":"?

I meant a "."
I will correct and resend it. Thank you

Adekunle