[PATCH][next] wifi: rtlwifi: rtl8821ae: make the read-only array params static const

Colin Ian King posted 1 patch 4 months ago
drivers/net/wireless/realtek/rtlwifi/rtl8821ae/hw.c | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
[PATCH][next] wifi: rtlwifi: rtl8821ae: make the read-only array params static const
Posted by Colin Ian King 4 months ago
Don't populate the read-only array params on the stack at run time,
instead make it static const.

Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
---
 drivers/net/wireless/realtek/rtlwifi/rtl8821ae/hw.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/hw.c b/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/hw.c
index f4b232f038a9..14bd64ff3f88 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/hw.c
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/hw.c
@@ -3064,10 +3064,12 @@ static void _rtl8821ae_read_adapter_info(struct ieee80211_hw *hw, bool b_pseudo_
 	struct rtl_priv *rtlpriv = rtl_priv(hw);
 	struct rtl_efuse *rtlefuse = rtl_efuse(rtl_priv(hw));
 	struct rtl_hal *rtlhal = rtl_hal(rtl_priv(hw));
-	int params[] = {RTL_EEPROM_ID, EEPROM_VID, EEPROM_DID,
-			EEPROM_SVID, EEPROM_SMID, EEPROM_MAC_ADDR,
-			EEPROM_CHANNELPLAN, EEPROM_VERSION, EEPROM_CUSTOMER_ID,
-			COUNTRY_CODE_WORLD_WIDE_13};
+	static const int params[] = {
+		RTL_EEPROM_ID, EEPROM_VID, EEPROM_DID,
+		EEPROM_SVID, EEPROM_SMID, EEPROM_MAC_ADDR,
+		EEPROM_CHANNELPLAN, EEPROM_VERSION, EEPROM_CUSTOMER_ID,
+		COUNTRY_CODE_WORLD_WIDE_13
+	};
 	u8 *hwinfo;
 
 	if (b_pseudo_test) {
-- 
2.49.0
Re: [PATCH][next] wifi: rtlwifi: rtl8821ae: make the read-only array params static const
Posted by Ping-Ke Shih 3 months, 3 weeks ago
Colin Ian King <colin.i.king@gmail.com> wrote:

> Don't populate the read-only array params on the stack at run time,
> instead make it static const.
> 
> Signed-off-by: Colin Ian King <colin.i.king@gmail.com>

1 patch(es) applied to rtw-next branch of rtw.git, thanks.

9b550b98f0da wifi: rtlwifi: rtl8821ae: make the read-only array params static const

---
https://github.com/pkshih/rtw.git