aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorArnd Bergmann <arnd@arndb.de>2013-01-25 09:14:33 -0500
committerJohannes Berg <johannes.berg@intel.com>2013-01-25 09:18:18 -0500
commitfe80123d83d1f9abca426914f768048e601f54db (patch)
treee9db3f7b99aca5ea532101de04ea4038d6643520 /net
parent782d2673655c05a1c0335fe0ee4cb62c23bcc231 (diff)
mac80211: avoid a build warning
gcc cannot prove that the value of sdata->vif.type does not change between the switch() statement and the second comparison to NL80211_IFTYPE_AP, causing a harmless warning. Slightly reordering the code makes the warning go away with no functional change. Without this patch, building ARM at91sam9g45_defconfig with gcc-4.6 results in: net/mac80211/tx.c: In function 'ieee80211_subif_start_xmit': net/mac80211/tx.c:1797:22: warning: 'chanctx_conf' may be used uninitialized in this function [-Wuninitialized] Signed-off-by: Arnd Bergmann <arnd@arndb.de> Cc: Johannes Berg <johannes@sipsolutions.net> Cc: "John W. Linville" <linville@tuxdriver.com> Cc: "David S. Miller" <davem@davemloft.net> Cc: linux-wireless@vger.kernel.org Cc: netdev@vger.kernel.org Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net')
-rw-r--r--net/mac80211/tx.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c
index 0d7381679a5c..b4a84146de0c 100644
--- a/net/mac80211/tx.c
+++ b/net/mac80211/tx.c
@@ -1784,16 +1784,16 @@ netdev_tx_t ieee80211_subif_start_xmit(struct sk_buff *skb,
1784 break; 1784 break;
1785 /* fall through */ 1785 /* fall through */
1786 case NL80211_IFTYPE_AP: 1786 case NL80211_IFTYPE_AP:
1787 if (sdata->vif.type == NL80211_IFTYPE_AP)
1788 chanctx_conf = rcu_dereference(sdata->vif.chanctx_conf);
1789 if (!chanctx_conf)
1790 goto fail_rcu;
1787 fc |= cpu_to_le16(IEEE80211_FCTL_FROMDS); 1791 fc |= cpu_to_le16(IEEE80211_FCTL_FROMDS);
1788 /* DA BSSID SA */ 1792 /* DA BSSID SA */
1789 memcpy(hdr.addr1, skb->data, ETH_ALEN); 1793 memcpy(hdr.addr1, skb->data, ETH_ALEN);
1790 memcpy(hdr.addr2, sdata->vif.addr, ETH_ALEN); 1794 memcpy(hdr.addr2, sdata->vif.addr, ETH_ALEN);
1791 memcpy(hdr.addr3, skb->data + ETH_ALEN, ETH_ALEN); 1795 memcpy(hdr.addr3, skb->data + ETH_ALEN, ETH_ALEN);
1792 hdrlen = 24; 1796 hdrlen = 24;
1793 if (sdata->vif.type == NL80211_IFTYPE_AP)
1794 chanctx_conf = rcu_dereference(sdata->vif.chanctx_conf);
1795 if (!chanctx_conf)
1796 goto fail_rcu;
1797 band = chanctx_conf->def.chan->band; 1797 band = chanctx_conf->def.chan->band;
1798 break; 1798 break;
1799 case NL80211_IFTYPE_WDS: 1799 case NL80211_IFTYPE_WDS: