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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Mon, 26 Jun 2023 18:32:38 +0200
From:   Niklas Söderlund <niklas.soderlund@...natech.se>
To:     Yangtao Li <frank.li@...o.com>
Cc:     "Rafael J. Wysocki" <rafael@...nel.org>,
        Daniel Lezcano <daniel.lezcano@...aro.org>,
        Amit Kucheria <amitk@...nel.org>,
        Zhang Rui <rui.zhang@...el.com>,
        linux-renesas-soc@...r.kernel.org, linux-pm@...r.kernel.org,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH 5/6] thermal/drivers/rcar: Convert to
 devm_platform_ioremap_resource()

Hi Yangtao,

Thanks for your work.

On 2023-06-26 20:43:32 +0800, Yangtao Li wrote:
> Use devm_platform_ioremap_resource() to simplify code.
> 
> Signed-off-by: Yangtao Li <frank.li@...o.com>
> ---
>  drivers/thermal/rcar_thermal.c | 11 ++---------
>  1 file changed, 2 insertions(+), 9 deletions(-)
> 
> diff --git a/drivers/thermal/rcar_thermal.c b/drivers/thermal/rcar_thermal.c
> index b8571f7090aa..04a52d82022c 100644
> --- a/drivers/thermal/rcar_thermal.c
> +++ b/drivers/thermal/rcar_thermal.c
> @@ -397,7 +397,6 @@ static int rcar_thermal_probe(struct platform_device *pdev)
>  	struct rcar_thermal_common *common;
>  	struct rcar_thermal_priv *priv;
>  	struct device *dev = &pdev->dev;
> -	struct resource *res;
>  	const struct rcar_thermal_chip *chip = of_device_get_match_data(dev);
>  	int mres = 0;
>  	int i;
> @@ -435,9 +434,7 @@ static int rcar_thermal_probe(struct platform_device *pdev)
>  			 * Then, driver uses common registers
>  			 * rcar_has_irq_support() will be enabled
>  			 */
> -			res = platform_get_resource(pdev, IORESOURCE_MEM,
> -						    mres++);
> -			common->base = devm_ioremap_resource(dev, res);
> +			common->base = devm_platform_ioremap_resource(pdev, mres++);

This change is fine, please post a separate patch for it.

>  			if (IS_ERR(common->base)) {
>  				ret = PTR_ERR(common->base);
>  				goto error_unregister;
> @@ -459,17 +456,13 @@ static int rcar_thermal_probe(struct platform_device *pdev)
>  	}
>  
>  	for (i = 0;; i++) {
> -		res = platform_get_resource(pdev, IORESOURCE_MEM, mres++);
> -		if (!res)
> -			break;

This change is not OK as it changes the behavior of the driver same as 
in patch 5/6.

Nacked-by: Niklas Söderlund <niklas.soderlund@...natech.se>

> -
>  		priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL);
>  		if (!priv) {
>  			ret = -ENOMEM;
>  			goto error_unregister;
>  		}
>  
> -		priv->base = devm_ioremap_resource(dev, res);
> +		priv->base = devm_platform_ioremap_resource(pdev, mres++);
>  		if (IS_ERR(priv->base)) {
>  			ret = PTR_ERR(priv->base);
>  			goto error_unregister;
> -- 
> 2.39.0
> 

-- 
Kind Regards,
Niklas Söderlund

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ