From patchwork Tue Jul 25 01:13:34 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Brian Norris X-Patchwork-Id: 9860987 X-Patchwork-Delegate: kvalo@adurom.com 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 455956038C for ; Tue, 25 Jul 2017 01:17:53 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 37897283BF for ; Tue, 25 Jul 2017 01:17:53 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2C4742842E; Tue, 25 Jul 2017 01:17:53 +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=unavailable 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 B048E285C5 for ; Tue, 25 Jul 2017 01:17:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756966AbdGYBQN (ORCPT ); Mon, 24 Jul 2017 21:16:13 -0400 Received: from mail-pf0-f177.google.com ([209.85.192.177]:33635 "EHLO mail-pf0-f177.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756799AbdGYBO2 (ORCPT ); Mon, 24 Jul 2017 21:14:28 -0400 Received: by mail-pf0-f177.google.com with SMTP id s70so53109386pfs.0 for ; Mon, 24 Jul 2017 18:14:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=3Cgfbo0ylSrFsMVh8Oll6KIM7O7A0x4oOBWKUw1bIEw=; b=eQhYhfHp7Hb6yqsPJnXX+Gxn40JjFXlg5+Qx0IH/bxX5oKujTY+z09pluzOf394Wxr +aaHqYo+i39LZZcLDjeeRiIu4cORtv+g97+CL4imD9uILl3MRWebDUWleYL8bmQw5a6Z mDOxKoTQ8RoQIZkeCJqG7uKpoEStN/ZdEi45Y= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=3Cgfbo0ylSrFsMVh8Oll6KIM7O7A0x4oOBWKUw1bIEw=; b=PcNzV6t1yKgRcHQsUTdPoJns/S25mZOFchKDuHKssRp8ANGmL0zVFQ1JAQxCoYhKTy f/DvPoqWRUCeXypuwKyf6x9MChXm136NhEffdXLz/3UAGgSMkmzqK5y9MMqob53BbYrS Mvx7Tb+R11Glz4s20/Pir3RmCRHWnAHfRDvX9hLBnE0a2jyGHIyhg27kBQ3PFgrt5hvO Atad2RnhcnbWWdJx6mb0wRZJOOqoFzltRCcqhRZX0nLtEEqfGbC1QSXOGXzhDpPJ6bj9 4TR0MtXLpUrgP52LZRQ+hQFTN2Xt5RiwdBkcic4ZoK4XwAl8C7rAhSfBLBgYrjYm+I8/ ePow== X-Gm-Message-State: AIVw110XSEicXGHz2niSSJBeHfQE4/8V5QgqtXulxDGzoV/JVJ6YpNtg In7tUmMwBZX/UzRZ X-Received: by 10.98.103.140 with SMTP id t12mr16574344pfj.171.1500945267222; Mon, 24 Jul 2017 18:14:27 -0700 (PDT) Received: from ban.mtv.corp.google.com ([172.22.113.17]) by smtp.gmail.com with ESMTPSA id h123sm21497036pgc.36.2017.07.24.18.14.26 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 24 Jul 2017 18:14:26 -0700 (PDT) From: Brian Norris To: Ganapathi Bhat , Nishant Sarmukadam Cc: , Dmitry Torokhov , Amitkumar Karwar , Kalle Valo , linux-wireless@vger.kernel.org, Brian Norris Subject: [PATCH v2 18/20] mwifiex: pcie: remove unnecessary 'pdev' check Date: Mon, 24 Jul 2017 18:13:34 -0700 Message-Id: <20170725011336.99993-19-briannorris@chromium.org> X-Mailer: git-send-email 2.14.0.rc0.284.gd933b75aa4-goog In-Reply-To: <20170725011336.99993-1-briannorris@chromium.org> References: <20170725011336.99993-1-briannorris@chromium.org> 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 'card->dev' is initialized once and is never cleared. Drop the unnecessary "safety" check, as it simply obscures things, and we don't do this check everywhere (and therefore it's not really "safe"). Signed-off-by: Brian Norris --- new in v2 --- drivers/net/wireless/marvell/mwifiex/pcie.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/drivers/net/wireless/marvell/mwifiex/pcie.c b/drivers/net/wireless/marvell/mwifiex/pcie.c index a1907e8e620f..1993b9b339df 100644 --- a/drivers/net/wireless/marvell/mwifiex/pcie.c +++ b/drivers/net/wireless/marvell/mwifiex/pcie.c @@ -2958,15 +2958,12 @@ static void mwifiex_cleanup_pcie(struct mwifiex_adapter *adapter) "Failed to write driver not-ready signature\n"); } - if (pdev) { - pci_disable_device(pdev); + pci_disable_device(pdev); - pci_iounmap(pdev, card->pci_mmap); - pci_iounmap(pdev, card->pci_mmap1); - pci_disable_device(pdev); - pci_release_region(pdev, 2); - pci_release_region(pdev, 0); - } + pci_iounmap(pdev, card->pci_mmap); + pci_iounmap(pdev, card->pci_mmap1); + pci_release_region(pdev, 2); + pci_release_region(pdev, 0); mwifiex_pcie_free_buffers(adapter); }