mac80211: remove almost unused local variable

Linux-MTD Mailing List linux-mtd at lists.infradead.org
Sat Sep 29 10:59:44 EDT 2012


Gitweb:     http://git.infradead.org/?p=mtd-2.6.git;a=commit;h=e31583cdf0e2eb71c44b1288a2d93405f972da68
Commit:     e31583cdf0e2eb71c44b1288a2d93405f972da68
Parent:     466f310d100ff54f346c1be481af9935c42467b3
Author:     Johannes Berg <johannes.berg at intel.com>
AuthorDate: Thu Jul 26 14:07:46 2012 +0200
Committer:  Johannes Berg <johannes.berg at intel.com>
CommitDate: Mon Aug 20 14:13:39 2012 +0200

    mac80211: remove almost unused local variable
    
    In ieee80211_beacon_get_tim() we can use the
    txrc.sband instead of a separate local variable.
    
    Signed-off-by: Johannes Berg <johannes.berg at intel.com>
---
 net/mac80211/tx.c |    7 ++-----
 1 files changed, 2 insertions(+), 5 deletions(-)

diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c
index 2d004ba..2d2f45e 100644
--- a/net/mac80211/tx.c
+++ b/net/mac80211/tx.c
@@ -2300,12 +2300,9 @@ struct sk_buff *ieee80211_beacon_get_tim(struct ieee80211_hw *hw,
 	struct ieee80211_sub_if_data *sdata = NULL;
 	struct ieee80211_if_ap *ap = NULL;
 	struct beacon_data *beacon;
-	struct ieee80211_supported_band *sband;
 	enum ieee80211_band band = local->oper_channel->band;
 	struct ieee80211_tx_rate_control txrc;
 
-	sband = local->hw.wiphy->bands[band];
-
 	rcu_read_lock();
 
 	sdata = vif_to_sdata(vif);
@@ -2452,12 +2449,12 @@ struct sk_buff *ieee80211_beacon_get_tim(struct ieee80211_hw *hw,
 
 	memset(&txrc, 0, sizeof(txrc));
 	txrc.hw = hw;
-	txrc.sband = sband;
+	txrc.sband = local->hw.wiphy->bands[band];
 	txrc.bss_conf = &sdata->vif.bss_conf;
 	txrc.skb = skb;
 	txrc.reported_rate.idx = -1;
 	txrc.rate_idx_mask = sdata->rc_rateidx_mask[band];
-	if (txrc.rate_idx_mask == (1 << sband->n_bitrates) - 1)
+	if (txrc.rate_idx_mask == (1 << txrc.sband->n_bitrates) - 1)
 		txrc.max_rate_idx = -1;
 	else
 		txrc.max_rate_idx = fls(txrc.rate_idx_mask) - 1;



More information about the linux-mtd-cvs mailing list