Commit 15bba37d62351749c3915add81f673b256952ee1
Committed by
Rusty Russell
1 parent
837b41b5de
Exists in
master
and in
20 other branches
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>
Showing 1 changed file with 13 additions and 12 deletions Side-by-side Diff
kernel/module.c
... | ... | @@ -325,18 +325,6 @@ |
325 | 325 | return -ENOENT; |
326 | 326 | } |
327 | 327 | |
328 | -/* lookup symbol in given range of kernel_symbols */ | |
329 | -static const struct kernel_symbol *lookup_symbol(const char *name, | |
330 | - const struct kernel_symbol *start, | |
331 | - const struct kernel_symbol *stop) | |
332 | -{ | |
333 | - const struct kernel_symbol *ks = start; | |
334 | - for (; ks < stop; ks++) | |
335 | - if (strcmp(ks->name, name) == 0) | |
336 | - return ks; | |
337 | - return NULL; | |
338 | -} | |
339 | - | |
340 | 328 | /* Search for module by name: must hold module_mutex. */ |
341 | 329 | static struct module *find_module(const char *name) |
342 | 330 | { |
... | ... | @@ -1703,6 +1691,19 @@ |
1703 | 1691 | } |
1704 | 1692 | |
1705 | 1693 | #ifdef CONFIG_KALLSYMS |
1694 | + | |
1695 | +/* lookup symbol in given range of kernel_symbols */ | |
1696 | +static const struct kernel_symbol *lookup_symbol(const char *name, | |
1697 | + const struct kernel_symbol *start, | |
1698 | + const struct kernel_symbol *stop) | |
1699 | +{ | |
1700 | + const struct kernel_symbol *ks = start; | |
1701 | + for (; ks < stop; ks++) | |
1702 | + if (strcmp(ks->name, name) == 0) | |
1703 | + return ks; | |
1704 | + return NULL; | |
1705 | +} | |
1706 | + | |
1706 | 1707 | static int is_exported(const char *name, const struct module *mod) |
1707 | 1708 | { |
1708 | 1709 | if (!mod && lookup_symbol(name, __start___ksymtab, __stop___ksymtab)) |