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] [day] [month] [year] [list]
Date:   Wed, 21 Jul 2021 17:34:13 +0300
From:   Laurentiu Tudor <laurentiu.tudor@....com>
To:     Tang Bin <tangbin@...s.chinamobile.com>, stuyoder@...il.com
Cc:     linux-kernel@...r.kernel.org,
        Zhang Shengju <zhangshengju@...s.chinamobile.com>
Subject: Re: [PATCH] bus: fsl-mc: fsl-mc-bus: Use
 devm_platform_ioremap_resource() to simplify code



On 7/20/2021 3:50 PM, Tang Bin wrote:
> Use devm_platform_ioremap_resource() instead of
> platform_get_resource() + devm_ioremap_resource().
> 
> Signed-off-by: Zhang Shengju <zhangshengju@...s.chinamobile.com>
> Signed-off-by: Tang Bin <tangbin@...s.chinamobile.com>
> ---
>  drivers/bus/fsl-mc/fsl-mc-bus.c | 9 +++------
>  1 file changed, 3 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/bus/fsl-mc/fsl-mc-bus.c b/drivers/bus/fsl-mc/fsl-mc-bus.c
> index 380ad1fdb745..472f0daf4271 100644
> --- a/drivers/bus/fsl-mc/fsl-mc-bus.c
> +++ b/drivers/bus/fsl-mc/fsl-mc-bus.c
> @@ -1080,12 +1080,9 @@ static int fsl_mc_bus_probe(struct platform_device *pdev)
>  
>  	platform_set_drvdata(pdev, mc);
>  
> -	plat_res = platform_get_resource(pdev, IORESOURCE_MEM, 1);
> -	if (plat_res) {
> -		mc->fsl_mc_regs = devm_ioremap_resource(&pdev->dev, plat_res);
> -		if (IS_ERR(mc->fsl_mc_regs))
> -			return PTR_ERR(mc->fsl_mc_regs);
> -	}
> +	mc->fsl_mc_regs = devm_platform_ioremap_resource(pdev, 1);
> +	if (IS_ERR(mc->fsl_mc_regs))
> +		return PTR_ERR(mc->fsl_mc_regs);

Thanks for the patch, but this is not ok as it alters the original
behavior. Not having region1 in the device tree is a valid scenario, see
binding [1] while not being able to read is an error. Your change treats
both cases as error.

[1]
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/devicetree/bindings/misc/fsl,qoriq-mc.txt#n58
---
Best Regards, Laurentiu

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ