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: <1559303690-8108-3-git-send-email-info@metux.net>
Date:   Fri, 31 May 2019 13:54:49 +0200
From:   "Enrico Weigelt, metux IT consult" <info@...ux.net>
To:     linux-kernel@...r.kernel.org
Cc:     axboe@...nel.dk, herbert@...dor.apana.org.au, davem@...emloft.net,
        linux-block@...r.kernel.org, linux-crypto@...r.kernel.org
Subject: [PATCH 2/3] drivers: block: xsysace: use MODULE_OF_TABLE() and of_match_ptr()

Using MODULE_OF_TABLE() and of_match_ptr() macros to get rid of
some #ifdef CONFIG_OF and thus make the code a bit slimmer.

These macros already check whether CONFIG_OF is set and if it's
not, just no-op. The compiler then should be able to optimize-
away unreferenced structs.

Signed-off-by: Enrico Weigelt, metux IT consult <info@...ux.net>
---
 drivers/block/xsysace.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/drivers/block/xsysace.c b/drivers/block/xsysace.c
index 464c9092..6ebd656 100644
--- a/drivers/block/xsysace.c
+++ b/drivers/block/xsysace.c
@@ -1219,7 +1219,6 @@ static int ace_remove(struct platform_device *dev)
 	return 0;
 }
 
-#if defined(CONFIG_OF)
 /* Match table for of_platform binding */
 static const struct of_device_id ace_of_match[] = {
 	{ .compatible = "xlnx,opb-sysace-1.00.b", },
@@ -1228,17 +1227,14 @@ static int ace_remove(struct platform_device *dev)
 	{ .compatible = "xlnx,sysace", },
 	{},
 };
-MODULE_DEVICE_TABLE(of, ace_of_match);
-#else /* CONFIG_OF */
-#define ace_of_match NULL
-#endif /* CONFIG_OF */
+MODULE_OF_TABLE(ace_of_match);
 
 static struct platform_driver ace_platform_driver = {
 	.probe = ace_probe,
 	.remove = ace_remove,
 	.driver = {
 		.name = "xsysace",
-		.of_match_table = ace_of_match,
+		.of_match_table = of_match_ptr(ace_of_match),
 	},
 };
 
-- 
1.9.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ