Skip to contentSkip to conversation

Staging: rtl8192e: Avoid using bool structure members

PATCH Superseded Bhanusree Pola 2 participants 2 messages Feb 20, 2019 Staging

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 2/2 Staging: rtl8192e: Avoid using bool structure members

Use 'u8' with bitfield instead of 'bool' to avoid alignment issues and remove checkpatch.pl check:
CHECK: Avoid using bool structure members because of possible alignment issues

---
 drivers/staging/rtl8192e/dot11d.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/rtl8192e/dot11d.h +1 -1
index 44f11f629922..f3e8373b1312 100644
@@ -29,7 +29,7 @@ enum dot11d_state {
  */
 
 struct rt_dot11d_info {
-	bool enabled;
+	u8 enabled:1;
 
 	u16 country_len;
 	u8  country_buffer[MAX_IE_LEN];
Signature · 1 line
2.17.1
#1 lore raw
Quoted 15 lines · Bhanusree Pola

Use 'u8' with bitfield instead of 'bool' to avoid alignment issues and remove checkpatch.pl check:
CHECK: Avoid using bool structure members because of possible alignment issues

---
 drivers/staging/rtl8192e/dot11d.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/rtl8192e/dot11d.h +0 -0
index 44f11f629922..f3e8373b1312 100644

drivers/staging/rtl8192e/dot11d.h enum dot11d_state { · line 32

Quoted 5 lines
drivers/staging/rtl8192e/dot11d.h +1 -1
@@ -29,7 +29,7 @@ enum dot11d_state {
  */
 
 struct rt_dot11d_info {
-	bool enabled;
+	u8 enabled:1;

Ick, no, that might just have caused a lot more work to have happen to access that variable (think about how a bool is stored and accessed vs. a bitfield).

There's nothing wrong with this bool as-is, I would leave it alone.

thanks,

greg k-h