[PATCH 01/28] wireless: intersil: hostap: Mark 'freq_list' as __maybe_unused

From: Lee Jones
Date: Wed Aug 19 2020 - 03:24:21 EST


'freq_list' is used in some source files which include hostap.h, but
not all. The compiler complains about the times it's not used. Mark
it as __maybe_used to tell the compiler that this is not only okay,
it's expected.

Fixes the following W=1 kernel build warning(s):

In file included from drivers/net/wireless/intersil/hostap/hostap_80211_tx.c:9:
drivers/net/wireless/intersil/hostap/hostap.h:11:19: warning: ‘freq_list’ defined but not used [-Wunused-const-variable=]
In file included from drivers/net/wireless/intersil/hostap/hostap_main.c:31:
drivers/net/wireless/intersil/hostap/hostap.h:11:19: warning: ‘freq_list’ defined but not used [-Wunused-const-variable=]
In file included from drivers/net/wireless/intersil/hostap/hostap_proc.c:10:
drivers/net/wireless/intersil/hostap/hostap.h:11:19: warning: ‘freq_list’ defined but not used [-Wunused-const-variable=]
In file included from drivers/net/wireless/intersil/hostap/hostap_hw.c:50,
from drivers/net/wireless/intersil/hostap/hostap_cs.c:196:
At top level:
drivers/net/wireless/intersil/hostap/hostap.h:11:19: warning: ‘freq_list’ defined but not used [-Wunused-const-variable=]
In file included from drivers/net/wireless/intersil/hostap/hostap_hw.c:50,
from drivers/net/wireless/intersil/hostap/hostap_pci.c:221:
At top level:
drivers/net/wireless/intersil/hostap/hostap.h:11:19: warning: ‘freq_list’ defined but not used [-Wunused-const-variable=]
In file included from drivers/net/wireless/intersil/hostap/hostap_hw.c:50,
from drivers/net/wireless/intersil/hostap/hostap_plx.c:264:
At top level:
drivers/net/wireless/intersil/hostap/hostap.h:11:19: warning: ‘freq_list’ defined but not used [-Wunused-const-variable=]

Cc: Jouni Malinen <j@xxxxx>
Cc: Kalle Valo <kvalo@xxxxxxxxxxxxxx>
Cc: "David S. Miller" <davem@xxxxxxxxxxxxx>
Cc: Jakub Kicinski <kuba@xxxxxxxxxx>
Cc: linux-wireless@xxxxxxxxxxxxxxx
Cc: netdev@xxxxxxxxxxxxxxx
Signed-off-by: Lee Jones <lee.jones@xxxxxxxxxx>
---
drivers/net/wireless/intersil/hostap/hostap.h | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/net/wireless/intersil/hostap/hostap.h b/drivers/net/wireless/intersil/hostap/hostap.h
index 8130d29c7989c..c4b81ff7d7e47 100644
--- a/drivers/net/wireless/intersil/hostap/hostap.h
+++ b/drivers/net/wireless/intersil/hostap/hostap.h
@@ -8,8 +8,10 @@
#include "hostap_wlan.h"
#include "hostap_ap.h"

-static const long freq_list[] = { 2412, 2417, 2422, 2427, 2432, 2437, 2442,
- 2447, 2452, 2457, 2462, 2467, 2472, 2484 };
+static const long __maybe_unused freq_list[] = {
+ 2412, 2417, 2422, 2427, 2432, 2437, 2442,
+ 2447, 2452, 2457, 2462, 2467, 2472, 2484
+};
#define FREQ_COUNT ARRAY_SIZE(freq_list)

/* hostap.c */
--
2.25.1