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]
Message-ID: <27a0d076-ed61-486b-b961-8a0982e7b96d@gmail.com>
Date: Mon, 2 Sep 2024 08:29:01 -0700
From: Florian Fainelli <f.fainelli@...il.com>
To: Jinjie Ruan <ruanjinjie@...wei.com>, woojung.huh@...rochip.com,
 andrew@...n.ch, olteanv@...il.com, davem@...emloft.net, edumazet@...gle.com,
 kuba@...nel.org, pabeni@...hat.com, linus.walleij@...aro.org,
 alsi@...g-olufsen.dk, justin.chen@...adcom.com,
 sebastian.hesselbarth@...il.com, alexandre.torgue@...s.st.com,
 joabreu@...opsys.com, mcoquelin.stm32@...il.com, wens@...e.org,
 jernej.skrabec@...il.com, samuel@...lland.org, hkallweit1@...il.com,
 linux@...linux.org.uk, UNGLinuxDriver@...rochip.com, netdev@...r.kernel.org,
 bcm-kernel-feedback-list@...adcom.com, linux-arm-kernel@...ts.infradead.org,
 linux-sunxi@...ts.linux.dev, linux-stm32@...md-mailman.stormreply.com,
 krzk@...nel.org, jic23@...nel.org
Subject: Re: [PATCH net-next v4 5/8] net: mdio: mux-mmioreg: Simplified with
 dev_err_probe()



On 8/29/2024 8:13 PM, Jinjie Ruan wrote:
> Use the dev_err_probe() helper to simplify code.
> 
> Reviewed-by: Jonathan Cameron <Jonathan.Cameron@...wei.com>
> Signed-off-by: Jinjie Ruan <ruanjinjie@...wei.com>
> ---
> v4:
> - Remove the extra parentheses.
> v3:
> - Add Reviewed-by.
> v2:
> - Split into 2 patches.
> ---
>   drivers/net/mdio/mdio-mux-mmioreg.c | 48 ++++++++++++-----------------
>   1 file changed, 20 insertions(+), 28 deletions(-)
> 
> diff --git a/drivers/net/mdio/mdio-mux-mmioreg.c b/drivers/net/mdio/mdio-mux-mmioreg.c
> index 4d87e61fec7b..b70e6d1ad429 100644
> --- a/drivers/net/mdio/mdio-mux-mmioreg.c
> +++ b/drivers/net/mdio/mdio-mux-mmioreg.c
> @@ -109,30 +109,25 @@ static int mdio_mux_mmioreg_probe(struct platform_device *pdev)
>   		return -ENOMEM;
>   
>   	ret = of_address_to_resource(np, 0, &res);
> -	if (ret) {
> -		dev_err(&pdev->dev, "could not obtain memory map for node %pOF\n",
> -			np);
> -		return ret;
> -	}
> +	if (ret)
> +		return dev_err_probe(&pdev->dev, ret,
> +				     "could not obtain memory map for node %pOF\n", np);

Besides that one, which I don't think is even a candidate for resource 
deferral in the first place given the OF platform implementation, it 
does not seem to help that much to switch to dev_err_probe() other than 
just combining the error message and return code in a single statement. 
So it's fewer lines of codes, but it is not exactly what dev_err_probe() 
was originally intended for IMHO.

Reviewed-by: Florian Fainelli <florian.fainelli@...adcom.com>
-- 
Florian


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ