* [PATCH] modules: fix sparse warning for every MODULE_PARM
@ 2005-10-13 21:38 Pavel Roskin
0 siblings, 0 replies; only message in thread
From: Pavel Roskin @ 2005-10-13 21:38 UTC (permalink / raw)
To: linux
sparse complains about every MODULE_PARM used in a module:
warning: symbol '__parm_foo' was not declared. Should it be static?
The fix is to split declaration and initialization. While MODULE_PARM
is obsolete, it's not something sparse should report.
Signed-off-by: Pavel Roskin <proski@gnu.org>
diff --git a/include/linux/module.h b/include/linux/module.h
index f05372b..84d75f3 100644
--- a/include/linux/module.h
+++ b/include/linux/module.h
@@ -554,7 +554,9 @@ static inline void MODULE_PARM_(void) {
#ifdef MODULE
/* DEPRECATED: Do not use. */
#define MODULE_PARM(var,type) \
-struct obsolete_modparm __parm_##var __attribute__((section("__obsparm"))) = \
+extern struct obsolete_modparm __parm_##var \
+__attribute__((section("__obsparm"))); \
+struct obsolete_modparm __parm_##var = \
{ __stringify(var), type, &MODULE_PARM_ }; \
__MODULE_PARM_TYPE(var, type);
#else
--
Regards,
Pavel Roskin
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2005-10-13 21:38 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-10-13 21:38 [PATCH] modules: fix sparse warning for every MODULE_PARM Pavel Roskin
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome