Search Linux Wireless

[PATCH] mac80211: remove redundant flag check

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Fred Chou <fred.chou.nd@xxxxxxxxx>

It's not necessary to check a flag setting and then
set it anyway. The outer condition check is redundant
in the code below. Remove the outer if.

Signed-off-by: Fred Chou  <fred.chou.nd@xxxxxxxxx>
---
 net/mac80211/tx.c |   12 +++++-------
 1 file changed, 5 insertions(+), 7 deletions(-)

diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c
index 2f0e176..52bb276 100644
--- a/net/mac80211/tx.c
+++ b/net/mac80211/tx.c
@@ -1157,13 +1157,11 @@ ieee80211_tx_prepare(struct ieee80211_sub_if_data *sdata,
 		info->flags |= IEEE80211_TX_CTL_NO_ACK;
 	} else
 		tx->flags |= IEEE80211_TX_UNICAST;
-
-	if (!(info->flags & IEEE80211_TX_CTL_DONTFRAG)) {
-		if (!(tx->flags & IEEE80211_TX_UNICAST) ||
-		    skb->len + FCS_LEN <= local->hw.wiphy->frag_threshold ||
-		    info->flags & IEEE80211_TX_CTL_AMPDU)
-			info->flags |= IEEE80211_TX_CTL_DONTFRAG;
-	}
+
+	if (!(tx->flags & IEEE80211_TX_UNICAST) ||
+	    skb->len + FCS_LEN <= local->hw.wiphy->frag_threshold ||
+	    info->flags & IEEE80211_TX_CTL_AMPDU)
+		info->flags |= IEEE80211_TX_CTL_DONTFRAG;
 
 	if (!tx->sta)
 		info->flags |= IEEE80211_TX_CTL_CLEAR_PS_FILT;
-- 
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Wireless Personal Area Network]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Hiking]     [MIPS Linux]     [ARM Linux]     [Linux RAID]

  Powered by Linux