diff mbox

iwlwifi: mvm: fix usage of debug specific variables

Message ID 871tl4ej9w.fsf@ylate.i-did-not-set--mail-host-address--so-tickle-me (mailing list archive)
State Changes Requested
Headers show

Commit Message

Alban Gruin March 4, 2015, 5:59 p.m. UTC
Some variables in structs "iwl_mvm" and "iwl_mvm_vif" are used for debug
purpose, and are declared only if CONFIG_IWLWIFI_DEBUGFS is
set. However, some of these variables are used even if
CONFIG_IWLWIFI_DEBUGFS is not set, resulting in a compilation error.
This patch aims to fix this issue by adding a preprocessor condition
where these variables are used.

Signed-off-by: Alban Gruin <alban.gruin@gmail.com>
---
 drivers/net/wireless/iwlwifi/mvm/mac-ctxt.c | 4 ++++
 drivers/net/wireless/iwlwifi/mvm/phy-ctxt.c | 3 +++
 2 files changed, 7 insertions(+)
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Comments

Emmanuel Grumbach March 4, 2015, 6:25 p.m. UTC | #1
SGksDQoNCg0KT24gV2VkLCAyMDE1LTAzLTA0IGF0IDE4OjU5ICswMTAwLCBBbGJhbiBHcnVpbiB3
cm90ZToNCj4gU29tZSB2YXJpYWJsZXMgaW4gc3RydWN0cyAiaXdsX212bSIgYW5kICJpd2xfbXZt
X3ZpZiIgYXJlIHVzZWQgZm9yIGRlYnVnDQo+IHB1cnBvc2UsIGFuZCBhcmUgZGVjbGFyZWQgb25s
eSBpZiBDT05GSUdfSVdMV0lGSV9ERUJVR0ZTIGlzDQo+IHNldC4gSG93ZXZlciwgc29tZSBvZiB0
aGVzZSB2YXJpYWJsZXMgYXJlIHVzZWQgZXZlbiBpZg0KPiBDT05GSUdfSVdMV0lGSV9ERUJVR0ZT
IGlzIG5vdCBzZXQsIHJlc3VsdGluZyBpbiBhIGNvbXBpbGF0aW9uIGVycm9yLg0KPiBUaGlzIHBh
dGNoIGFpbXMgdG8gZml4IHRoaXMgaXNzdWUgYnkgYWRkaW5nIGEgcH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tPnJ4Y2hhaW5faW5m
byB8PSBjcHVfdG9fbGUzMihhY3RpdmVfY250IDw8DQo+ICAJCQkJCSBQSFlfUlhfQ0hBSU5fTUlN
T19DTlRfUE9TKTsNCj4gKw0KPiArI2lmZGVmIENPTkZJR19JV0xXSUZJX0RFQlVHRlMNCj4gIAlp
ZiAodW5saWtlbHkobXZtLT5kYmdmc19yeF9waHlpbmZvKSkNCj4gIAkJY21kLT5yeGNoYWluX2lu
Zm8gPSBjcHVfdG9fbGUzMihtdm0tPmRiZ2ZzX3J4X3BoeWluZm8pOw0KPiArI2VuZGlmDQo+ICAN
Cj4gIAljbWQtPnR4Y2hhaW5faW5mbyA9IGNwdV90b19sZTMyKGl3bF9tdm1fZ2V0X3ZhbGlkX3R4
X2FudChtdm0pKTsNCj4gIH0NCg0K
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/net/wireless/iwlwifi/mvm/mac-ctxt.c b/drivers/net/wireless/iwlwifi/mvm/mac-ctxt.c
index 581b3b8..42bd545 100644
--- a/drivers/net/wireless/iwlwifi/mvm/mac-ctxt.c
+++ b/drivers/net/wireless/iwlwifi/mvm/mac-ctxt.c
@@ -1375,10 +1375,12 @@  static void iwl_mvm_beacon_loss_iterator(void *_data, u8 *mac,
 {
 	struct iwl_missed_beacons_notif *missed_beacons = _data;
 	struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif);
+#ifdef CONFIG_IWLWIFI_DEBUGFS
 	struct iwl_mvm *mvm = mvmvif->mvm;
 	struct iwl_fw_dbg_trigger_missed_bcon *bcon_trig;
 	struct iwl_fw_dbg_trigger_tlv *trigger;
 	u32 stop_trig_missed_bcon, stop_trig_missed_bcon_since_rx;
+#endif
 	u32 rx_missed_bcon, rx_missed_bcon_since_rx;
 
 	if (mvmvif->id != (u16)le32_to_cpu(missed_beacons->mac_id))
@@ -1395,6 +1397,7 @@  static void iwl_mvm_beacon_loss_iterator(void *_data, u8 *mac,
 	     IWL_MVM_MISSED_BEACONS_THRESHOLD)
 		ieee80211_beacon_loss(vif);
 
+#ifdef CONFIG_IWLWIFI_DEBUGFS
 	if (!iwl_fw_dbg_trigger_enabled(mvm->fw,
 					FW_DBG_TRIGGER_MISSED_BEACONS))
 		return;
@@ -1414,6 +1417,7 @@  static void iwl_mvm_beacon_loss_iterator(void *_data, u8 *mac,
 	if (rx_missed_bcon_since_rx >= stop_trig_missed_bcon_since_rx ||
 	    rx_missed_bcon >= stop_trig_missed_bcon)
 		iwl_mvm_fw_dbg_collect_trig(mvm, trigger, NULL, 0);
+#endif
 }
 
 int iwl_mvm_rx_missed_beacons_notif(struct iwl_mvm *mvm,
diff --git a/drivers/net/wireless/iwlwifi/mvm/phy-ctxt.c b/drivers/net/wireless/iwlwifi/mvm/phy-ctxt.c
index 1bd10ed..850c72c 100644
--- a/drivers/net/wireless/iwlwifi/mvm/phy-ctxt.c
+++ b/drivers/net/wireless/iwlwifi/mvm/phy-ctxt.c
@@ -175,8 +175,11 @@  static void iwl_mvm_phy_ctxt_cmd_data(struct iwl_mvm *mvm,
 	cmd->rxchain_info |= cpu_to_le32(idle_cnt << PHY_RX_CHAIN_CNT_POS);
 	cmd->rxchain_info |= cpu_to_le32(active_cnt <<
 					 PHY_RX_CHAIN_MIMO_CNT_POS);
+
+#ifdef CONFIG_IWLWIFI_DEBUGFS
 	if (unlikely(mvm->dbgfs_rx_phyinfo))
 		cmd->rxchain_info = cpu_to_le32(mvm->dbgfs_rx_phyinfo);
+#endif
 
 	cmd->txchain_info = cpu_to_le32(iwl_mvm_get_valid_tx_ant(mvm));
 }