mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Pavel Roskin <proski@gnu.org>
To: linux <linux-kernel@vger.kernel.org>
Subject: [PATCH] modules: fix sparse warning for every MODULE_PARM
Date: Thu, 13 Oct 2005 17:38:44 -0400	[thread overview]
Message-ID: <1129239524.21926.15.camel@dv> (raw)

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


                 reply	other threads:[~2005-10-13 21:38 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1129239524.21926.15.camel@dv \
    --to=proski@gnu.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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