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: <10c0148d-696d-4601-8852-ee5bfea19602@web.de>
Date: Tue, 6 Feb 2024 20:02:44 +0100
From: Markus Elfring <Markus.Elfring@....de>
To: Douglas Anderson <dianders@...omium.org>,
 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>
Cc: LKML <linux-kernel@...r.kernel.org>
Subject: [PATCH v2] drm/hisilicon: Use devm_platform_ioremap_resource() in
 dsi_parse_dt()

From: Markus Elfring <elfring@...rs.sourceforge.net>
Date: Tue, 6 Feb 2024 19:51:25 +0100

A wrapper function is available since the commit 7945f929f1a77a1c8887a97ca07f87626858ff42
("drivers: provide devm_platform_ioremap_resource()").

* Thus reuse existing functionality instead of keeping duplicate source code.

* Delete a local variable which became unnecessary with this refactoring.


This issue was transformed by using the Coccinelle software.

Reviewed-by: Douglas Anderson <dianders@...omium.org>
Signed-off-by: Markus Elfring <elfring@...rs.sourceforge.net>
---

v2:
The transformation pattern was adjusted based on advices by known contributors.

Examples:
* Douglas Anderson
* Geert Uytterhoeven
* Robin Murphy


 drivers/gpu/drm/hisilicon/kirin/dw_drm_dsi.c | 4 +---
 1 file changed, 1 insertion(+), 3 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..6db6f355394c 100644
--- a/drivers/gpu/drm/hisilicon/kirin/dw_drm_dsi.c
+++ b/drivers/gpu/drm/hisilicon/kirin/dw_drm_dsi.c
@@ -826,7 +826,6 @@ static const struct component_ops dsi_ops = {
 static int dsi_parse_dt(struct platform_device *pdev, struct dw_dsi *dsi)
 {
 	struct dsi_hw_ctx *ctx = dsi->ctx;
-	struct resource *res;

 	ctx->pclk = devm_clk_get(&pdev->dev, "pclk");
 	if (IS_ERR(ctx->pclk)) {
@@ -834,8 +833,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_ioremap_resource(pdev, 0);
 	if (IS_ERR(ctx->base)) {
 		DRM_ERROR("failed to remap dsi io region\n");
 		return PTR_ERR(ctx->base);
--
2.43.0


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ