lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Thu, 23 Mar 2023 07:23:26 +0100
From:   Sergio Paracuellos <sergio.paracuellos@...il.com>
To:     ye.xingchen@....com.cn
Cc:     lpieralisi@...nel.org, kw@...ux.com, robh@...nel.org,
        bhelgaas@...gle.com, matthias.bgg@...il.com,
        angelogioacchino.delregno@...labora.com, linux-pci@...r.kernel.org,
        linux-kernel@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
        linux-mediatek@...ts.infradead.org
Subject: Re: [PATCH] PCI: mt7621: Use dev_err_probe()

Hi,

On Thu, Mar 23, 2023 at 4:45 AM <ye.xingchen@....com.cn> wrote:
>
> From: Ye Xingchen <ye.xingchen@....com.cn>
>
> Replace the open-code with dev_err_probe() to simplify the code.
>
> Signed-off-by: Ye Xingchen <ye.xingchen@....com.cn>
> ---
>  drivers/pci/controller/pcie-mt7621.c | 7 +++----
>  1 file changed, 3 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/pci/controller/pcie-mt7621.c b/drivers/pci/controller/pcie-mt7621.c
> index 63a5f4463a9f..964de0e8c6a0 100644
> --- a/drivers/pci/controller/pcie-mt7621.c
> +++ b/drivers/pci/controller/pcie-mt7621.c
> @@ -220,10 +220,9 @@ static int mt7621_pcie_parse_port(struct mt7621_pcie *pcie,
>         }
>
>         port->pcie_rst = of_reset_control_get_exclusive(node, NULL);
> -       if (PTR_ERR(port->pcie_rst) == -EPROBE_DEFER) {
> -               dev_err(dev, "failed to get pcie%d reset control\n", slot);
> -               return PTR_ERR(port->pcie_rst);
> -       }
> +
> +       return dev_err_probe(dev, PTR_ERR(port->pcie_rst),
> +                            "failed to get pcie%d reset control\n", slot);
>
>         snprintf(name, sizeof(name), "pcie-phy%d", slot);
>         port->phy = devm_of_phy_get(dev, node, name);

So this code is unreachable now. Please fix your tools.

> --
> 2.25.1

Also, this is not a probe(), so I don't see a point of using
dev_err_probe() here.

Thanks,
    Sergio Paracuellos

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ