* [PATCH] module.h: simplify MODULE_IMPORT_NS
@ 2022-04-27 9:03 Greg Kroah-Hartman
2022-04-28 22:59 ` Luis Chamberlain
0 siblings, 1 reply; 2+ messages in thread
From: Greg Kroah-Hartman @ 2022-04-27 9:03 UTC (permalink / raw)
To: linux-kernel
Cc: Greg Kroah-Hartman, Masahiro Yamada, Luis Chamberlain,
Jessica Yu, Matthias Maennich
In commit ca321ec74322 ("module.h: allow #define strings to work with
MODULE_IMPORT_NS") I fixed up the MODULE_IMPORT_NS() macro to allow
defined strings to work with it. Unfortunatly I did it in a two-stage
process, when it could just be done with the __stringify() macro as
pointed out by Masahiro Yamada.
Clean this up to only be one macro instead of two steps to achieve the
same end result.
Fixes: ca321ec74322 ("module.h: allow #define strings to work with MODULE_IMPORT_NS")
Reported-by: Masahiro Yamada <masahiroy@kernel.org>
Cc: Luis Chamberlain <mcgrof@kernel.org>
Cc: Jessica Yu <jeyu@kernel.org>
Cc: Matthias Maennich <maennich@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
include/linux/module.h | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/include/linux/module.h b/include/linux/module.h
index 1e135fd5c076..d5e9066990ca 100644
--- a/include/linux/module.h
+++ b/include/linux/module.h
@@ -290,8 +290,7 @@ extern typeof(name) __mod_##type##__##name##_device_table \
* files require multiple MODULE_FIRMWARE() specifiers */
#define MODULE_FIRMWARE(_firmware) MODULE_INFO(firmware, _firmware)
-#define _MODULE_IMPORT_NS(ns) MODULE_INFO(import_ns, #ns)
-#define MODULE_IMPORT_NS(ns) _MODULE_IMPORT_NS(ns)
+#define MODULE_IMPORT_NS(ns) MODULE_INFO(import_ns, __stringify(ns))
struct notifier_block;
--
2.36.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] module.h: simplify MODULE_IMPORT_NS
2022-04-27 9:03 [PATCH] module.h: simplify MODULE_IMPORT_NS Greg Kroah-Hartman
@ 2022-04-28 22:59 ` Luis Chamberlain
0 siblings, 0 replies; 2+ messages in thread
From: Luis Chamberlain @ 2022-04-28 22:59 UTC (permalink / raw)
To: Greg Kroah-Hartman
Cc: linux-kernel, Masahiro Yamada, Jessica Yu, Matthias Maennich
On Wed, Apr 27, 2022 at 11:03:21AM +0200, Greg Kroah-Hartman wrote:
> In commit ca321ec74322 ("module.h: allow #define strings to work with
> MODULE_IMPORT_NS") I fixed up the MODULE_IMPORT_NS() macro to allow
> defined strings to work with it. Unfortunatly I did it in a two-stage
> process, when it could just be done with the __stringify() macro as
> pointed out by Masahiro Yamada.
>
> Clean this up to only be one macro instead of two steps to achieve the
> same end result.
>
> Fixes: ca321ec74322 ("module.h: allow #define strings to work with MODULE_IMPORT_NS")
> Reported-by: Masahiro Yamada <masahiroy@kernel.org>
> Cc: Luis Chamberlain <mcgrof@kernel.org>
> Cc: Jessica Yu <jeyu@kernel.org>
> Cc: Matthias Maennich <maennich@google.com>
> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Thanks! Queued onto modules-testing. If no complaints come back I'll
move it to modules-next shortly after that.
Luis
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-04-28 22:59 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-27 9:03 [PATCH] module.h: simplify MODULE_IMPORT_NS Greg Kroah-Hartman
2022-04-28 22:59 ` Luis Chamberlain
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).