LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH] iwlwifi: mvm: fix usage of debug specific variables
@ 2015-03-04 17:59 Alban Gruin
  2015-03-04 18:25 ` Grumbach, Emmanuel
  0 siblings, 1 reply; 2+ messages in thread
From: Alban Gruin @ 2015-03-04 17:59 UTC (permalink / raw)
  To: linux-kernel; +Cc: linux-wireless, johannes.berg, emmanuel.grumbach

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(+)
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));
 }

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] iwlwifi: mvm: fix usage of debug specific variables
  2015-03-04 17:59 [PATCH] iwlwifi: mvm: fix usage of debug specific variables Alban Gruin
@ 2015-03-04 18:25 ` Grumbach, Emmanuel
  0 siblings, 0 replies; 2+ messages in thread
From: Grumbach, Emmanuel @ 2015-03-04 18:25 UTC (permalink / raw)
  To: alban.gruin; +Cc: linux-wireless, linux-kernel, Berg, Johannes

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="utf-8", Size: 3128 bytes --]

Hi,


On Wed, 2015-03-04 at 18:59 +0100, Alban Gruin wrote:
> 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.
> 


oh well... thanks for the heads up.
Your patch is not perfect, but I'll fix the problems in our internal
tree and the fix will be pushed out soon.

Thanks!

> 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(+)
> 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));
>  }

ÿôèº{.nÇ+‰·Ÿ®‰­†+%ŠËÿ±éݶ\x17¥Šwÿº{.nÇ+‰·¥Š{±þG«éÿŠ{ayº\x1dʇڙë,j\a­¢f£¢·hšïêÿ‘êçz_è®\x03(­éšŽŠÝ¢j"ú\x1a¶^[m§ÿÿ¾\a«þG«éÿ¢¸?™¨è­Ú&£ø§~á¶iO•æ¬z·švØ^\x14\x04\x1a¶^[m§ÿÿÃ\fÿ¶ìÿ¢¸?–I¥

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-03-04 18:25 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-03-04 17:59 [PATCH] iwlwifi: mvm: fix usage of debug specific variables Alban Gruin
2015-03-04 18:25 ` Grumbach, Emmanuel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).