module: do not hide __modver_version_show declaration behind ifdef
authorDmitry Torokhov <dtor@vmware.com>
Tue, 8 Feb 2011 00:02:27 +0000 (16:02 -0800)
committerRusty Russell <rusty@rustcorp.com.au>
Thu, 19 May 2011 07:25:25 +0000 (16:55 +0930)
Doing so prevents the following warning from sparse:

  CHECK   kernel/params.c
kernel/params.c:817:9: warning: symbol '__modver_version_show' was not
declared. Should it be static?

since kernel/params.c is never compiled with MODULE being set.

Signed-off-by: Dmitry Torokhov <dtor@vmware.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
include/linux/module.h

index 4cfebc211695991801871035e221ca39d4555760..23996ad147e7a212159bfd7a01cdbf074f7be792 100644 (file)
@@ -64,6 +64,9 @@ struct module_version_attribute {
        const char *version;
 } __attribute__ ((__aligned__(sizeof(void *))));
 
+extern ssize_t __modver_version_show(struct module_attribute *,
+                                    struct module *, char *);
+
 struct module_kobject
 {
        struct kobject kobj;
@@ -172,8 +175,6 @@ extern struct module __this_module;
 #define MODULE_VERSION(_version) MODULE_INFO(version, _version)
 #else
 #define MODULE_VERSION(_version)                                       \
-       extern ssize_t __modver_version_show(struct module_attribute *, \
-                                            struct module *, char *);  \
        static struct module_version_attribute ___modver_attr = {       \
                .mattr  = {                                             \
                        .attr   = {                                     \