staging: rtl8723bs: constify _action_public_str in rtw_ieee80211.c
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
@@ -1139,7 +1139,7 @@ int rtw_action_frame_parse(const u8 *frame, u32 frame_len, u8 *category, u8 *actreturn 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
Quoted 6 lines · Haroen Tmimi
Make the
_action_public_strarray "static const char * const".This ensures the array entries are read-only, preventing accidental modification of the pointers.
Signed-off-by Haroen Tmimi <[email protected]>
Looks good to me.
ET
Greg KH
maintainerQuoted 27 lines · Haroen Tmimi
Make the
_action_public_strarray "static const char * const".This ensures the array entries are read-only, preventing accidental modification of the pointers.
Signed-off-by Haroen Tmimi <[email protected]>--- drivers/staging/rtl8723bs/core/rtw_ieee80211.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/staging/rtl8723bs/core/rtw_ieee80211.c +1
-1@@ -1139,7 +1139,7 @@ int rtw_action_frame_parse(const u8 *frame, u32 frame_len, u8 *category, u8 *actreturn 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
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_strarray "static const char * const".This ensures the array entries are read-only, preventing accidental modification of the pointers.
Signed-off-by Haroen Tmimi <[email protected]>--- drivers/staging/rtl8723bs/core/rtw_ieee80211.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/staging/rtl8723bs/core/rtw_ieee80211.c +1
-2@@ -1139,7 +1139,7 @@ int rtw_action_frame_parse(const u8 *frame, u32 frame_len, u8 *category, u8 *actreturn 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