Skip to content

Commit 8c21c41

Browse files
committed
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 <[email protected]> Reviewed-by: Petr Pavlu <[email protected]>
1 parent 7d95680 commit 8c21c41

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

include/linux/module.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -249,8 +249,8 @@ struct module_kobject *lookup_or_create_module_kobject(const char *name);
249249
#ifdef MODULE
250250
/* Creates an alias so file2alias.c can find device table. */
251251
#define MODULE_DEVICE_TABLE(type, name) \
252-
extern typeof(name) __mod_device_table__##type##__##name \
253-
__attribute__ ((unused, alias(__stringify(name))))
252+
static typeof(name) __mod_device_table__##type##__##name \
253+
__attribute__ ((used, alias(__stringify(name))))
254254
#else /* !MODULE */
255255
#define MODULE_DEVICE_TABLE(type, name)
256256
#endif

0 commit comments

Comments
 (0)