From ffb45122766db220d0bf3d01848d575fbbcb6430 Mon Sep 17 00:00:00 2001 From: Alexey Dobriyan Date: Tue, 8 May 2007 00:28:41 -0700 Subject: 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 Cc: Rusty Russell Acked-by: Ingo Molnar Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- kernel/module.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'kernel/module.c') 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; } -- cgit v1.2.3-59-g8ed1b