Skip to contentSkip to conversation

staging: rtl8723bs: constify _action_public_str in rtw_ieee80211.c

PATCH In review Haroen Tmimi 3 participants 4 messages Feb 5 – Feb 7 Staging

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 staging: rtl8723bs: constify _action_public_str in rtw_ieee80211.c

Make the _action_public_str array "static const char * const".

This ensures the array entries are read-only, preventing accidental modification of the pointers.

---
 drivers/staging/rtl8723bs/core/rtw_ieee80211.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/rtl8723bs/core/rtw_ieee80211.c +1 -1
index 92b12a13d27c..febc14de6bc0 100644
@@ -1139,7 +1139,7 @@ int rtw_action_frame_parse(const u8 *frame, u32 frame_len, u8 *category, u8 *act
 	return true;
 }
 
-static const char *_action_public_str[] = {
+static const char * const _action_public_str[] = {
 	"ACT_PUB_BSSCOEXIST",
 	"ACT_PUB_DSE_ENABLE",
 	"ACT_PUB_DSE_DEENABLE",
Signature · 1 line
2.53.0
maintainer
#2 lore raw
In reply to Haroen Tmimi
Quoted 27 lines · Haroen Tmimi

Make the _action_public_str array "static const char * const".

This ensures the array entries are read-only, preventing accidental modification of the pointers.

---
 drivers/staging/rtl8723bs/core/rtw_ieee80211.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/rtl8723bs/core/rtw_ieee80211.c +1 -1
index 92b12a13d27c..febc14de6bc0 100644
@@ -1139,7 +1139,7 @@ int rtw_action_frame_parse(const u8 *frame, u32 frame_len, u8 *category, u8 *act
 	return true;
 }
 
-static const char *_action_public_str[] = {
+static const char * const _action_public_str[] = {
 	"ACT_PUB_BSSCOEXIST",
 	"ACT_PUB_DSE_ENABLE",
 	"ACT_PUB_DSE_DEENABLE",
Signature · 1 line
2.53.0

Someone already sent this same change before you did, sorry.

Why all of the same fixes for the same driver are happening at once? Did a class just happen that encouraged people to make these types of changes to the driver?

thanks,

greg k-h

#3 lore raw

Hi Greg,

Thanks for the update. To answer your question. No, this isn't an assignment. I am an Electrical Engineering student learning kernel development in my spare time. I picked this driver simply because it looked active in the staging mailing list and it was recommended on a YouTube video I had seen, which I guess explains why others are contributing as well.

I'll check the archives more carefully next time to avoid duplicates.

Best regards,
Haroen Tmimi

Op za 7 feb 2026 om 14:40 schreef Greg KH <[email protected]>:

Quoted 39 lines · Haroen Tmimi
Quoted 24 lines

Make the _action_public_str array "static const char * const".

This ensures the array entries are read-only, preventing accidental modification of the pointers.

---
 drivers/staging/rtl8723bs/core/rtw_ieee80211.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/rtl8723bs/core/rtw_ieee80211.c +1 -2
index 92b12a13d27c..febc14de6bc0 100644
@@ -1139,7 +1139,7 @@ int rtw_action_frame_parse(const u8 *frame, u32 frame_len, u8 *category, u8 *act
      return true;
 }
 
-static const char *_action_public_str[] = {
+static const char * const _action_public_str[] = {
      "ACT_PUB_BSSCOEXIST",
      "ACT_PUB_DSE_ENABLE",
      "ACT_PUB_DSE_DEENABLE",
--
Quoted 3 lines

2.53.0

Someone already sent this same change before you did, sorry.

Why all of the same fixes for the same driver are happening at once? Did a class just happen that encouraged people to make these types of changes to the driver?

thanks,

greg k-h