summaryrefslogtreecommitdiffstats
path: root/kernel/module.c
diff options
context:
space:
mode:
authorAlexey Dobriyan <adobriyan@sw.ru>2007-05-08 00:28:41 -0700
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-05-08 11:15:08 -0700
commitffb45122766db220d0bf3d01848d575fbbcb6430 (patch)
treea8fedf0518407ad12578a7c03aa2c3344f11ff3c /kernel/module.c
parentea07890a680273b25127129fb555aac0d9324bea (diff)
downloadblackbird-op-linux-ffb45122766db220d0bf3d01848d575fbbcb6430.tar.gz
blackbird-op-linux-ffb45122766db220d0bf3d01848d575fbbcb6430.zip
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.c6
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,
if (!best)
return NULL;
- *size = nextval - mod->symtab[best].st_value;
- *offset = addr - mod->symtab[best].st_value;
+ if (size)
+ *size = nextval - mod->symtab[best].st_value;
+ if (offset)
+ *offset = addr - mod->symtab[best].st_value;
return mod->strtab + mod->symtab[best].st_name;
}
OpenPOWER on IntegriCloud