From patchwork Sun Jun 28 14:52:16 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: SF Markus Elfring X-Patchwork-Id: 6686431 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 6B790C05AC for ; Sun, 28 Jun 2015 14:55:15 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 72775205C1 for ; Sun, 28 Jun 2015 14:55:14 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id A5622205BE for ; Sun, 28 Jun 2015 14:55:13 +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 1Z9Dwz-0004LB-4t; Sun, 28 Jun 2015 14:52:53 +0000 Received: from mout.web.de ([212.227.17.11]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Z9Dwv-0004Is-PO for linux-arm-kernel@lists.infradead.org; Sun, 28 Jun 2015 14:52:50 +0000 Received: from [192.168.1.2] ([78.49.227.64]) by smtp.web.de (mrweb102) with ESMTPSA (Nemesis) id 0M2dg1-1YtDE72gk9-00sOx1; Sun, 28 Jun 2015 16:52:18 +0200 Message-ID: <55900A20.5070407@users.sourceforge.net> Date: Sun, 28 Jun 2015 16:52:16 +0200 From: SF Markus Elfring User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 To: Bjorn Helgaas , Ray Jui , Scott Branden , linux-pci@vger.kernel.org, linux-arm-kernel@lists.infradead.org, bcm-kernel-feedback-list@broadcom.com Subject: [PATCH] PCI-iproc: Delete unnecessary checks before two function calls References: <5307CAA2.8060406@users.sourceforge.net> <530A086E.8010901@users.sourceforge.net> <530A72AA.3000601@users.sourceforge.net> <530B5FB6.6010207@users.sourceforge.net> <530C5E18.1020800@users.sourceforge.net> <530CD2C4.4050903@users.sourceforge.net> <530CF8FF.8080600@users.sourceforge.net> <530DD06F.4090703@users.sourceforge.net> <5317A59D.4@users.sourceforge.net> In-Reply-To: <5317A59D.4@users.sourceforge.net> X-Provags-ID: V03:K0:uhXOqQjDxWWyvWC14+TiFYEPjk4Nf0MdcGEEs3autNI5OZ7rJ3k GJJkjXQjEotHcLBxFOZGspnNqiwgH63dXBl3HdVPEXG6EMx2v6RiqMOK0VpeTbtL8AsOXhT kg3wLKEYH33LMRwmm2cvmrurfLXDwhy6p0fHFPxmY9YMkhEoJzTgxHizX1hKSkeWLeOc6UN jm367NECGZxDzNACbmckA== X-UI-Out-Filterresults: notjunk:1; V01:K0:M0dO/atJ3jk=:xqzBJRWKSN6RryXTDCiEKD H3+CKFz/h5zGeCcYt/IdkMXN/SirsCpZZNKkUzuIuGud9pa4fHM0PO2R6qW1CO4WOy3Nba9Ae im7352tnAURZJ8Ek44+jBpnGVds+gEv0AsOe6EZzFRu2AM7XokpceBravwXjelJGBw3XUToiy IrHGFyvtVmGcNR7Smpl3UBYpPIXTu/VH6k9VJfuGRET9qWm5vUE/vXey4pfRd2hARo8Up3lBr GUTieVeAH1S0nQJ4nRKjN2TRkzRuL91fu3WD4air5QNlKq3H3zO1NpK6u2QBw40RscCbOxNIF 324jYgQxcSFa8NF6xgzCmHqS94vkIZKfYOZFuSUUmilA1IIQZ663SmzEt62GFDKW5ugghHqX0 ISxXYbxHzI6/T9PtTosSUOOb+R099jc/yjazzCuZ1pUOsxEzzG6gcYHhomTNvqhWFpD84+B4U RkrnACoFh1MIIXZ+C5BD8LHp46RT2/15AsMRzW9l6zEOfZ299bRus/KCucmcKkPG6jxqnTI4h 5YYmeEiOdev3X8JrIEsa+WH0SRDpDncw+bn/FsWG4GekN4hqMXJNVe5NpgG/KbxNYZdPGJS5u XyrPNXrYRMwzGLtH20g0adVFuNLtysnEQahzTYWemLYrMbB+q3mBbPHE1Ft55azI0sHtZvj3l ZimBDOyEEp4P59hnSxXVRSBlZJWpm8twJd7ELOWp65x1sKBW4nW3hLsMp9AkJNwbhCek= X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150628_075250_213815_EA12FDF2 X-CRM114-Status: GOOD ( 11.44 ) X-Spam-Score: -1.9 (-) Cc: Hauke Mehrtens , kernel-janitors@vger.kernel.org, LKML , Julia Lawall X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable 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: Markus Elfring Date: Sun, 28 Jun 2015 16:42:04 +0200 The functions phy_exit() and phy_power_off() test whether their argument is NULL and then return immediately. Thus the test around the calls is not needed. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring --- drivers/pci/host/pcie-iproc.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/drivers/pci/host/pcie-iproc.c b/drivers/pci/host/pcie-iproc.c index d77481e..f875821 100644 --- a/drivers/pci/host/pcie-iproc.c +++ b/drivers/pci/host/pcie-iproc.c @@ -239,12 +239,9 @@ err_rm_root_bus: pci_remove_root_bus(bus); err_power_off_phy: - if (pcie->phy) - phy_power_off(pcie->phy); + phy_power_off(pcie->phy); err_exit_phy: - if (pcie->phy) - phy_exit(pcie->phy); - + phy_exit(pcie->phy); return ret; } EXPORT_SYMBOL(iproc_pcie_setup);