mac80211: remove local_to_hw
authorJohannes Berg <johannes.berg@intel.com>
Sun, 26 Feb 2012 10:24:35 +0000 (11:24 +0100)
committerJohn W. Linville <linville@tuxdriver.com>
Mon, 27 Feb 2012 19:06:42 +0000 (14:06 -0500)
That's a lot longer than open-coding it and
doesn't really add value, so just remove it.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
net/mac80211/ieee80211_i.h
net/mac80211/main.c
net/mac80211/tx.c
net/mac80211/util.c

index 4a722b10b4ddc788929e4321d13e58c2dd2bf604..4d1682950a60e4f107b662808463106245eee121 100644 (file)
@@ -1128,12 +1128,6 @@ static inline struct ieee80211_local *hw_to_local(
        return container_of(hw, struct ieee80211_local, hw);
 }
 
-static inline struct ieee80211_hw *local_to_hw(
-       struct ieee80211_local *local)
-{
-       return &local->hw;
-}
-
 
 static inline int ieee80211_bssid_match(const u8 *raddr, const u8 *addr)
 {
index 2306d7514fff5bb2c82d609a859a3e826fdd6099..36fa8051296c80fab82c37f206a46d5892592435 100644 (file)
@@ -286,11 +286,11 @@ static void ieee80211_tasklet_handler(unsigned long data)
                        /* Clear skb->pkt_type in order to not confuse kernel
                         * netstack. */
                        skb->pkt_type = 0;
-                       ieee80211_rx(local_to_hw(local), skb);
+                       ieee80211_rx(&local->hw, skb);
                        break;
                case IEEE80211_TX_STATUS_MSG:
                        skb->pkt_type = 0;
-                       ieee80211_tx_status(local_to_hw(local), skb);
+                       ieee80211_tx_status(&local->hw, skb);
                        break;
                case IEEE80211_EOSP_MSG:
                        eosp_data = (void *)skb->cb;
@@ -668,7 +668,7 @@ struct ieee80211_hw *ieee80211_alloc_hw(size_t priv_data_len,
 
        ieee80211_hw_roc_setup(local);
 
-       return local_to_hw(local);
+       return &local->hw;
 }
 EXPORT_SYMBOL(ieee80211_alloc_hw);
 
index c6eadac9ca4e20c6e74da2a63df8ccf3c47abae3..7c021f25571683510b77b7c19f7a5fd76276adfa 100644 (file)
@@ -625,7 +625,7 @@ ieee80211_tx_h_rate_ctrl(struct ieee80211_tx_data *tx)
                         tx->local->hw.wiphy->frag_threshold);
 
        /* set up the tx rate control struct we give the RC algo */
-       txrc.hw = local_to_hw(tx->local);
+       txrc.hw = &tx->local->hw;
        txrc.sband = sband;
        txrc.bss_conf = &tx->sdata->vif.bss_conf;
        txrc.skb = tx->skb;
index 264397aee8114eb6c26f477f877be6e16f4e4c80..f6e4cef92021c438c4086b44b130e4d62844c8d7 100644 (file)
@@ -753,7 +753,7 @@ void ieee80211_set_wmm_default(struct ieee80211_sub_if_data *sdata)
        use_11b = (local->hw.conf.channel->band == IEEE80211_BAND_2GHZ) &&
                 !(sdata->flags & IEEE80211_SDATA_OPERATING_GMODE);
 
-       for (queue = 0; queue < local_to_hw(local)->queues; queue++) {
+       for (queue = 0; queue < local->hw.queues; queue++) {
                /* Set defaults according to 802.11-2007 Table 7-37 */
                aCWmax = 1023;
                if (use_11b)