From patchwork Tue Oct 20 06:02:46 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: manikanta.pubbisetty@gmail.com X-Patchwork-Id: 7449701 Return-Path: X-Original-To: patchwork-ath10k@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id EC00F9F302 for ; Tue, 20 Oct 2015 18:33:20 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 16BC12073A for ; Tue, 20 Oct 2015 18:33:20 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 41E6A206FF for ; Tue, 20 Oct 2015 18:33:19 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1Zobic-0004CM-Js; Tue, 20 Oct 2015 18:33:06 +0000 Received: from mail-pa0-x241.google.com ([2607:f8b0:400e:c03::241]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Zobia-0004A4-4t for ath10k@lists.infradead.org; Tue, 20 Oct 2015 18:33:04 +0000 Received: by pacik9 with SMTP id ik9so2880428pac.3 for ; Tue, 20 Oct 2015 11:32:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=6YUCdngf/Dbpu82wo+7dNkvhG+s1nIY0lUK1J1ouBrk=; b=02HjVDLq/Avbhmsxmn2xJty6r2anVjU9Ka0q+lsol8uW9Wh50WdHIoF9NfmXs+btHC AbDTb9rMX2XbQCa6CMdDmobN9jyWMCZ+kBqOa6rcFdaLt9TnKTOB+QobMAxpHVojO6Ia qTMRw9WV8qx9vyGwVsr4t61YZiRCElN/J3mbNqJbU2bFixawiI+ZLlLPrpQ9jRpKrvap u8XSsIO48OIFaj6enF25ff5+/rUkZqpDD1y7YVyADTvykNsB9Co1ZdBOjkQ6d4vcRhph +M7lt6Gp896veHjGz6f8eRRVAcFuTbJhKWDwrrdylvSuuPYDNsmrSNTV4qyWLpbrN/cz tXIQ== X-Received: by 10.68.103.2 with SMTP id fs2mr5438502pbb.123.1445365963024; Tue, 20 Oct 2015 11:32:43 -0700 (PDT) Received: from localhost ([106.51.23.91]) by smtp.gmail.com with ESMTPSA id pk2sm5009374pbb.21.2015.10.20.11.32.41 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Tue, 20 Oct 2015 11:32:42 -0700 (PDT) From: manikanta.pubbisetty@gmail.com To: ath10k@lists.infradead.org Subject: [PATCH] ath10k: consolidate if statements in ath10k_wmi_event_mgmt_rx Date: Tue, 20 Oct 2015 11:32:46 +0530 Message-Id: <1445320966-17024-1-git-send-email-manikanta.pubbisetty@gmail.com> X-Mailer: git-send-email 1.9.1 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20151020_113304_218635_3ABB3E64 X-CRM114-Status: UNSURE ( 8.91 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -1.7 (-) X-BeenThere: ath10k@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Manikanta Pubbisetty , linux-wireless@vger.kernel.org MIME-Version: 1.0 Sender: "ath10k" Errors-To: ath10k-bounces+patchwork-ath10k=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-3.0 required=5.0 tests=BAYES_00, DATE_IN_PAST_12_24, DKIM_ADSP_CUSTOM_MED,DKIM_SIGNED,FREEMAIL_FROM,RCVD_IN_DNSWL_MED, 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: Manikanta Pubbisetty This patch combines several if statements into a single if condition in WMI management rx handler. Found during code review. Signed-off-by: Manikanta Pubbisetty --- drivers/net/wireless/ath/ath10k/wmi.c | 19 +++---------------- 1 file changed, 3 insertions(+), 16 deletions(-) diff --git a/drivers/net/wireless/ath/ath10k/wmi.c b/drivers/net/wireless/ath/ath10k/wmi.c index 6e7d7a7..a9d42ef 100644 --- a/drivers/net/wireless/ath/ath10k/wmi.c +++ b/drivers/net/wireless/ath/ath10k/wmi.c @@ -2200,22 +2200,9 @@ int ath10k_wmi_event_mgmt_rx(struct ath10k *ar, struct sk_buff *skb) ath10k_dbg(ar, ATH10K_DBG_MGMT, "event mgmt rx status %08x\n", rx_status); - if (test_bit(ATH10K_CAC_RUNNING, &ar->dev_flags)) { - dev_kfree_skb(skb); - return 0; - } - - if (rx_status & WMI_RX_STATUS_ERR_DECRYPT) { - dev_kfree_skb(skb); - return 0; - } - - if (rx_status & WMI_RX_STATUS_ERR_KEY_CACHE_MISS) { - dev_kfree_skb(skb); - return 0; - } - - if (rx_status & WMI_RX_STATUS_ERR_CRC) { + if ((test_bit(ATH10K_CAC_RUNNING, &ar->dev_flags)) || + (rx_stats & (WMI_RX_STATUS_ERR_DECRYPT | + WMI_RX_STATUS_ERR_KEY_CACHE_MISS | WMI_RX_STATUS_ERR_CRC))) { dev_kfree_skb(skb); return 0; }