Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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>

+2 -2
+2 -2
include/linux/module.h
··· 249 249 #ifdef MODULE 250 250 /* Creates an alias so file2alias.c can find device table. */ 251 251 #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)))) 254 254 #else /* !MODULE */ 255 255 #define MODULE_DEVICE_TABLE(type, name) 256 256 #endif