diff mbox

mac80211: avoid warning when CONFIG_LOCKDEP is not enabled

Message ID 1403793976-9542-1-git-send-email-luca@coelho.fi (mailing list archive)
State Not Applicable, archived
Headers show

Commit Message

Luca Coelho June 26, 2014, 2:46 p.m. UTC
From: Luciano Coelho <luciano.coelho@intel.com>

After commit 5bcae31d9 (mac80211: implement multi-vif in-place
reservations) we get a warning when CONFIG_LOCKDEP is not enabled:

net/mac80211/chan.c: In function 'ieee80211_vif_get_chanctx':
net/mac80211/chan.c:69:26: warning: unused variable 'local' [-Wunused-variable]
  struct ieee80211_local *local = sdata->local;
                          ^
Fix this by removing the separate declaration for local and accessing
it directly in the lockdep_is_held() call.

Signed-off-by: Luciano Coelho <luciano.coelho@intel.com>
---
 net/mac80211/chan.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

Comments

Johannes Berg July 21, 2014, 10:03 a.m. UTC | #1
On Thu, 2014-06-26 at 17:46 +0300, Luca Coelho wrote:
> From: Luciano Coelho <luciano.coelho@intel.com>
> 
> After commit 5bcae31d9 (mac80211: implement multi-vif in-place
> reservations) we get a warning when CONFIG_LOCKDEP is not enabled:
> 
> net/mac80211/chan.c: In function 'ieee80211_vif_get_chanctx':
> net/mac80211/chan.c:69:26: warning: unused variable 'local' [-Wunused-variable]
>   struct ieee80211_local *local = sdata->local;
>                           ^
> Fix this by removing the separate declaration for local and accessing
> it directly in the lockdep_is_held() call.

Huh, sorry, I just fixed this the other day by adding __maybe_unused.

johannes

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/net/mac80211/chan.c b/net/mac80211/chan.c
index c3fd4d2..0cdac4b 100644
--- a/net/mac80211/chan.c
+++ b/net/mac80211/chan.c
@@ -66,11 +66,10 @@  static bool ieee80211_can_create_new_chanctx(struct ieee80211_local *local)
 static struct ieee80211_chanctx *
 ieee80211_vif_get_chanctx(struct ieee80211_sub_if_data *sdata)
 {
-	struct ieee80211_local *local = sdata->local;
 	struct ieee80211_chanctx_conf *conf;
 
 	conf = rcu_dereference_protected(sdata->vif.chanctx_conf,
-					 lockdep_is_held(&local->chanctx_mtx));
+				 lockdep_is_held(&sdata->local->chanctx_mtx));
 	if (!conf)
 		return NULL;