Skip to content

Commit

Permalink
module: do not hide __modver_version_show declaration behind ifdef
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Dmitry Torokhov authored and Rusty Russell committed May 19, 2011
1 parent b4bc842 commit 9b73a58
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions include/linux/module.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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 = { \
Expand Down

0 comments on commit 9b73a58

Please sign in to comment.