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

module: remove MODULE_GENERIC_TABLE

MODULE_DEVICE_TABLE() calles MODULE_GENERIC_TABLE(); make it do the
work directly. This also removes a wart introduced in the last patch,
where the alias is defined to be an unknown struct type "struct
type##__##name##_device_id" instead of "struct type##_device_id" (it's
an extern so GCC doesn't care, but it's wrong).

The other user of MODULE_GENERIC_TABLE (ISAPNP_CARD_TABLE) is unused,
so delete it.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>

+8 -15
-4
include/linux/isapnp.h
··· 56 56 #define ISAPNP_DEVICE_ID(_va, _vb, _vc, _function) \ 57 57 { .vendor = ISAPNP_VENDOR(_va, _vb, _vc), .function = ISAPNP_FUNCTION(_function) } 58 58 59 - /* export used IDs outside module */ 60 - #define ISAPNP_CARD_TABLE(name) \ 61 - MODULE_GENERIC_TABLE(isapnp_card, name) 62 - 63 59 struct isapnp_card_id { 64 60 unsigned long driver_data; /* data private to the driver */ 65 61 unsigned short card_vendor, card_device;
+8 -11
include/linux/module.h
··· 82 82 void sort_main_extable(void); 83 83 void trim_init_extable(struct module *m); 84 84 85 - #ifdef MODULE 86 - #define MODULE_GENERIC_TABLE(gtype, name) \ 87 - extern const struct gtype##_id __mod_##gtype##_table \ 88 - __attribute__ ((unused, alias(__stringify(name)))) 89 - 90 - #else /* !MODULE */ 91 - #define MODULE_GENERIC_TABLE(gtype, name) 92 - #endif 93 - 94 85 /* Generic info of form tag = "info" */ 95 86 #define MODULE_INFO(tag, info) __MODULE_INFO(tag, tag, info) 96 87 ··· 132 141 /* What your module does. */ 133 142 #define MODULE_DESCRIPTION(_description) MODULE_INFO(description, _description) 134 143 135 - #define MODULE_DEVICE_TABLE(type, name) \ 136 - MODULE_GENERIC_TABLE(type##__##name##_device, name) 144 + #ifdef MODULE 145 + /* Creates an alias so file2alias.c can find device table. */ 146 + #define MODULE_DEVICE_TABLE(type, name) \ 147 + extern const struct type##_device_id __mod_##type##__##name##_device_table \ 148 + __attribute__ ((unused, alias(__stringify(name)))) 149 + #else /* !MODULE */ 150 + #define MODULE_DEVICE_TABLE(type, name) 151 + #endif 137 152 138 153 /* Version of form [<epoch>:]<version>[-<extra-version>]. 139 154 * Or for CVS/RCS ID version, everything but the number is stripped.