linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH -next] ath11k: add dependency for struct ath11k member debug
@ 2019-12-13  1:24 Mao Wenan
  2019-12-19 13:38 ` Kalle Valo
  2020-01-15  9:18 ` Kalle Valo
  0 siblings, 2 replies; 3+ messages in thread
From: Mao Wenan @ 2019-12-13  1:24 UTC (permalink / raw)
  To: kvalo, davem, msinada, periyasa, mpubbise, julia.lawall, milehu
  Cc: ath11k, linux-wireless, netdev, linux-kernel, kernel-janitors

If CONFIG_ATH11K, CONFIG_MAC80211_DEBUGFS are set,
and CONFIG_ATH11K_DEBUGFS is not set, below error can be found,
drivers/net/wireless/ath/ath11k/debugfs_sta.c: In function ath11k_dbg_sta_open_htt_peer_stats:
drivers/net/wireless/ath/ath11k/debugfs_sta.c:411:4: error: struct ath11k has no member named debug
  ar->debug.htt_stats.stats_req = stats_req;

It is to add the dependency for the member of struct ath11k.

Fixes: d5c65159f289 ("ath11k: driver for Qualcomm IEEE 802.11ax devices")
Signed-off-by: Mao Wenan <maowenan@huawei.com>
---
 drivers/net/wireless/ath/ath11k/debugfs_sta.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/net/wireless/ath/ath11k/debugfs_sta.c b/drivers/net/wireless/ath/ath11k/debugfs_sta.c
index 3c5f931..bcc51d7 100644
--- a/drivers/net/wireless/ath/ath11k/debugfs_sta.c
+++ b/drivers/net/wireless/ath/ath11k/debugfs_sta.c
@@ -408,7 +408,9 @@ ath11k_dbg_sta_open_htt_peer_stats(struct inode *inode, struct file *file)
 		return -ENOMEM;
 
 	mutex_lock(&ar->conf_mutex);
+#ifdef CONFIG_ATH11K_DEBUGFS
 	ar->debug.htt_stats.stats_req = stats_req;
+#endif
 	stats_req->type = ATH11K_DBG_HTT_EXT_STATS_PEER_INFO;
 	memcpy(stats_req->peer_addr, sta->addr, ETH_ALEN);
 	ret = ath11k_dbg_htt_stats_req(ar);
-- 
2.7.4


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

* Re: [PATCH -next] ath11k: add dependency for struct ath11k member debug
  2019-12-13  1:24 [PATCH -next] ath11k: add dependency for struct ath11k member debug Mao Wenan
@ 2019-12-19 13:38 ` Kalle Valo
  2020-01-15  9:18 ` Kalle Valo
  1 sibling, 0 replies; 3+ messages in thread
From: Kalle Valo @ 2019-12-19 13:38 UTC (permalink / raw)
  To: Mao Wenan
  Cc: davem, msinada, periyasa, mpubbise, julia.lawall, milehu, netdev,
	kernel-janitors, linux-wireless, ath11k, linux-kernel

Mao Wenan <maowenan@huawei.com> writes:

> If CONFIG_ATH11K, CONFIG_MAC80211_DEBUGFS are set,
> and CONFIG_ATH11K_DEBUGFS is not set, below error can be found,
> drivers/net/wireless/ath/ath11k/debugfs_sta.c: In function ath11k_dbg_sta_open_htt_peer_stats:
> drivers/net/wireless/ath/ath11k/debugfs_sta.c:411:4: error: struct ath11k has no member named debug
>   ar->debug.htt_stats.stats_req = stats_req;
>
> It is to add the dependency for the member of struct ath11k.
>
> Fixes: d5c65159f289 ("ath11k: driver for Qualcomm IEEE 802.11ax devices")
> Signed-off-by: Mao Wenan <maowenan@huawei.com>
> ---
>  drivers/net/wireless/ath/ath11k/debugfs_sta.c | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/drivers/net/wireless/ath/ath11k/debugfs_sta.c b/drivers/net/wireless/ath/ath11k/debugfs_sta.c
> index 3c5f931..bcc51d7 100644
> --- a/drivers/net/wireless/ath/ath11k/debugfs_sta.c
> +++ b/drivers/net/wireless/ath/ath11k/debugfs_sta.c
> @@ -408,7 +408,9 @@ ath11k_dbg_sta_open_htt_peer_stats(struct inode *inode, struct file *file)
>  		return -ENOMEM;
>  
>  	mutex_lock(&ar->conf_mutex);
> +#ifdef CONFIG_ATH11K_DEBUGFS
>  	ar->debug.htt_stats.stats_req = stats_req;
> +#endif

ifdefs are ugly and I don't think this is the root cause for the
problem. I suspect (but not sure!) that ATH11K_DEBUGFS should depend on
MAC80211_DEBUGFS, not DEBUG_FS like it does now. Or would there be a
valid reason to have ATH11K_DEBUGFS enabled but not MAC80211_DEBUGFS?

Then we could also change Makefile to this:

ath11k-$(CONFIG_ATH11K_DEBUGFS) += debugfs_sta.o

And hopefully get rid of an ifdef:

drivers/net/wireless/ath/ath11k/debug.h:#ifdef CONFIG_MAC80211_DEBUGFS
drivers/net/wireless/ath/ath11k/debug.h:#else /* !CONFIG_MAC80211_DEBUGFS */
drivers/net/wireless/ath/ath11k/debug.h:#endif /* CONFIG_MAC80211_DEBUGFS*/

Care to try this out?

-- 
https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches

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

* Re: [PATCH -next] ath11k: add dependency for struct ath11k member debug
  2019-12-13  1:24 [PATCH -next] ath11k: add dependency for struct ath11k member debug Mao Wenan
  2019-12-19 13:38 ` Kalle Valo
@ 2020-01-15  9:18 ` Kalle Valo
  1 sibling, 0 replies; 3+ messages in thread
From: Kalle Valo @ 2020-01-15  9:18 UTC (permalink / raw)
  To: Mao Wenan
  Cc: davem, msinada, periyasa, mpubbise, julia.lawall, milehu, ath11k,
	linux-wireless, netdev, linux-kernel, kernel-janitors

Mao Wenan <maowenan@huawei.com> wrote:

> If CONFIG_ATH11K, CONFIG_MAC80211_DEBUGFS are set,
> and CONFIG_ATH11K_DEBUGFS is not set, below error can be found,
> drivers/net/wireless/ath/ath11k/debugfs_sta.c: In function ath11k_dbg_sta_open_htt_peer_stats:
> drivers/net/wireless/ath/ath11k/debugfs_sta.c:411:4: error: struct ath11k has no member named debug
>   ar->debug.htt_stats.stats_req = stats_req;
> 
> It is to add the dependency for the member of struct ath11k.
> 
> Fixes: d5c65159f289 ("ath11k: driver for Qualcomm IEEE 802.11ax devices")
> Signed-off-by: Mao Wenan <maowenan@huawei.com>

Arnd already did something what I proposed:
https://patchwork.kernel.org/patch/11321921/

Patch set to Superseded.

-- 
https://patchwork.kernel.org/patch/11289709/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches

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

end of thread, other threads:[~2020-01-15  9:18 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-12-13  1:24 [PATCH -next] ath11k: add dependency for struct ath11k member debug Mao Wenan
2019-12-19 13:38 ` Kalle Valo
2020-01-15  9:18 ` Kalle Valo

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).