]> git.karo-electronics.de Git - linux-beck.git/commitdiff
x86/dumpstack: Remove unnecessary stack pointer arguments
authorJosh Poimboeuf <jpoimboe@redhat.com>
Wed, 24 Aug 2016 16:50:18 +0000 (11:50 -0500)
committerIngo Molnar <mingo@kernel.org>
Thu, 8 Sep 2016 06:58:40 +0000 (08:58 +0200)
When calling show_stack_log_lvl() or dump_trace() with a regs argument,
providing a stack pointer or frame pointer is redundant.

Signed-off-by: Josh Poimboeuf <jpoimboe@redhat.com>d
Reviewed-by: Andy Lutomirski <luto@kernel.org>
Cc: Andy Lutomirski <luto@amacapital.net>
Cc: Brian Gerst <brgerst@gmail.com>
Cc: Byungchul Park <byungchul.park@lge.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Kees Cook <keescook@chromium.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Nilay Vaish <nilayvaish@gmail.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Link: http://lkml.kernel.org/r/1694e2e955e3b9a73a3c3d5ba2634344014dd550.1472057064.git.jpoimboe@redhat.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
arch/x86/kernel/dumpstack.c
arch/x86/kernel/dumpstack_32.c
arch/x86/kernel/dumpstack_64.c
arch/x86/oprofile/backtrace.c

index 6d6f46837eeab1f7cf6982071447f290cd21b7ae..c6c6c39c367f5de2f40194c55098762476e38b25 100644 (file)
@@ -185,7 +185,7 @@ void show_stack(struct task_struct *task, unsigned long *sp)
 
 void show_stack_regs(struct pt_regs *regs)
 {
-       show_stack_log_lvl(current, regs, (unsigned long *)regs->sp, regs->bp, "");
+       show_stack_log_lvl(current, regs, NULL, 0, "");
 }
 
 static arch_spinlock_t die_lock = __ARCH_SPIN_LOCK_UNLOCKED;
index 358fe1cd4e5bc7d2399db9ac5aa0c1f09cfb454f..c533b8b5a373e0924ced05c4f15803699012e4a9 100644 (file)
@@ -122,7 +122,7 @@ void show_regs(struct pt_regs *regs)
                u8 *ip;
 
                pr_emerg("Stack:\n");
-               show_stack_log_lvl(NULL, regs, &regs->sp, 0, KERN_EMERG);
+               show_stack_log_lvl(NULL, regs, NULL, 0, KERN_EMERG);
 
                pr_emerg("Code:");
 
index 7f3b8066f719c09210d2c5378e79534e2f538444..b243352c779e663b695d460e0aad2d0ae313ac1b 100644 (file)
@@ -283,9 +283,7 @@ show_stack_log_lvl(struct task_struct *task, struct pt_regs *regs,
 void show_regs(struct pt_regs *regs)
 {
        int i;
-       unsigned long sp;
 
-       sp = regs->sp;
        show_regs_print_info(KERN_DEFAULT);
        __show_regs(regs, 1);
 
@@ -300,8 +298,7 @@ void show_regs(struct pt_regs *regs)
                u8 *ip;
 
                printk(KERN_DEFAULT "Stack:\n");
-               show_stack_log_lvl(NULL, regs, (unsigned long *)sp,
-                                  0, KERN_DEFAULT);
+               show_stack_log_lvl(NULL, regs, NULL, 0, KERN_DEFAULT);
 
                printk(KERN_DEFAULT "Code: ");
 
index 2ef6c8b56311cb575bbfd0bd879486f08d85b365..d950f9ea9a8c646029e24c45df66bf0cf1c96c44 100644 (file)
@@ -113,8 +113,6 @@ x86_backtrace(struct pt_regs * const regs, unsigned int depth)
        struct stack_frame *head = (struct stack_frame *)frame_pointer(regs);
 
        if (!user_mode(regs)) {
-               unsigned long stack = kernel_stack_pointer(regs);
-
                if (!depth)
                        return;
 
@@ -122,8 +120,7 @@ x86_backtrace(struct pt_regs * const regs, unsigned int depth)
                if (!--depth)
                        return;
 
-               dump_trace(NULL, regs, (unsigned long *)stack, 0,
-                          &backtrace_ops, &depth);
+               dump_trace(NULL, regs, NULL, 0, &backtrace_ops, &depth);
                return;
        }