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]
Message-ID: <6k6hghic2ay277jg5tddihqal2i2fta2aam2du6dbjqq4whcjh@lilojqbwgnsx>
Date: Thu, 29 Aug 2024 13:06:56 +0300
From: Dmitry Baryshkov <dmitry.baryshkov@...aro.org>
To: Jinjie Ruan <ruanjinjie@...wei.com>
Cc: robdclark@...il.com, quic_abhinavk@...cinc.com, sean@...rly.run, 
	marijn.suijten@...ainline.org, airlied@...il.com, daniel@...ll.ch, 
	linux-arm-msm@...r.kernel.org, dri-devel@...ts.freedesktop.org, freedreno@...ts.freedesktop.org, 
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH -next] drm/msm: Use
 devm_platform_ioremap_resource_byname()

On Wed, Aug 28, 2024 at 04:48:49PM GMT, Jinjie Ruan wrote:
> platform_get_resource_byname() and devm_ioremap_resource() can be
> replaced by devm_platform_ioremap_resource_byname(), which can
> simplify the code logic a bit, No functional change here.

NAK.

platform_get_resource_byname gets mdss_pdev, while devm_ function
uses pdev->dev. Passing mdss_pdev to
devm_platform_ioremap_resource_byname() means that the resource will get
lifetime management attached to the lifecycle of the other driver.

> 
> Signed-off-by: Jinjie Ruan <ruanjinjie@...wei.com>
> ---
>  drivers/gpu/drm/msm/msm_io_utils.c | 8 +-------
>  1 file changed, 1 insertion(+), 7 deletions(-)
> 
> diff --git a/drivers/gpu/drm/msm/msm_io_utils.c b/drivers/gpu/drm/msm/msm_io_utils.c
> index afedd61c3e28..6f7933f01ae6 100644
> --- a/drivers/gpu/drm/msm/msm_io_utils.c
> +++ b/drivers/gpu/drm/msm/msm_io_utils.c
> @@ -54,13 +54,7 @@ void __iomem *msm_ioremap_mdss(struct platform_device *mdss_pdev,
>  			       struct platform_device *pdev,
>  			       const char *name)
>  {
> -	struct resource *res;
> -
> -	res = platform_get_resource_byname(mdss_pdev, IORESOURCE_MEM, name);
> -	if (!res)
> -		return ERR_PTR(-EINVAL);
> -
> -	return devm_ioremap_resource(&pdev->dev, res);
> +	return devm_platform_ioremap_resource_byname(mdss_pdev, name);
>  }
>  
>  static void __iomem *_msm_ioremap(struct platform_device *pdev, const char *name,
> -- 
> 2.34.1
> 

-- 
With best wishes
Dmitry

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ