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: <59412fc9-396d-4b62-95a8-1aed3d61cd0c@web.de>
Date: Tue, 6 Feb 2024 17:08:30 +0100
From: Markus Elfring <Markus.Elfring@....de>
To: linux-omap@...r.kernel.org, kernel-janitors@...r.kernel.org,
 Tony Lindgren <tony@...mide.com>
Cc: LKML <linux-kernel@...r.kernel.org>
Subject: [PATCH v2] bus: omap_l3_noc: Use devm_platform_ioremap_resource() in
 omap_l3_probe()

From: Markus Elfring <elfring@...rs.sourceforge.net>
Date: Tue, 6 Feb 2024 17:01: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.

Signed-off-by: Markus Elfring <elfring@...rs.sourceforge.net>
---

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

Examples:
* Doug Anderson
* Geert Uytterhoeven
* Robin Murphy


 drivers/bus/omap_l3_noc.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/bus/omap_l3_noc.c b/drivers/bus/omap_l3_noc.c
index eb1ba6319fda..f114dee4e937 100644
--- a/drivers/bus/omap_l3_noc.c
+++ b/drivers/bus/omap_l3_noc.c
@@ -255,16 +255,14 @@ static int omap_l3_probe(struct platform_device *pdev)

 	/* Get mem resources */
 	for (i = 0, res_idx = 0; i < l3->num_modules; i++) {
-		struct resource	*res;
-
 		if (l3->l3_base[i] == L3_BASE_IS_SUBMODULE) {
 			/* First entry cannot be submodule */
 			BUG_ON(i == 0);
 			l3->l3_base[i] = l3->l3_base[i - 1];
 			continue;
 		}
-		res = platform_get_resource(pdev, IORESOURCE_MEM, res_idx);
-		l3->l3_base[i] = devm_ioremap_resource(&pdev->dev, res);
+
+		l3->l3_base[i] = devm_platform_ioremap_resource(pdev, res_idx);
 		if (IS_ERR(l3->l3_base[i])) {
 			dev_err(l3->dev, "ioremap %d failed\n", i);
 			return PTR_ERR(l3->l3_base[i]);
--
2.43.0


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ