Commit 444e3803 authored by Johannes Berg's avatar Johannes Berg

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: default avatarJohannes Berg <johannes.berg@intel.com>
parent 8ba7acf3
...@@ -2823,7 +2823,6 @@ static int ieee80211_tdls_mgmt(struct wiphy *wiphy, struct net_device *dev, ...@@ -2823,7 +2823,6 @@ static int ieee80211_tdls_mgmt(struct wiphy *wiphy, struct net_device *dev,
{ {
struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev); struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev);
struct ieee80211_local *local = sdata->local; struct ieee80211_local *local = sdata->local;
struct ieee80211_tx_info *info;
struct sk_buff *skb = NULL; struct sk_buff *skb = NULL;
bool send_direct; bool send_direct;
int ret; int ret;
...@@ -2849,7 +2848,6 @@ static int ieee80211_tdls_mgmt(struct wiphy *wiphy, struct net_device *dev, ...@@ -2849,7 +2848,6 @@ static int ieee80211_tdls_mgmt(struct wiphy *wiphy, struct net_device *dev,
if (!skb) if (!skb)
return -ENOMEM; return -ENOMEM;
info = IEEE80211_SKB_CB(skb);
skb_reserve(skb, local->hw.extra_tx_headroom); skb_reserve(skb, local->hw.extra_tx_headroom);
switch (action_code) { switch (action_code) {
......
...@@ -2617,14 +2617,9 @@ static void ieee80211_rx_mgmt_beacon(struct ieee80211_sub_if_data *sdata, ...@@ -2617,14 +2617,9 @@ static void ieee80211_rx_mgmt_beacon(struct ieee80211_sub_if_data *sdata,
if (elems.ht_cap_elem && elems.ht_operation && elems.wmm_param && if (elems.ht_cap_elem && elems.ht_operation && elems.wmm_param &&
!(ifmgd->flags & IEEE80211_STA_DISABLE_11N)) { !(ifmgd->flags & IEEE80211_STA_DISABLE_11N))
struct ieee80211_supported_band *sband;
sband = local->hw.wiphy->bands[chan->band];
changed |= ieee80211_config_ht_tx(sdata, elems.ht_operation, changed |= ieee80211_config_ht_tx(sdata, elems.ht_operation,
bssid, true); bssid, true);
}
if (elems.country_elem && elems.pwr_constr_elem && if (elems.country_elem && elems.pwr_constr_elem &&
mgmt->u.probe_resp.capab_info & mgmt->u.probe_resp.capab_info &
......
...@@ -1384,9 +1384,7 @@ ieee80211_reassemble_add(struct ieee80211_sub_if_data *sdata, ...@@ -1384,9 +1384,7 @@ ieee80211_reassemble_add(struct ieee80211_sub_if_data *sdata,
struct sk_buff **skb) struct sk_buff **skb)
{ {
struct ieee80211_fragment_entry *entry; struct ieee80211_fragment_entry *entry;
int idx;
idx = sdata->fragment_next;
entry = &sdata->fragments[sdata->fragment_next++]; entry = &sdata->fragments[sdata->fragment_next++];
if (sdata->fragment_next >= IEEE80211_FRAGMENT_MAX) if (sdata->fragment_next >= IEEE80211_FRAGMENT_MAX)
sdata->fragment_next = 0; sdata->fragment_next = 0;
...@@ -3010,8 +3008,7 @@ void ieee80211_rx(struct ieee80211_hw *hw, struct sk_buff *skb) ...@@ -3010,8 +3008,7 @@ void ieee80211_rx(struct ieee80211_hw *hw, struct sk_buff *skb)
WARN_ON_ONCE(softirq_count() == 0); WARN_ON_ONCE(softirq_count() == 0);
if (WARN_ON(status->band < 0 || if (WARN_ON(status->band >= IEEE80211_NUM_BANDS))
status->band >= IEEE80211_NUM_BANDS))
goto drop; goto drop;
sband = local->hw.wiphy->bands[status->band]; sband = local->hw.wiphy->bands[status->band];
...@@ -3056,8 +3053,7 @@ void ieee80211_rx(struct ieee80211_hw *hw, struct sk_buff *skb) ...@@ -3056,8 +3053,7 @@ void ieee80211_rx(struct ieee80211_hw *hw, struct sk_buff *skb)
* hardware error. The driver should catch hardware * hardware error. The driver should catch hardware
* errors. * errors.
*/ */
if (WARN((status->rate_idx < 0 || if (WARN(status->rate_idx > 76,
status->rate_idx > 76),
"Rate marked as an HT rate but passed " "Rate marked as an HT rate but passed "
"status->rate_idx is not " "status->rate_idx is not "
"an MCS index [0-76]: %d (0x%02x)\n", "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,8 +3061,7 @@ void ieee80211_rx(struct ieee80211_hw *hw, struct sk_buff *skb)
status->rate_idx)) status->rate_idx))
goto drop; goto drop;
} else { } else {
if (WARN_ON(status->rate_idx < 0 || if (WARN_ON(status->rate_idx >= sband->n_bitrates))
status->rate_idx >= sband->n_bitrates))
goto drop; goto drop;
rate = &sband->bitrates[status->rate_idx]; rate = &sband->bitrates[status->rate_idx];
} }
......
...@@ -944,7 +944,6 @@ ieee80211_tx_h_fragment(struct ieee80211_tx_data *tx) ...@@ -944,7 +944,6 @@ ieee80211_tx_h_fragment(struct ieee80211_tx_data *tx)
fragnum = 0; fragnum = 0;
skb_queue_walk(&tx->skbs, skb) { skb_queue_walk(&tx->skbs, skb) {
int next_len;
const __le16 morefrags = cpu_to_le16(IEEE80211_FCTL_MOREFRAGS); const __le16 morefrags = cpu_to_le16(IEEE80211_FCTL_MOREFRAGS);
hdr = (void *)skb->data; hdr = (void *)skb->data;
...@@ -963,7 +962,6 @@ ieee80211_tx_h_fragment(struct ieee80211_tx_data *tx) ...@@ -963,7 +962,6 @@ ieee80211_tx_h_fragment(struct ieee80211_tx_data *tx)
info->flags &= ~IEEE80211_TX_CTL_RATE_CTRL_PROBE; info->flags &= ~IEEE80211_TX_CTL_RATE_CTRL_PROBE;
} else { } else {
hdr->frame_control &= ~morefrags; hdr->frame_control &= ~morefrags;
next_len = 0;
} }
hdr->seq_ctrl |= cpu_to_le16(fragnum & IEEE80211_SCTL_FRAG); hdr->seq_ctrl |= cpu_to_le16(fragnum & IEEE80211_SCTL_FRAG);
fragnum++; fragnum++;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment