From patchwork Wed Dec 14 19:46:57 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Felix Fietkau X-Patchwork-Id: 9474601 X-Patchwork-Delegate: johannes@sipsolutions.net Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 905C360824 for ; Wed, 14 Dec 2016 19:47:31 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 806F12873B for ; Wed, 14 Dec 2016 19:47:31 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7560B2873D; Wed, 14 Dec 2016 19:47:31 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 589F328740 for ; Wed, 14 Dec 2016 19:47:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756520AbcLNTrO (ORCPT ); Wed, 14 Dec 2016 14:47:14 -0500 Received: from nbd.name ([46.4.11.11]:54209 "EHLO nbd.name" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756510AbcLNTrM (ORCPT ); Wed, 14 Dec 2016 14:47:12 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=nbd.name; s=20160729; h=References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From; bh=KX5jD6Tkqriu9pAU88EKnAdvSGfTkt4bOnib0CdPYlQ=; b=jL/j1xIeyU10AY/yJ45Yp7dAi+sTwMrwH02uXDC2vvHcXzgpq8jZZ6eAtQi8srXBqSKHNAPiG3PyQm/ycuXhMn/8lYEv1ShRFkToOw+1qhJDjCkDLGsdJbyKqrEKyq09gTYRq3VBZhPMOuffFk9VMCEmwvQ0EH8WNN/cYvzG60U=; Received: by nf-4.local (Postfix, from userid 501) id C5CB217728A6A; Wed, 14 Dec 2016 20:47:03 +0100 (CET) From: Felix Fietkau To: linux-wireless@vger.kernel.org Cc: johannes@sipsolutions.net, thomas.huehn@evernet-eg.de Subject: [PATCH 04/10] mac80211: check for MCS in ieee80211_duration before fetching chanctx Date: Wed, 14 Dec 2016 20:46:57 +0100 Message-Id: <20161214194703.33429-4-nbd@nbd.name> X-Mailer: git-send-email 2.10.1 In-Reply-To: <20161214194703.33429-1-nbd@nbd.name> References: <20161214194703.33429-1-nbd@nbd.name> Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Makes the code a bit more efficient Signed-off-by: Felix Fietkau --- net/mac80211/tx.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c index 058652d..4dea18b 100644 --- a/net/mac80211/tx.c +++ b/net/mac80211/tx.c @@ -64,6 +64,10 @@ static __le16 ieee80211_duration(struct ieee80211_tx_data *tx, struct ieee80211_chanctx_conf *chanctx_conf; u32 rate_flags = 0; + /* assume HW handles this */ + if (tx->rate.flags & (IEEE80211_TX_RC_MCS | IEEE80211_TX_RC_VHT_MCS)) + return 0; + rcu_read_lock(); chanctx_conf = rcu_dereference(tx->sdata->vif.chanctx_conf); if (chanctx_conf) { @@ -72,10 +76,6 @@ static __le16 ieee80211_duration(struct ieee80211_tx_data *tx, } rcu_read_unlock(); - /* assume HW handles this */ - if (tx->rate.flags & (IEEE80211_TX_RC_MCS | IEEE80211_TX_RC_VHT_MCS)) - return 0; - /* uh huh? */ if (WARN_ON_ONCE(tx->rate.idx < 0)) return 0;