From: Pavel Roskin Date: Sun, 30 Oct 2005 23:03:03 +0000 (-0800) Subject: [PATCH] modules: fix sparse warning for every MODULE_PARM X-Git-Tag: v2.6.15-rc1~59^2~15^2~56 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=52303e8b5f8aa234865d40d76ea16b0ff4b27022;p=linux-2.6 [PATCH] modules: fix sparse warning for every MODULE_PARM 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 Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/include/linux/module.h b/include/linux/module.h index f05372b7fe..84d75f3a8a 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