Skip to contentSkip to conversation

wifi: iwlegacy: avoid size increase

PATCH In review Arnd Bergmann 2 participants 2 messages Mar 4, 2025 Intel wireless 3945ABG/bg, 4965AGN (iwlegacy)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 wifi: iwlegacy: avoid size increase

From: Arnd Bergmann <[email protected]>

My previous patch caused a slight code size increase when DEBUG_FS is disabled, as Stanislaw Gruszka pointed out.

Fix this with an added IS_ENABLED() check.

Fixes cf6b9ba172dd ("wifi: iwlegacy: don't warn for unused variables with DEBUG_FS=n")

---
Ideally this would be folded into my original fix. If that's not possible, please apply on top.

---
 drivers/net/wireless/intel/iwlegacy/4965-rs.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/net/wireless/intel/iwlegacy/4965-rs.c +3 -0
index f754fb979546..0e5130d1fccd 100644
@@ -2495,6 +2495,9 @@ il4965_rs_dbgfs_set_mcs(struct il_lq_sta *lq_sta, u32 * rate_n_flags, int idx)
 	u8 valid_tx_ant;
 	u8 ant_sel_tx;
 
+	if (!IS_ENABLED(CONFIG_MAC80211_DEBUGFS))
+		return;
+
 	il = lq_sta->drv;
 	valid_tx_ant = il->hw_params.valid_tx_ant;
 	if (lq_sta->dbg_fixed_rate) {
Signature · 1 line
2.39.5
maintainer Acked-by on v1 1/1
#1 lore raw
Quoted 5 lines · Arnd Bergmann

From: Arnd Bergmann <[email protected]>

My previous patch caused a slight code size increase when DEBUG_FS is disabled, as Stanislaw Gruszka pointed out.

Quoted 7 lines

Fix this with an added IS_ENABLED() check.

Fixes cf6b9ba172dd ("wifi: iwlegacy: don't warn for unused variables with DEBUG_FS=n")

---
Ideally this would be folded into my original fix. If that's not possible, please apply on top.

Quoted 20 lines
 drivers/net/wireless/intel/iwlegacy/4965-rs.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/net/wireless/intel/iwlegacy/4965-rs.c +3 -0
index f754fb979546..0e5130d1fccd 100644
@@ -2495,6 +2495,9 @@ il4965_rs_dbgfs_set_mcs(struct il_lq_sta *lq_sta, u32 * rate_n_flags, int idx)
 	u8 valid_tx_ant;
 	u8 ant_sel_tx;
 
+	if (!IS_ENABLED(CONFIG_MAC80211_DEBUGFS))
+		return;
+
 	il = lq_sta->drv;
 	valid_tx_ant = il->hw_params.valid_tx_ant;
 	if (lq_sta->dbg_fixed_rate) {
Signature · 1 line
2.39.5