public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] MODULE_PARM must die: make it warn first.
@ 2004-10-20  7:42 Rusty Russell
  0 siblings, 0 replies; only message in thread
From: Rusty Russell @ 2004-10-20  7:42 UTC (permalink / raw)
  To: Andrew Morton; +Cc: lkml - Kernel Mailing List

Name: Warn on use of MODULE_PARM
Status: Trivial
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>

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

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
--- .22800-linux-2.6-bk/include/linux/module.h	2004-10-20 15:15:30.000000000 +1000
+++ .22800-linux-2.6-bk.updated/include/linux/module.h	2004-10-20 17:11:39.000000000 +1000
@@ -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)

-- 
Anyone who quotes me in their signature is an idiot -- Rusty Russell


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2004-10-20  8:03 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-10-20  7:42 [PATCH 1/2] MODULE_PARM must die: make it warn first Rusty Russell

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox