rt2x00: Minor optimization for devices with RTS/CTS offload
authorHelmut Schaa <helmut.schaa@googlemail.com>
Sun, 20 Feb 2011 12:55:46 +0000 (13:55 +0100)
committerJohn W. Linville <linville@tuxdriver.com>
Mon, 21 Feb 2011 20:39:59 +0000 (15:39 -0500)
Only devices that don't have RTS/CTS offload need to check for
IEEE80211_TX_RC_USE_RTS_CTS and IEEE80211_TX_RC_USE_CTS_PROTECT.

By swapping both conditions we keep the same number of needed conditionals
for devices without RTS/CTS offload but save one conditional on devices
with RTS/CTS offload.

Signed-off-by: Helmut Schaa <helmut.schaa@googlemail.com>
Acked-by: Gertjan van Wingerde <gwingerde@gmail.com>
Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/rt2x00/rt2x00mac.c

index 6a66021d8f654b759c831c5d884d791f368eef0b..1b3edef9e3d2b6a024870b69f7b0e8b467df801e 100644 (file)
@@ -139,9 +139,9 @@ int rt2x00mac_tx(struct ieee80211_hw *hw, struct sk_buff *skb)
         * either RTS or CTS-to-self frame and handles everything
         * inside the hardware.
         */
-       if ((tx_info->control.rates[0].flags & (IEEE80211_TX_RC_USE_RTS_CTS |
-                                               IEEE80211_TX_RC_USE_CTS_PROTECT)) &&
-           !rt2x00dev->ops->hw->set_rts_threshold) {
+       if (!rt2x00dev->ops->hw->set_rts_threshold &&
+           (tx_info->control.rates[0].flags & (IEEE80211_TX_RC_USE_RTS_CTS |
+                                               IEEE80211_TX_RC_USE_CTS_PROTECT))) {
                if (rt2x00queue_available(queue) <= 1)
                        goto exit_fail;