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: <20200323160612.17277-6-zhengdejin5@gmail.com>
Date:   Tue, 24 Mar 2020 00:06:12 +0800
From:   Dejin Zheng <zhengdejin5@...il.com>
To:     gregkh@...uxfoundation.org, rafael@...nel.org, hminas@...opsys.com,
        mathias.nyman@...el.com, bgolaszewski@...libre.com, arnd@...db.de,
        geert+renesas@...der.be, tomas.winkler@...el.com,
        tglx@...utronix.de, hdegoede@...hat.com, treding@...dia.com,
        suzuki.poulose@....com
Cc:     linux-usb@...r.kernel.org, linux-kernel@...r.kernel.org,
        Dejin Zheng <zhengdejin5@...il.com>,
        Geert Uytterhoeven <geert@...ux-m68k.org>
Subject: [PATCH v4 5/5] driver core: platform: Reimplement devm_platform_ioremap_resource

Reimplement devm_platform_ioremap_resource() by calling
devm_platform_ioremap_and_get_resource() with res = NULL to
simplify the code.

Suggested-by: Geert Uytterhoeven <geert@...ux-m68k.org>
Reviewed-by: Geert Uytterhoeven <geert+renesas@...der.be>
Signed-off-by: Dejin Zheng <zhengdejin5@...il.com>
---
v3 -> v4:
	- modified this patch's commit comment.
v2 -> v3:
	- add this patch to simplify the code by Geert's suggestion.

 drivers/base/platform.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/drivers/base/platform.c b/drivers/base/platform.c
index 3e8a9fb91dcd..16b54ebc6958 100644
--- a/drivers/base/platform.c
+++ b/drivers/base/platform.c
@@ -95,10 +95,7 @@ EXPORT_SYMBOL_GPL(devm_platform_get_and_ioremap_resource);
 void __iomem *devm_platform_ioremap_resource(struct platform_device *pdev,
 					     unsigned int index)
 {
-	struct resource *res;
-
-	res = platform_get_resource(pdev, IORESOURCE_MEM, index);
-	return devm_ioremap_resource(&pdev->dev, res);
+	return devm_platform_get_and_ioremap_resource(pdev, index, NULL);
 }
 EXPORT_SYMBOL_GPL(devm_platform_ioremap_resource);
 
-- 
2.25.0

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ