From: Johannes Berg Date: Wed, 9 Apr 2014 19:31:13 +0000 (+0200) Subject: mac80211: mark local variable __maybe_unused X-Git-Tag: v3.16-rc1~27^2~50^2^2~46^2~39 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=33926eb7785ac7ce7d45d1ae5afb0780a4270342;p=uclinux-h8%2Flinux.git mac80211: mark local variable __maybe_unused The 'local' variable in __ieee80211_vif_copy_chanctx_to_vlans() is only used/needed when lockdep is compiled in, mark it as such to avoid compile warnings in the other case. While at it, fix some indentation where it's used. Reviewed-by: Luciano Coelho Reviewed-by: Emmanuel Grumbach Signed-off-by: Johannes Berg --- diff --git a/net/mac80211/chan.c b/net/mac80211/chan.c index d8b1b8614842..3702d642cd8f 100644 --- a/net/mac80211/chan.c +++ b/net/mac80211/chan.c @@ -848,7 +848,7 @@ static void __ieee80211_vif_copy_chanctx_to_vlans(struct ieee80211_sub_if_data *sdata, bool clear) { - struct ieee80211_local *local = sdata->local; + struct ieee80211_local *local __maybe_unused = sdata->local; struct ieee80211_sub_if_data *vlan; struct ieee80211_chanctx_conf *conf; @@ -864,7 +864,7 @@ __ieee80211_vif_copy_chanctx_to_vlans(struct ieee80211_sub_if_data *sdata, * to a channel context that has already been freed. */ conf = rcu_dereference_protected(sdata->vif.chanctx_conf, - lockdep_is_held(&local->chanctx_mtx)); + lockdep_is_held(&local->chanctx_mtx)); WARN_ON(!conf); if (clear)