diff options
author | Alexey Dobriyan <adobriyan@sw.ru> | 2007-05-08 03:28:41 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-05-08 14:15:08 -0400 |
commit | ffb45122766db220d0bf3d01848d575fbbcb6430 (patch) | |
tree | a8fedf0518407ad12578a7c03aa2c3344f11ff3c /kernel/module.c | |
parent | ea07890a680273b25127129fb555aac0d9324bea (diff) |
Simplify kallsyms_lookup()
Several kallsyms_lookup() pass dummy arguments but only need, say, module's
name. Make kallsyms_lookup() accept NULLs where possible.
Also, makes picture clearer about what interfaces are needed for all symbol
resolving business.
Signed-off-by: Alexey Dobriyan <adobriyan@sw.ru>
Cc: Rusty Russell <rusty@rustcorp.com.au>
Acked-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'kernel/module.c')
-rw-r--r-- | kernel/module.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/kernel/module.c b/kernel/module.c index 5ee65994a3bc..bf4dccadf7b8 100644 --- a/kernel/module.c +++ b/kernel/module.c | |||
@@ -2098,8 +2098,10 @@ static const char *get_ksymbol(struct module *mod, | |||
2098 | if (!best) | 2098 | if (!best) |
2099 | return NULL; | 2099 | return NULL; |
2100 | 2100 | ||
2101 | *size = nextval - mod->symtab[best].st_value; | 2101 | if (size) |
2102 | *offset = addr - mod->symtab[best].st_value; | 2102 | *size = nextval - mod->symtab[best].st_value; |
2103 | if (offset) | ||
2104 | *offset = addr - mod->symtab[best].st_value; | ||
2103 | return mod->strtab + mod->symtab[best].st_name; | 2105 | return mod->strtab + mod->symtab[best].st_name; |
2104 | } | 2106 | } |
2105 | 2107 | ||