lkml.org 
[lkml]   [2024]   [May]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Date
    Subject[PATCH v4 09/12] PCI: imx6: Consolidate redundant if-checks
    Consolidated redundant if-checks pertaining to imx_pcie->phy. Instead of
    two separate checks, merged them into one to improve code readability.

    if (imx_pcie->phy) {
    ... code 1
    }

    if (imx_pcie->phy) {
    ... code 2
    }

    Merge into one if block.

    if (imx_pcie->phy) {
    ... code 1
    ... code 2
    }

    Reviewed-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
    Signed-off-by: Frank Li <Frank.Li@nxp.com>
    ---
    drivers/pci/controller/dwc/pci-imx6.c | 2 --
    1 file changed, 2 deletions(-)

    diff --git a/drivers/pci/controller/dwc/pci-imx6.c b/drivers/pci/controller/dwc/pci-imx6.c
    index 66573ef7a002b..9d53b545540c6 100644
    --- a/drivers/pci/controller/dwc/pci-imx6.c
    +++ b/drivers/pci/controller/dwc/pci-imx6.c
    @@ -1033,9 +1033,7 @@ static int imx_pcie_host_init(struct dw_pcie_rp *pp)
    dev_err(dev, "pcie PHY power up failed\n");
    goto err_clk_disable;
    }
    - }

    - if (imx_pcie->phy) {
    ret = phy_power_on(imx_pcie->phy);
    if (ret) {
    dev_err(dev, "waiting for PHY ready timeout!\n");
    --
    2.34.1


    \
     
     \ /
      Last update: 2024-05-27 18:19    [W:3.606 / U:0.012 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site