All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] wlcore: fix unused function warning
@ 2017-12-11 11:46 Arnd Bergmann
  2017-12-14 12:45 ` Kalle Valo
  0 siblings, 1 reply; 2+ messages in thread
From: Arnd Bergmann @ 2017-12-11 11:46 UTC (permalink / raw)
  To: Kalle Valo
  Cc: Arnd Bergmann, Reizer, Eyal, Johannes Berg, Iain Hunter,
	Arend Van Spriel, Kees Cook, linux-wireless, netdev,
	linux-kernel

The newly added wlcore_fw_sleep function is called conditionally,
which causes a warning without CONFIG_PM:

drivers/net/wireless/ti/wlcore/main.c:981:12: error: 'wlcore_fw_sleep' defined but not used [-Werror=unused-function]

Instead of trying to keep track of what should be in the #ifdef and what
should not, it's easier to mark the top-level suspend/resume functions
as __maybe_unused so the compiler can silently drop all the unused code.

Fixes: 37bf241b8e7b ("wlcore: allow elp during wowlan suspend")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 drivers/net/wireless/ti/wlcore/acx.h  | 2 --
 drivers/net/wireless/ti/wlcore/main.c | 8 +++-----
 2 files changed, 3 insertions(+), 7 deletions(-)

diff --git a/drivers/net/wireless/ti/wlcore/acx.h b/drivers/net/wireless/ti/wlcore/acx.h
index f46d7fdf9a00..7011c5d9599f 100644
--- a/drivers/net/wireless/ti/wlcore/acx.h
+++ b/drivers/net/wireless/ti/wlcore/acx.h
@@ -1129,10 +1129,8 @@ int wl12xx_acx_config_hangover(struct wl1271 *wl);
 int wlcore_acx_average_rssi(struct wl1271 *wl, struct wl12xx_vif *wlvif,
 			    s8 *avg_rssi);
 
-#ifdef CONFIG_PM
 int wl1271_acx_default_rx_filter_enable(struct wl1271 *wl, bool enable,
 					enum rx_filter_action action);
 int wl1271_acx_set_rx_filter(struct wl1271 *wl, u8 index, bool enable,
 			     struct wl12xx_rx_filter *filter);
-#endif /* CONFIG_PM */
 #endif /* __WL1271_ACX_H__ */
diff --git a/drivers/net/wireless/ti/wlcore/main.c b/drivers/net/wireless/ti/wlcore/main.c
index 6ce457022dc9..09714034dbf1 100644
--- a/drivers/net/wireless/ti/wlcore/main.c
+++ b/drivers/net/wireless/ti/wlcore/main.c
@@ -1343,7 +1343,6 @@ static struct sk_buff *wl12xx_alloc_dummy_packet(struct wl1271 *wl)
 }
 
 
-#ifdef CONFIG_PM
 static int
 wl1271_validate_wowlan_pattern(struct cfg80211_pkt_pattern *p)
 {
@@ -1715,8 +1714,8 @@ static void wl1271_configure_resume(struct wl1271 *wl, struct wl12xx_vif *wlvif)
 	}
 }
 
-static int wl1271_op_suspend(struct ieee80211_hw *hw,
-			    struct cfg80211_wowlan *wow)
+static int __maybe_unused wl1271_op_suspend(struct ieee80211_hw *hw,
+					    struct cfg80211_wowlan *wow)
 {
 	struct wl1271 *wl = hw->priv;
 	struct wl12xx_vif *wlvif;
@@ -1810,7 +1809,7 @@ static int wl1271_op_suspend(struct ieee80211_hw *hw,
 	return 0;
 }
 
-static int wl1271_op_resume(struct ieee80211_hw *hw)
+static int __maybe_unused wl1271_op_resume(struct ieee80211_hw *hw)
 {
 	struct wl1271 *wl = hw->priv;
 	struct wl12xx_vif *wlvif;
@@ -1894,7 +1893,6 @@ static int wl1271_op_resume(struct ieee80211_hw *hw)
 
 	return 0;
 }
-#endif
 
 static int wl1271_op_start(struct ieee80211_hw *hw)
 {
-- 
2.9.0

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

* Re: wlcore: fix unused function warning
  2017-12-11 11:46 [PATCH] wlcore: fix unused function warning Arnd Bergmann
@ 2017-12-14 12:45 ` Kalle Valo
  0 siblings, 0 replies; 2+ messages in thread
From: Kalle Valo @ 2017-12-14 12:45 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Arnd Bergmann, Reizer, Eyal, Johannes Berg, Iain Hunter,
	Arend Van Spriel, Kees Cook, linux-wireless, netdev,
	linux-kernel

Arnd Bergmann <arnd@arndb.de> wrote:

> The newly added wlcore_fw_sleep function is called conditionally,
> which causes a warning without CONFIG_PM:
> 
> drivers/net/wireless/ti/wlcore/main.c:981:12: error: 'wlcore_fw_sleep' defined but not used [-Werror=unused-function]
> 
> Instead of trying to keep track of what should be in the #ifdef and what
> should not, it's easier to mark the top-level suspend/resume functions
> as __maybe_unused so the compiler can silently drop all the unused code.
> 
> Fixes: 37bf241b8e7b ("wlcore: allow elp during wowlan suspend")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>

Patch applied to wireless-drivers-next.git, thanks.

7de241f3b705 wlcore: fix unused function warning

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

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

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

end of thread, other threads:[~2017-12-14 12:45 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-12-11 11:46 [PATCH] wlcore: fix unused function warning Arnd Bergmann
2017-12-14 12:45 ` Kalle Valo

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.