From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752903AbbF2Qp0 (ORCPT ); Mon, 29 Jun 2015 12:45:26 -0400 Received: from mail-gw3-out.broadcom.com ([216.31.210.64]:58279 "EHLO mail-gw3-out.broadcom.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752770AbbF2QpQ (ORCPT ); Mon, 29 Jun 2015 12:45:16 -0400 X-IronPort-AV: E=Sophos;i="5.15,699,1432623600"; d="scan'208";a="68511724" Message-ID: <5591761A.9000607@broadcom.com> Date: Mon, 29 Jun 2015 09:45:14 -0700 From: Ray Jui User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 To: SF Markus Elfring , Bjorn Helgaas , Scott Branden , , , CC: LKML , , Hauke Mehrtens , Julia Lawall Subject: Re: [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> <55900A20.5070407@users.sourceforge.net> In-Reply-To: <55900A20.5070407@users.sourceforge.net> Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Markus, On 6/28/2015 7:52 AM, SF Markus Elfring wrote: > 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); > Thanks for catching this. Could you please help to make similar changes to both phy_init and phy_power_on calls in the driver, to make it consistent? Thanks, Ray