Skip to content

Commit

Permalink
[PATCH] modules: fix sparse warning for every MODULE_PARM
Browse files Browse the repository at this point in the history
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>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
  • Loading branch information
Pavel Roskin authored and Linus Torvalds committed Oct 31, 2005
1 parent c4dd0e4 commit 52303e8
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion include/linux/module.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 52303e8

Please sign in to comment.