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: <3f092daad178f60e021784d3e398288e15fda4b6.camel@pengutronix.de>
Date:   Thu, 21 Apr 2022 11:00:17 +0200
From:   Jan Lübbe <jlu@...gutronix.de>
To:     cgel.zte@...il.com, bp@...en8.de, mchehab@...nel.org
Cc:     tony.luck@...el.com, james.morse@....com, rric@...nel.org,
        linux-edac@...r.kernel.org, linux-kernel@...r.kernel.org,
        Lv Ruyi <lv.ruyi@....com.cn>, Zeal Robot <zealci@....com.cn>
Subject: Re: [PATCH] edac: Make use of the helper function
 devm_platform_ioremap_resource()

On Thu, 2022-04-21 at 08:46 +0000, cgel.zte@...il.com wrote:
> From: Lv Ruyi <lv.ruyi@....com.cn>
> 
> Use the devm_platform_ioremap_resource() helper instead of calling
> platform_get_resource() and devm_ioremap_resource() separately.Make the
> code simpler without functional changes.
> 
> Reported-by: Zeal Robot <zealci@....com.cn>
> Signed-off-by: Lv Ruyi <lv.ruyi@....com.cn>

Reviewed-by: Jan Luebbe <jlu@...gutronix.de>

Thanks,
Jan

> ---
>  drivers/edac/armada_xp_edac.c | 18 ++----------------
>  1 file changed, 2 insertions(+), 16 deletions(-)
> 
> diff --git a/drivers/edac/armada_xp_edac.c b/drivers/edac/armada_xp_edac.c
> index b1f46a974b9e..038abbb83f4b 100644
> --- a/drivers/edac/armada_xp_edac.c
> +++ b/drivers/edac/armada_xp_edac.c
> @@ -286,17 +286,10 @@ static int axp_mc_probe(struct platform_device *pdev)
>  	struct edac_mc_layer layers[1];
>  	const struct of_device_id *id;
>  	struct mem_ctl_info *mci;
> -	struct resource *r;
>  	void __iomem *base;
>  	uint32_t config;
>  
> -	r = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> -	if (!r) {
> -		dev_err(&pdev->dev, "Unable to get mem resource\n");
> -		return -ENODEV;
> -	}
> -
> -	base = devm_ioremap_resource(&pdev->dev, r);
> +	base = devm_platform_ioremap_resource(pdev, 0);
>  	if (IS_ERR(base)) {
>  		dev_err(&pdev->dev, "Unable to map regs\n");
>  		return PTR_ERR(base);
> @@ -516,15 +509,8 @@ static int aurora_l2_probe(struct platform_device *pdev)
>  	const struct of_device_id *id;
>  	uint32_t l2x0_aux_ctrl;
>  	void __iomem *base;
> -	struct resource *r;
> -
> -	r = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> -	if (!r) {
> -		dev_err(&pdev->dev, "Unable to get mem resource\n");
> -		return -ENODEV;
> -	}
>  
> -	base = devm_ioremap_resource(&pdev->dev, r);
> +	base = devm_platform_ioremap_resource(pdev, 0);
>  	if (IS_ERR(base)) {
>  		dev_err(&pdev->dev, "Unable to map regs\n");
>  		return PTR_ERR(base);

-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ