From: Linus Torvalds Date: Sun, 22 Sep 2019 18:15:14 +0000 (-0700) Subject: modules: make MODULE_IMPORT_NS() work even when modular builds are disabled X-Git-Tag: Ubuntu-5.13.0-19.19~7623 X-Git-Url: https://git.proxmox.com/?a=commitdiff_plain;h=3e4d890a26d5411d0b64e5e8ecfdcdb435c1d3f8;p=mirror_ubuntu-jammy-kernel.git modules: make MODULE_IMPORT_NS() work even when modular builds are disabled It's an unusual configuration, and was apparently never tested, and not caught in linux-next because of a combination of travels and it making it into the tree too late. The fix is to simply move the #define to outside the CONFIG_MODULE section, since MODULE_INFO() will do the right thing. Cc: Martijn Coenen Cc: Greg Kroah-Hartman Cc: Matthias Maennich Cc: Jessica Yu Signed-off-by: Linus Torvalds --- diff --git a/include/linux/module.h b/include/linux/module.h index b3611e749f72..b1a67352d2dc 100644 --- a/include/linux/module.h +++ b/include/linux/module.h @@ -276,12 +276,12 @@ 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) + struct notifier_block; #ifdef CONFIG_MODULES -#define MODULE_IMPORT_NS(ns) MODULE_INFO(import_ns, #ns) - extern int modules_disabled; /* for sysctl */ /* Get/put a kernel symbol (calls must be symmetric) */ void *__symbol_get(const char *symbol);