aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorAlexey Dobriyan <adobriyan@sw.ru>2007-05-08 03:28:41 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-05-08 14:15:08 -0400
commitffb45122766db220d0bf3d01848d575fbbcb6430 (patch)
treea8fedf0518407ad12578a7c03aa2c3344f11ff3c /arch
parentea07890a680273b25127129fb555aac0d9324bea (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 'arch')
-rw-r--r--arch/parisc/kernel/unwind.c5
-rw-r--r--arch/powerpc/xmon/xmon.c3
-rw-r--r--arch/sh64/kernel/unwind.c6
3 files changed, 5 insertions, 9 deletions
diff --git a/arch/parisc/kernel/unwind.c b/arch/parisc/kernel/unwind.c
index 5f75b3e65986..89c03707eccc 100644
--- a/arch/parisc/kernel/unwind.c
+++ b/arch/parisc/kernel/unwind.c
@@ -216,11 +216,8 @@ static void unwind_frame_regs(struct unwind_frame_info *info)
216 /* Handle some frequent special cases.... */ 216 /* Handle some frequent special cases.... */
217 { 217 {
218 char symname[KSYM_NAME_LEN+1]; 218 char symname[KSYM_NAME_LEN+1];
219 char *modname;
220 unsigned long symsize, offset;
221 219
222 kallsyms_lookup(info->ip, &symsize, &offset, 220 kallsyms_lookup(info->ip, NULL, NULL, NULL, symname);
223 &modname, symname);
224 221
225 dbg("info->ip = 0x%lx, name = %s\n", info->ip, symname); 222 dbg("info->ip = 0x%lx, name = %s\n", info->ip, symname);
226 223
diff --git a/arch/powerpc/xmon/xmon.c b/arch/powerpc/xmon/xmon.c
index b481db1dacb4..28fdf4f50c27 100644
--- a/arch/powerpc/xmon/xmon.c
+++ b/arch/powerpc/xmon/xmon.c
@@ -1217,7 +1217,6 @@ static void get_function_bounds(unsigned long pc, unsigned long *startp,
1217{ 1217{
1218 unsigned long size, offset; 1218 unsigned long size, offset;
1219 const char *name; 1219 const char *name;
1220 char *modname;
1221 1220
1222 *startp = *endp = 0; 1221 *startp = *endp = 0;
1223 if (pc == 0) 1222 if (pc == 0)
@@ -1225,7 +1224,7 @@ static void get_function_bounds(unsigned long pc, unsigned long *startp,
1225 if (setjmp(bus_error_jmp) == 0) { 1224 if (setjmp(bus_error_jmp) == 0) {
1226 catch_memory_errors = 1; 1225 catch_memory_errors = 1;
1227 sync(); 1226 sync();
1228 name = kallsyms_lookup(pc, &size, &offset, &modname, tmpstr); 1227 name = kallsyms_lookup(pc, &size, &offset, NULL, tmpstr);
1229 if (name != NULL) { 1228 if (name != NULL) {
1230 *startp = pc - offset; 1229 *startp = pc - offset;
1231 *endp = pc - offset + size; 1230 *endp = pc - offset + size;
diff --git a/arch/sh64/kernel/unwind.c b/arch/sh64/kernel/unwind.c
index f934f97f9f9c..1214c78e3584 100644
--- a/arch/sh64/kernel/unwind.c
+++ b/arch/sh64/kernel/unwind.c
@@ -46,15 +46,15 @@ static int lookup_prev_stack_frame(unsigned long fp, unsigned long pc,
46 struct pt_regs *regs) 46 struct pt_regs *regs)
47{ 47{
48 const char *sym; 48 const char *sym;
49 char *modname, namebuf[128]; 49 char namebuf[128];
50 unsigned long offset, size; 50 unsigned long offset;
51 unsigned long prologue = 0; 51 unsigned long prologue = 0;
52 unsigned long fp_displacement = 0; 52 unsigned long fp_displacement = 0;
53 unsigned long fp_prev = 0; 53 unsigned long fp_prev = 0;
54 unsigned long offset_r14 = 0, offset_r18 = 0; 54 unsigned long offset_r14 = 0, offset_r18 = 0;
55 int i, found_prologue_end = 0; 55 int i, found_prologue_end = 0;
56 56
57 sym = kallsyms_lookup(pc, &size, &offset, &modname, namebuf); 57 sym = kallsyms_lookup(pc, NULL, &offset, NULL, namebuf);
58 if (!sym) 58 if (!sym)
59 return -EINVAL; 59 return -EINVAL;
60 60