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>
This commit is contained in:
Alexey Dobriyan 2007-05-08 00:28:41 -07:00 committed by Linus Torvalds
parent ea07890a68
commit ffb4512276
10 changed files with 20 additions and 28 deletions

View file

@ -258,11 +258,9 @@ void timer_stats_update_stats(void *timer, pid_t pid, void *startf,
static void print_name_offset(struct seq_file *m, unsigned long addr)
{
char namebuf[KSYM_NAME_LEN+1];
unsigned long size, offset;
const char *sym_name;
char *modname;
sym_name = kallsyms_lookup(addr, &size, &offset, &modname, namebuf);
sym_name = kallsyms_lookup(addr, NULL, NULL, NULL, namebuf);
if (sym_name)
seq_printf(m, "%s", sym_name);
else