Skip to contentSkip to conversation

Fix for MODULE_PARM obsolete

PATCH Rusty Russell 2 participants 3 messages Oct 21, 2004 Module support

lore
Share & tools
lore
#0 lore raw

Name: Fix MODULE_PARM warning
Status: Trivial
Depends: Module/MODULE_PARM-warning.patch.gz

There is no __attribute_unused__: use __attribute__((__unused__)).

include/linux/module.h +1 -1
diff -urpN --exclude TAGS -X /home/rusty/devel/kernel/kernel-patches/current-dontdiff --minimal .16175-linux-2.6-bk/include/linux/module.h .16175-linux-2.6-bk.updated/include/linux/module.h
@@ -570,7 +570,7 @@ extern void __deprecated MODULE_PARM_(vo
 struct obsolete_modparm __parm_##var __attribute__((section("__obsparm"))) = \
 { __stringify(var), type, &MODULE_PARM_ };
 #else
-#define MODULE_PARM(var,type) static void __attribute_unused__ *__parm_##var = &MODULE_PARM_;
+#define MODULE_PARM(var,type) static void __attribute__((__unused__)) *__parm_##var = &MODULE_PARM_;
 #endif
 
 #define __MODULE_STRING(x) __stringify(x)
Signature · 1 line
Anyone who quotes me in their signature is an idiot -- Rusty Russell
#1 lore raw
Quoted 2 lines · Rusty Russell

There is no __attribute_unused__: use __attribute__((__unused__)).

Will that fix this?

/usr/src/25/drivers/acpi/tables/tbxfroot.c:168: undefined reference to MODULE_PARM_' drivers/built-in.o(.data+0x35dcc):/usr/src/25/drivers/acpi/tables/tbxfroot.c:168: undefined reference to MODULE_PARM_' drivers/built-in.o(.data+0x35dd0):/usr/src/25/drivers/acpi/tables/tbxfroot.c:168: undefined reference to MODULE_PARM_' drivers/built-in.o(.data+0x35dd4):/usr/src/25/drivers/acpi/tables/tbxfroot.c:168: undefined reference to MODULE_PARM_'
make: *** [.tmp_vmlinux1] Error 1

#2 lore raw
Quoted 7 lines · Andrew Morton
Quoted 2 lines · Rusty Russell

There is no __attribute_unused__: use __attribute__((__unused__)).

Will that fix this?

/usr/src/25/drivers/acpi/tables/tbxfroot.c:168: undefined reference to `MODULE_PARM_'

No, but this will. Tested on a tree which still has MODULE_PARM in it.

Name: Fixe MODULE_PARM warning
Status: Tested on 2.6-bk
Depends: Module/MODULE_PARM-warning.patch.gz

There is no __attribute_unused__: use __attribute__((__unused__)). Also, needs a real MODULE_PARM_ for when gcc doesn't throw it away for us.

include/linux/module.h +2 -2
diff -urpN --exclude TAGS -X /home/rusty/devel/kernel/kernel-patches/current-dontdiff --minimal .20741-linux-2.6-bk/include/linux/module.h .20741-linux-2.6-bk.updated/include/linux/module.h
@@ -563,14 +563,14 @@ struct obsolete_modparm {
 	void *addr;
 };
 
-extern void __deprecated MODULE_PARM_(void);
+static inline void __deprecated MODULE_PARM_(void) { }
 #ifdef MODULE
 /* DEPRECATED: Do not use. */
 #define MODULE_PARM(var,type)						    \
 struct obsolete_modparm __parm_##var __attribute__((section("__obsparm"))) = \
 { __stringify(var), type, &MODULE_PARM_ };
 #else
-#define MODULE_PARM(var,type) static void __attribute_unused__ *__parm_##var = &MODULE_PARM_;
+#define MODULE_PARM(var,type) static void __attribute__((__unused__)) *__parm_##var = &MODULE_PARM_;
 #endif
 
 #define __MODULE_STRING(x) __stringify(x)
Signature · 1 line
Anyone who quotes me in their signature is an idiot -- Rusty Russell