Skip to contentSkip to conversation

MODULE_PARM must die: make it warn first.

PATCH New Rusty Russell 1 participant 1 message Oct 20, 2004 Module support

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 MODULE_PARM must die: make it warn first.

Name: Warn on use of MODULE_PARM
Status: Trivial

This patch adds a warning whenever MODULE_PARM is used. Successive patches change them over to module_param. Help appreciated!

include/linux/module.h +4 -2
diff -urpN --exclude TAGS -X /home/rusty/devel/kernel/kernel-patches/current-dontdiff --minimal .22800-linux-2.6-bk/include/linux/module.h .22800-linux-2.6-bk.updated/include/linux/module.h
@@ -562,13 +562,15 @@ struct obsolete_modparm {
 	char type[64-sizeof(void *)];
 	void *addr;
 };
+
+extern 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 };
+{ __stringify(var), type, &MODULE_PARM_ };
 #else
-#define MODULE_PARM(var,type)
+#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