aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorMasahiro Yamada <masahiroy@kernel.org>2025-06-02 19:55:36 +0900
committerMasahiro Yamada <masahiroy@kernel.org>2025-06-06 05:40:25 +0900
commit8c21c4111128365f81a88573eeb2844fa696b299 (patch)
treeb5be722eeb7401a29e9c15b4f3b290d5f1d060d4 /include
parentscripts/misc-check: check unnecessary #include <linux/export.h> when W=1 (diff)
downloadlinux-rng-8c21c4111128365f81a88573eeb2844fa696b299.tar.xz
linux-rng-8c21c4111128365f81a88573eeb2844fa696b299.zip
module: make __mod_device_table__* symbols static
The __mod_device_table__* symbols are only parsed by modpost to generate MODULE_ALIAS() entries from MODULE_DEVICE_TABLE(). Therefore, these symbols do not need to be globally visible, or globally unique. If they are in the global scope, we would worry about the symbol uniqueness, but modpost is fine with parsing multiple symbols with the same name. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org> Reviewed-by: Petr Pavlu <petr.pavlu@suse.com>
Diffstat (limited to 'include')
-rw-r--r--include/linux/module.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/include/linux/module.h b/include/linux/module.h
index 8050f77c3b64..92e1420fccdf 100644
--- a/include/linux/module.h
+++ b/include/linux/module.h
@@ -249,8 +249,8 @@ struct module_kobject *lookup_or_create_module_kobject(const char *name);
#ifdef MODULE
/* Creates an alias so file2alias.c can find device table. */
#define MODULE_DEVICE_TABLE(type, name) \
-extern typeof(name) __mod_device_table__##type##__##name \
- __attribute__ ((unused, alias(__stringify(name))))
+static typeof(name) __mod_device_table__##type##__##name \
+ __attribute__ ((used, alias(__stringify(name))))
#else /* !MODULE */
#define MODULE_DEVICE_TABLE(type, name)
#endif