From patchwork Sun Nov 24 20:06:36 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Emmanuel Grumbach X-Patchwork-Id: 3227141 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 DC53CC045B for ; Sun, 24 Nov 2013 20:07:53 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 09C4420429 for ; Sun, 24 Nov 2013 20:07:53 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id DD6F62041F for ; Sun, 24 Nov 2013 20:07:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753820Ab3KXUHu (ORCPT ); Sun, 24 Nov 2013 15:07:50 -0500 Received: from mail-wi0-f173.google.com ([209.85.212.173]:39802 "EHLO mail-wi0-f173.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753321Ab3KXUHP (ORCPT ); Sun, 24 Nov 2013 15:07:15 -0500 Received: by mail-wi0-f173.google.com with SMTP id hm4so2718336wib.12 for ; Sun, 24 Nov 2013 12:07:14 -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:in-reply-to:references; bh=SLzAwPC8ti+BJ0VzdZTalw2mHdE5Np9KxmO7AH4+iM4=; b=WcKm3XdPPZLpwZ8EbIWfiv32t5ZVZ8LAlbSMP/viniElPu6IIBQs8nMlwTVBt83OWQ 1HYZkx3TjLcGqFpTdlmfqEooWq8yYnvetjHJ+9y3JGFk18eeie+o0jnftc+ulDEmznyq jm7gvuLxDiSHwUTpBL3tiYs1dvnIERBnAyHptTsy/fEEy1nvbbcu7G22z/wi3Wm9M1su NEedyRKTG8o3NS/cvPtzJL9Kw9PPVnZ2fKFngBzJv65/zmuTWmePG7WeA1/J6ccafhd+ vN08c3uEN/XravYWAInmRSKQ79waN8M7rFKCA54YX6BatfvFnSOu0u8Ft/gQQM2LLFjU QzkA== X-Received: by 10.194.219.1 with SMTP id pk1mr2564563wjc.36.1385323634230; Sun, 24 Nov 2013 12:07:14 -0800 (PST) Received: from localhost.localdomain (93-173-143-36.bb.netvision.net.il. [93.173.143.36]) by mx.google.com with ESMTPSA id bs15sm39450590wib.10.2013.11.24.12.07.13 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 24 Nov 2013 12:07:13 -0800 (PST) From: Emmanuel Grumbach To: linux-wireless@vger.kernel.org Cc: Michal Nazarewicz , Emmanuel Grumbach Subject: [PATCH 19/29] iwlwifi: pcie: remove minor dead code Date: Sun, 24 Nov 2013 22:06:36 +0200 Message-Id: <1385323606-3603-19-git-send-email-egrumbach@gmail.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <52925BE7.4050406@gmail.com> References: <52925BE7.4050406@gmail.com> Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, 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: Michal Nazarewicz inta is checked to be zero in a IRQ_NONE branch so afterwards it cannot be zero as it is never modified. Signed-off-by: Michal Nazarewicz [reword the patch title and fix comment] Signed-off-by: Emmanuel Grumbach --- drivers/net/wireless/iwlwifi/pcie/rx.c | 26 +++++++++++--------------- 1 file changed, 11 insertions(+), 15 deletions(-) diff --git a/drivers/net/wireless/iwlwifi/pcie/rx.c b/drivers/net/wireless/iwlwifi/pcie/rx.c index 3f237b4..79d46a9 100644 --- a/drivers/net/wireless/iwlwifi/pcie/rx.c +++ b/drivers/net/wireless/iwlwifi/pcie/rx.c @@ -1121,7 +1121,6 @@ static irqreturn_t iwl_pcie_isr(int irq, void *data) struct iwl_trans *trans = data; struct iwl_trans_pcie *trans_pcie = IWL_TRANS_GET_PCIE_TRANS(trans); u32 inta, inta_mask; - irqreturn_t ret = IRQ_NONE; lockdep_assert_held(&trans_pcie->irq_lock); @@ -1150,7 +1149,16 @@ static irqreturn_t iwl_pcie_isr(int irq, void *data) * or due to sporadic interrupts thrown from our NIC. */ if (!inta) { IWL_DEBUG_ISR(trans, "Ignore interrupt, inta == 0\n"); - goto none; + /* + * Re-enable interrupts here since we don't have anything to + * service, but only in case the handler won't run. Note that + * the handler can be scheduled because of a previous + * interrupt. + */ + if (test_bit(STATUS_INT_ENABLED, &trans_pcie->status) && + !trans_pcie->inta) + iwl_enable_interrupts(trans); + return IRQ_NONE; } if ((inta == 0xFFFFFFFF) || ((inta & 0xFFFFFFF0) == 0xa5a5a5a0)) { @@ -1168,19 +1176,7 @@ static irqreturn_t iwl_pcie_isr(int irq, void *data) trans_pcie->inta |= inta; /* the thread will service interrupts and re-enable them */ - if (likely(inta)) - return IRQ_WAKE_THREAD; - - ret = IRQ_HANDLED; - -none: - /* re-enable interrupts here since we don't have anything to service. */ - /* only Re-enable if disabled by irq and no schedules tasklet. */ - if (test_bit(STATUS_INT_ENABLED, &trans_pcie->status) && - !trans_pcie->inta) - iwl_enable_interrupts(trans); - - return ret; + return IRQ_WAKE_THREAD; } /* interrupt handler using ict table, with this interrupt driver will