aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2012-09-30 11:08:35 -0400
committerJohannes Berg <johannes.berg@intel.com>2012-10-18 03:01:56 -0400
commit444e38035eafba2993a690497b205ce385df3a8e (patch)
tree0298dddd7f28a1ff01e5ea816c4cb9225fa336c7 /net/mac80211
parent8ba7acf376e39ff2b987bc8fb71eb599023af314 (diff)
mac80211: remove some unused code
There are a number of unused variables that gcc pointed out (when building with W=1) as well as some conditions that can never be true due to the datatypes used: unsigned values can't be less than zero. Remove this code. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/mac80211')
-rw-r--r--net/mac80211/cfg.c2
-rw-r--r--net/mac80211/mlme.c7
-rw-r--r--net/mac80211/rx.c11
-rw-r--r--net/mac80211/tx.c2
4 files changed, 4 insertions, 18 deletions
diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c
index ed27988f9d35..5739bfbf2999 100644
--- a/net/mac80211/cfg.c
+++ b/net/mac80211/cfg.c
@@ -2823,7 +2823,6 @@ static int ieee80211_tdls_mgmt(struct wiphy *wiphy, struct net_device *dev,
2823{ 2823{
2824 struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev); 2824 struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev);
2825 struct ieee80211_local *local = sdata->local; 2825 struct ieee80211_local *local = sdata->local;
2826 struct ieee80211_tx_info *info;
2827 struct sk_buff *skb = NULL; 2826 struct sk_buff *skb = NULL;
2828 bool send_direct; 2827 bool send_direct;
2829 int ret; 2828 int ret;
@@ -2849,7 +2848,6 @@ static int ieee80211_tdls_mgmt(struct wiphy *wiphy, struct net_device *dev,
2849 if (!skb) 2848 if (!skb)
2850 return -ENOMEM; 2849 return -ENOMEM;
2851 2850
2852 info = IEEE80211_SKB_CB(skb);
2853 skb_reserve(skb, local->hw.extra_tx_headroom); 2851 skb_reserve(skb, local->hw.extra_tx_headroom);
2854 2852
2855 switch (action_code) { 2853 switch (action_code) {
diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c
index ab39c4f44e5c..469d86419bc6 100644
--- a/net/mac80211/mlme.c
+++ b/net/mac80211/mlme.c
@@ -2617,14 +2617,9 @@ static void ieee80211_rx_mgmt_beacon(struct ieee80211_sub_if_data *sdata,
2617 2617
2618 2618
2619 if (elems.ht_cap_elem && elems.ht_operation && elems.wmm_param && 2619 if (elems.ht_cap_elem && elems.ht_operation && elems.wmm_param &&
2620 !(ifmgd->flags & IEEE80211_STA_DISABLE_11N)) { 2620 !(ifmgd->flags & IEEE80211_STA_DISABLE_11N))
2621 struct ieee80211_supported_band *sband;
2622
2623 sband = local->hw.wiphy->bands[chan->band];
2624
2625 changed |= ieee80211_config_ht_tx(sdata, elems.ht_operation, 2621 changed |= ieee80211_config_ht_tx(sdata, elems.ht_operation,
2626 bssid, true); 2622 bssid, true);
2627 }
2628 2623
2629 if (elems.country_elem && elems.pwr_constr_elem && 2624 if (elems.country_elem && elems.pwr_constr_elem &&
2630 mgmt->u.probe_resp.capab_info & 2625 mgmt->u.probe_resp.capab_info &
diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c
index 61c621e9273f..9f64fc4ecd29 100644
--- a/net/mac80211/rx.c
+++ b/net/mac80211/rx.c
@@ -1384,9 +1384,7 @@ ieee80211_reassemble_add(struct ieee80211_sub_if_data *sdata,
1384 struct sk_buff **skb) 1384 struct sk_buff **skb)
1385{ 1385{
1386 struct ieee80211_fragment_entry *entry; 1386 struct ieee80211_fragment_entry *entry;
1387 int idx;
1388 1387
1389 idx = sdata->fragment_next;
1390 entry = &sdata->fragments[sdata->fragment_next++]; 1388 entry = &sdata->fragments[sdata->fragment_next++];
1391 if (sdata->fragment_next >= IEEE80211_FRAGMENT_MAX) 1389 if (sdata->fragment_next >= IEEE80211_FRAGMENT_MAX)
1392 sdata->fragment_next = 0; 1390 sdata->fragment_next = 0;
@@ -3010,8 +3008,7 @@ void ieee80211_rx(struct ieee80211_hw *hw, struct sk_buff *skb)
3010 3008
3011 WARN_ON_ONCE(softirq_count() == 0); 3009 WARN_ON_ONCE(softirq_count() == 0);
3012 3010
3013 if (WARN_ON(status->band < 0 || 3011 if (WARN_ON(status->band >= IEEE80211_NUM_BANDS))
3014 status->band >= IEEE80211_NUM_BANDS))
3015 goto drop; 3012 goto drop;
3016 3013
3017 sband = local->hw.wiphy->bands[status->band]; 3014 sband = local->hw.wiphy->bands[status->band];
@@ -3056,8 +3053,7 @@ void ieee80211_rx(struct ieee80211_hw *hw, struct sk_buff *skb)
3056 * hardware error. The driver should catch hardware 3053 * hardware error. The driver should catch hardware
3057 * errors. 3054 * errors.
3058 */ 3055 */
3059 if (WARN((status->rate_idx < 0 || 3056 if (WARN(status->rate_idx > 76,
3060 status->rate_idx > 76),
3061 "Rate marked as an HT rate but passed " 3057 "Rate marked as an HT rate but passed "
3062 "status->rate_idx is not " 3058 "status->rate_idx is not "
3063 "an MCS index [0-76]: %d (0x%02x)\n", 3059 "an MCS index [0-76]: %d (0x%02x)\n",
@@ -3065,8 +3061,7 @@ void ieee80211_rx(struct ieee80211_hw *hw, struct sk_buff *skb)
3065 status->rate_idx)) 3061 status->rate_idx))
3066 goto drop; 3062 goto drop;
3067 } else { 3063 } else {
3068 if (WARN_ON(status->rate_idx < 0 || 3064 if (WARN_ON(status->rate_idx >= sband->n_bitrates))
3069 status->rate_idx >= sband->n_bitrates))
3070 goto drop; 3065 goto drop;
3071 rate = &sband->bitrates[status->rate_idx]; 3066 rate = &sband->bitrates[status->rate_idx];
3072 } 3067 }
diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c
index eee448ac71ff..bbe1d86beea1 100644
--- a/net/mac80211/tx.c
+++ b/net/mac80211/tx.c
@@ -944,7 +944,6 @@ ieee80211_tx_h_fragment(struct ieee80211_tx_data *tx)
944 fragnum = 0; 944 fragnum = 0;
945 945
946 skb_queue_walk(&tx->skbs, skb) { 946 skb_queue_walk(&tx->skbs, skb) {
947 int next_len;
948 const __le16 morefrags = cpu_to_le16(IEEE80211_FCTL_MOREFRAGS); 947 const __le16 morefrags = cpu_to_le16(IEEE80211_FCTL_MOREFRAGS);
949 948
950 hdr = (void *)skb->data; 949 hdr = (void *)skb->data;
@@ -963,7 +962,6 @@ ieee80211_tx_h_fragment(struct ieee80211_tx_data *tx)
963 info->flags &= ~IEEE80211_TX_CTL_RATE_CTRL_PROBE; 962 info->flags &= ~IEEE80211_TX_CTL_RATE_CTRL_PROBE;
964 } else { 963 } else {
965 hdr->frame_control &= ~morefrags; 964 hdr->frame_control &= ~morefrags;
966 next_len = 0;
967 } 965 }
968 hdr->seq_ctrl |= cpu_to_le16(fragnum & IEEE80211_SCTL_FRAG); 966 hdr->seq_ctrl |= cpu_to_le16(fragnum & IEEE80211_SCTL_FRAG);
969 fragnum++; 967 fragnum++;