linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] fix shadow warnings
@ 2012-01-20 12:52 Johannes Berg
  2012-01-20 12:52 ` [PATCH 1/2] mac80211: fix a few -Wshadow warnings Johannes Berg
  2012-01-20 12:52 ` [PATCH 2/2] cfg80211: " Johannes Berg
  0 siblings, 2 replies; 3+ messages in thread
From: Johannes Berg @ 2012-01-20 12:52 UTC (permalink / raw)
  To: John Linville; +Cc: linux-wireless

Since the variables are useless ... it looks
like -Wshadow is no longer default though.

johannes

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

* [PATCH 1/2] mac80211: fix a few -Wshadow warnings
  2012-01-20 12:52 [PATCH 0/2] fix shadow warnings Johannes Berg
@ 2012-01-20 12:52 ` Johannes Berg
  2012-01-20 12:52 ` [PATCH 2/2] cfg80211: " Johannes Berg
  1 sibling, 0 replies; 3+ messages in thread
From: Johannes Berg @ 2012-01-20 12:52 UTC (permalink / raw)
  To: John Linville; +Cc: linux-wireless

From: Johannes Berg <johannes.berg@intel.com>

It seems that -Wshadow is no longer default in
sparse runs, but let's fix the warnings anyway.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
---
 net/mac80211/rx.c     |    3 ---
 net/mac80211/status.c |    6 +++---
 2 files changed, 3 insertions(+), 6 deletions(-)

--- a/net/mac80211/rx.c	2012-01-20 13:50:03.000000000 +0100
+++ b/net/mac80211/rx.c	2012-01-20 13:50:10.000000000 +0100
@@ -2180,9 +2180,6 @@ ieee80211_rx_h_mgmt_check(struct ieee802
 	if (rx->sdata->vif.type == NL80211_IFTYPE_AP &&
 	    ieee80211_is_beacon(mgmt->frame_control) &&
 	    !(rx->flags & IEEE80211_RX_BEACON_REPORTED)) {
-		struct ieee80211_rx_status *status;
-
-		status = IEEE80211_SKB_RXCB(rx->skb);
 		cfg80211_report_obss_beacon(rx->local->hw.wiphy,
 					    rx->skb->data, rx->skb->len,
 					    status->freq, GFP_ATOMIC);
--- a/net/mac80211/status.c	2012-01-20 13:50:03.000000000 +0100
+++ b/net/mac80211/status.c	2012-01-20 13:50:10.000000000 +0100
@@ -350,7 +350,6 @@ void ieee80211_tx_status(struct ieee8021
 	bool send_to_cooked;
 	bool acked;
 	struct ieee80211_bar *bar;
-	u16 tid;
 	int rtap_len;
 
 	for (i = 0; i < IEEE80211_TX_MAX_RATES; i++) {
@@ -412,7 +411,7 @@ void ieee80211_tx_status(struct ieee8021
 		}
 
 		if (!acked && ieee80211_is_back_req(fc)) {
-			u16 control;
+			u16 tid, control;
 
 			/*
 			 * BAR failed, store the last SSN and retry sending
@@ -516,7 +515,8 @@ void ieee80211_tx_status(struct ieee8021
 
 		if (ieee80211_is_nullfunc(hdr->frame_control) ||
 		    ieee80211_is_qos_nullfunc(hdr->frame_control)) {
-			bool acked = info->flags & IEEE80211_TX_STAT_ACK;
+			acked = info->flags & IEEE80211_TX_STAT_ACK;
+
 			cfg80211_probe_status(skb->dev, hdr->addr1,
 					      cookie, acked, GFP_ATOMIC);
 		} else {



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

* [PATCH 2/2] cfg80211: fix a few -Wshadow warnings
  2012-01-20 12:52 [PATCH 0/2] fix shadow warnings Johannes Berg
  2012-01-20 12:52 ` [PATCH 1/2] mac80211: fix a few -Wshadow warnings Johannes Berg
@ 2012-01-20 12:52 ` Johannes Berg
  1 sibling, 0 replies; 3+ messages in thread
From: Johannes Berg @ 2012-01-20 12:52 UTC (permalink / raw)
  To: John Linville; +Cc: linux-wireless

From: Johannes Berg <johannes.berg@intel.com>

It seems that -Wshadow is no longer default in
sparse runs, but let's fix the warnings anyway.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
---
 net/wireless/nl80211.c |    8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

--- a/net/wireless/nl80211.c	2012-01-20 13:49:32.000000000 +0100
+++ b/net/wireless/nl80211.c	2012-01-20 13:51:00.000000000 +0100
@@ -427,10 +427,9 @@ static int nl80211_parse_key_new(struct
 
 	if (tb[NL80211_KEY_DEFAULT_TYPES]) {
 		struct nlattr *kdt[NUM_NL80211_KEY_DEFAULT_TYPES];
-		int err = nla_parse_nested(kdt,
-					   NUM_NL80211_KEY_DEFAULT_TYPES - 1,
-					   tb[NL80211_KEY_DEFAULT_TYPES],
-					   nl80211_key_default_policy);
+		err = nla_parse_nested(kdt, NUM_NL80211_KEY_DEFAULT_TYPES - 1,
+				       tb[NL80211_KEY_DEFAULT_TYPES],
+				       nl80211_key_default_policy);
 		if (err)
 			return err;
 
@@ -4781,7 +4780,6 @@ static int nl80211_join_ibss(struct sk_b
 			nla_len(info->attrs[NL80211_ATTR_BSS_BASIC_RATES]);
 		struct ieee80211_supported_band *sband =
 			wiphy->bands[ibss.channel->band];
-		int err;
 
 		err = ieee80211_get_ratemask(sband, rates, n_rates,
 					     &ibss.basic_rates);



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

end of thread, other threads:[~2012-01-20 12:53 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-01-20 12:52 [PATCH 0/2] fix shadow warnings Johannes Berg
2012-01-20 12:52 ` [PATCH 1/2] mac80211: fix a few -Wshadow warnings Johannes Berg
2012-01-20 12:52 ` [PATCH 2/2] cfg80211: " Johannes Berg

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