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: <CAD=FV=Xsg3Fs8XQ0piBYKGSYOhuGXyKpoJ5dbtGPdP5HU+2RyQ@mail.gmail.com>
Date: Mon, 5 Feb 2024 10:11:06 -0800
From: Doug Anderson <dianders@...omium.org>
To: Markus Elfring <Markus.Elfring@....de>
Cc: dri-devel@...ts.freedesktop.org, kernel-janitors@...r.kernel.org, 
	Daniel Vetter <daniel@...ll.ch>, David Airlie <airlied@...il.com>, John Stultz <jstultz@...gle.com>, 
	Laurent Pinchart <Laurent.pinchart@...asonboard.com>, 
	Maarten Lankhorst <maarten.lankhorst@...ux.intel.com>, Maxime Ripard <mripard@...nel.org>, 
	Sumit Semwal <sumit.semwal@...aro.org>, Thomas Zimmermann <tzimmermann@...e.de>, 
	Tian Tao <tiantao6@...ilicon.com>, 
	Uwe Kleine-König <u.kleine-koenig@...gutronix.de>, 
	Xinliang Liu <xinliang.liu@...aro.org>, Xinwei Kong <kong.kongxinwei@...ilicon.com>, 
	Yongqin Liu <yongqin.liu@...aro.org>, LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] drm/hisilicon: Use devm_platform_get_and_ioremap_resource()
 in dsi_parse_dt()

Hi,

On Mon, Feb 5, 2024 at 12:13 AM Markus Elfring <Markus.Elfring@....de> wrote:
>
> From: Markus Elfring <elfring@...rs.sourceforge.net>
> Date: Mon, 5 Feb 2024 08:58:21 +0100
>
> A wrapper function is available since the commit 890cc39a879906b63912482dfc41944579df2dc6
> ("drivers: provide devm_platform_get_and_ioremap_resource()").
> Thus reuse existing functionality instead of keeping duplicate source code.
>
> This issue was detected by using the Coccinelle software.
>
> Signed-off-by: Markus Elfring <elfring@...rs.sourceforge.net>
> ---
>  drivers/gpu/drm/hisilicon/kirin/dw_drm_dsi.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/hisilicon/kirin/dw_drm_dsi.c b/drivers/gpu/drm/hisilicon/kirin/dw_drm_dsi.c
> index 566de4658719..1edf429c49d7 100644
> --- a/drivers/gpu/drm/hisilicon/kirin/dw_drm_dsi.c
> +++ b/drivers/gpu/drm/hisilicon/kirin/dw_drm_dsi.c
> @@ -834,8 +834,7 @@ static int dsi_parse_dt(struct platform_device *pdev, struct dw_dsi *dsi)
>                 return PTR_ERR(ctx->pclk);
>         }
>
> -       res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> -       ctx->base = devm_ioremap_resource(&pdev->dev, res);
> +       ctx->base = devm_platform_get_and_ioremap_resource(pdev, 0, &res);
>         if (IS_ERR(ctx->base)) {
>                 DRM_ERROR("failed to remap dsi io region\n");
>                 return PTR_ERR(ctx->base);

This function no longer needs the local variable "res". Remove it and
then change the function call to devm_platform_ioremap_resource().
With that:

Reviewed-by: Douglas Anderson <dianders@...omium.org>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ