From patchwork Mon Dec 23 11:07:50 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: fred.chou.nd@gmail.com X-Patchwork-Id: 3396441 Return-Path: X-Original-To: patchwork-linux-wireless@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id CA6A4C0D4A for ; Mon, 23 Dec 2013 11:06:14 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 346AA20136 for ; Mon, 23 Dec 2013 11:06:10 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 22FD82012E for ; Mon, 23 Dec 2013 11:06:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753213Ab3LWLGG (ORCPT ); Mon, 23 Dec 2013 06:06:06 -0500 Received: from mail-pd0-f177.google.com ([209.85.192.177]:52268 "EHLO mail-pd0-f177.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752032Ab3LWLGF (ORCPT ); Mon, 23 Dec 2013 06:06:05 -0500 Received: by mail-pd0-f177.google.com with SMTP id q10so4963667pdj.8 for ; Mon, 23 Dec 2013 03:06:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=vE7BIhYE5FfXT6lCUqdSO4PdaT1Q1xGP4ylRf5vbZuA=; b=K17e4RyyPU/BSpuM0rqIzg6jUZ2sEqFhOhSvpkXi58Wdks/eM5h0Ibc4n98UuSMjJV iS//iw9o7sF39MInpK3WVhciChnkQX0BwsWFmU0EjX2YVEpDdFIaDiLf9AHk2nCa2+2g iyQdif6J4Kk0z0tA+Z2Te1sZhbcyc3AIgj2yDTffy4Xoe1gw+ghpecw7sR//izzBnUc4 ghYV5FFvh6RkbAd4tTnuLXuwV8yOzvpW4iiYiOPeHMCigs7nhxNJ3rwjjyurytdU9Rir nwdN6mLaWQQpqo7GMXlC7CxgaGLPPp+gTJotKYHyOqOYEKeUTRMHBuMD2WYpg/twFHOJ QGTA== X-Received: by 10.68.197.165 with SMTP id iv5mr2482359pbc.150.1387796764301; Mon, 23 Dec 2013 03:06:04 -0800 (PST) Received: from gmail.com ([192.122.131.9]) by mx.google.com with ESMTPSA id ql10sm33457213pbc.44.2013.12.23.03.06.01 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 23 Dec 2013 03:06:03 -0800 (PST) From: fred.chou.nd@gmail.com To: johannes@sipsolutions.net Cc: linux-wireless@vger.kernel.org, Fred Chou Subject: [PATCH] mac80211: remove redundant flag check Date: Mon, 23 Dec 2013 19:07:50 +0800 Message-Id: <52b8191b.6ade440a.6499.ffff91da@mx.google.com> X-Mailer: git-send-email 1.7.9.5 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Spam-Status: No, score=-4.5 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, FSL_HELO_FAKE, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Fred Chou 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 --- 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;