Skip to contentSkip to conversation

staging: rtl8723bs: make read-only array dot11_rate_table static const

PATCH New Colin Ian King 1 participant 1 message Aug 22, 2024

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 staging: rtl8723bs: make read-only array dot11_rate_table static const

Don't populate the read-only array dot11_rate_table on the stack at run time, instead make it static const.

---
 drivers/staging/rtl8723bs/core/rtw_ieee80211.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/staging/rtl8723bs/core/rtw_ieee80211.c +3 -1
index b89e88d6a82d..0cc5142a90e0 100644
@@ -55,7 +55,9 @@ static u8 WIFI_OFDMRATES[] = {
 
 int rtw_get_bit_value_from_ieee_value(u8 val)
 {
-	unsigned char dot11_rate_table[] = {2, 4, 11, 22, 12, 18, 24, 36, 48, 72, 96, 108, 0}; /*  last element must be zero!! */
+	static const unsigned char dot11_rate_table[] = {
+		2, 4, 11, 22, 12, 18, 24, 36, 48, 72, 96, 108, 0
+	}; /*  last element must be zero!! */
 	int i = 0;
 
 	while (dot11_rate_table[i] != 0) {
Signature · 1 line
2.39.2