Skip to content

Commit

Permalink
module: fix build warning with !CONFIG_KALLSYMS
Browse files Browse the repository at this point in the history
This patch fixed the warning:

  CC      kernel/module.o
  /home/wangcong/Projects/linux-2.6/kernel/module.c:332: warning:
‘lookup_symbol’ defined but not used

Signed-off-by: WANG Cong <wangcong@zeuux.org>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
  • Loading branch information
WANG Cong authored and Rusty Russell committed Jul 28, 2008
1 parent 837b41b commit 15bba37
Showing 1 changed file with 13 additions and 12 deletions.
25 changes: 13 additions & 12 deletions kernel/module.c
Original file line number Diff line number Diff line change
Expand Up @@ -325,18 +325,6 @@ static unsigned long find_symbol(const char *name,
return -ENOENT;
}

/* lookup symbol in given range of kernel_symbols */
static const struct kernel_symbol *lookup_symbol(const char *name,
const struct kernel_symbol *start,
const struct kernel_symbol *stop)
{
const struct kernel_symbol *ks = start;
for (; ks < stop; ks++)
if (strcmp(ks->name, name) == 0)
return ks;
return NULL;
}

/* Search for module by name: must hold module_mutex. */
static struct module *find_module(const char *name)
{
Expand Down Expand Up @@ -1703,6 +1691,19 @@ static void setup_modinfo(struct module *mod, Elf_Shdr *sechdrs,
}

#ifdef CONFIG_KALLSYMS

/* lookup symbol in given range of kernel_symbols */
static const struct kernel_symbol *lookup_symbol(const char *name,
const struct kernel_symbol *start,
const struct kernel_symbol *stop)
{
const struct kernel_symbol *ks = start;
for (; ks < stop; ks++)
if (strcmp(ks->name, name) == 0)
return ks;
return NULL;
}

static int is_exported(const char *name, const struct module *mod)
{
if (!mod && lookup_symbol(name, __start___ksymtab, __stop___ksymtab))
Expand Down

0 comments on commit 15bba37

Please sign in to comment.