You've already forked linux-apfs
mirror of
https://github.com/linux-apfs/linux-apfs.git
synced 2026-05-01 15:00:59 -07:00
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:
committed by
Linus Torvalds
parent
ea07890a68
commit
ffb4512276
@@ -216,11 +216,8 @@ static void unwind_frame_regs(struct unwind_frame_info *info)
|
||||
/* Handle some frequent special cases.... */
|
||||
{
|
||||
char symname[KSYM_NAME_LEN+1];
|
||||
char *modname;
|
||||
unsigned long symsize, offset;
|
||||
|
||||
kallsyms_lookup(info->ip, &symsize, &offset,
|
||||
&modname, symname);
|
||||
kallsyms_lookup(info->ip, NULL, NULL, NULL, symname);
|
||||
|
||||
dbg("info->ip = 0x%lx, name = %s\n", info->ip, symname);
|
||||
|
||||
|
||||
@@ -1217,7 +1217,6 @@ static void get_function_bounds(unsigned long pc, unsigned long *startp,
|
||||
{
|
||||
unsigned long size, offset;
|
||||
const char *name;
|
||||
char *modname;
|
||||
|
||||
*startp = *endp = 0;
|
||||
if (pc == 0)
|
||||
@@ -1225,7 +1224,7 @@ static void get_function_bounds(unsigned long pc, unsigned long *startp,
|
||||
if (setjmp(bus_error_jmp) == 0) {
|
||||
catch_memory_errors = 1;
|
||||
sync();
|
||||
name = kallsyms_lookup(pc, &size, &offset, &modname, tmpstr);
|
||||
name = kallsyms_lookup(pc, &size, &offset, NULL, tmpstr);
|
||||
if (name != NULL) {
|
||||
*startp = pc - offset;
|
||||
*endp = pc - offset + size;
|
||||
|
||||
@@ -46,15 +46,15 @@ static int lookup_prev_stack_frame(unsigned long fp, unsigned long pc,
|
||||
struct pt_regs *regs)
|
||||
{
|
||||
const char *sym;
|
||||
char *modname, namebuf[128];
|
||||
unsigned long offset, size;
|
||||
char namebuf[128];
|
||||
unsigned long offset;
|
||||
unsigned long prologue = 0;
|
||||
unsigned long fp_displacement = 0;
|
||||
unsigned long fp_prev = 0;
|
||||
unsigned long offset_r14 = 0, offset_r18 = 0;
|
||||
int i, found_prologue_end = 0;
|
||||
|
||||
sym = kallsyms_lookup(pc, &size, &offset, &modname, namebuf);
|
||||
sym = kallsyms_lookup(pc, NULL, &offset, NULL, namebuf);
|
||||
if (!sym)
|
||||
return -EINVAL;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user