From: fred.chou.nd@gmail.com
To: johannes@sipsolutions.net
Cc: linux-wireless@vger.kernel.org, Fred Chou <fred.chou.nd@gmail.com>
Subject: [PATCH] mac80211: remove redundant flag check
Date: Mon, 23 Dec 2013 19:07:50 +0800 [thread overview]
Message-ID: <52b8191b.6ade440a.6499.ffff91da@mx.google.com> (raw)
From: Fred Chou <fred.chou.nd@gmail.com>
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@gmail.com>
---
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
next reply other threads:[~2013-12-23 11:06 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-12-23 11:07 fred.chou.nd [this message]
2014-01-06 15:19 ` [PATCH] mac80211: remove redundant flag check Johannes Berg
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=52b8191b.6ade440a.6499.ffff91da@mx.google.com \
--to=fred.chou.nd@gmail.com \
--cc=johannes@sipsolutions.net \
--cc=linux-wireless@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.