summaryrefslogtreecommitdiffstats
path: root/kernel/module.c
diff options
context:
space:
mode:
authorWANG Cong <xiyou.wangcong@gmail.com>2008-07-24 15:41:48 +0100
committerRusty Russell <rusty@rustcorp.com.au>2008-07-28 12:16:28 +1000
commit15bba37d62351749c3915add81f673b256952ee1 (patch)
tree4696ad74ea04df9f3b7091859225ecc123be7197 /kernel/module.c
parent837b41b5de356aa67abb2cadb5eef3efc7776f91 (diff)
downloadop-kernel-dev-15bba37d62351749c3915add81f673b256952ee1.zip
op-kernel-dev-15bba37d62351749c3915add81f673b256952ee1.tar.gz
module: fix build warning with !CONFIG_KALLSYMS
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>
Diffstat (limited to 'kernel/module.c')
-rw-r--r--kernel/module.c25
1 files changed, 13 insertions, 12 deletions
diff --git a/kernel/module.c b/kernel/module.c
index d8b5605..d861bd5 100644
--- a/kernel/module.c
+++ b/kernel/module.c
@@ -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)
{
@@ -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))
OpenPOWER on IntegriCloud