]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
s390/unwind: unify task is current checks
authorVasily Gorbik <gor@linux.ibm.com>
Fri, 22 Nov 2019 11:35:34 +0000 (12:35 +0100)
committerVasily Gorbik <gor@linux.ibm.com>
Sat, 30 Nov 2019 09:52:45 +0000 (10:52 +0100)
Avoid mixture of task == NULL and task == current meaning the same
thing and simply always initialize task with current in unwind_start.

Reviewed-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
arch/s390/include/asm/stacktrace.h
arch/s390/include/asm/unwind.h
arch/s390/kernel/dumpstack.c

index fee40212af11bef5215b91353eaca7abd38273e3..0ae4bbf7779c8bed1602d90898a2f30751eba50b 100644 (file)
@@ -38,7 +38,7 @@ static inline unsigned long get_stack_pointer(struct task_struct *task,
 {
        if (regs)
                return (unsigned long) kernel_stack_pointer(regs);
-       if (!task || task == current)
+       if (task == current)
                return current_stack_pointer();
        return (unsigned long) task->thread.ksp;
 }
index eaaefeceef6f0810c53108b390420b351257a052..a2d8dd766987e233b0d91ba7519dd7d418e6fdb7 100644 (file)
@@ -61,7 +61,8 @@ static inline void unwind_start(struct unwind_state *state,
                                struct pt_regs *regs,
                                unsigned long sp)
 {
-       sp = sp ? : get_stack_pointer(task, regs);
+       task = task ?: current;
+       sp = sp ?: get_stack_pointer(task, regs);
        __unwind_start(state, task, regs, sp);
 }
 
index 34bdc60c0b11d348946b2b363e76fb7b6dcdf195..fc442aec0d9633dc3228ecc6f2fd218696134b37 100644 (file)
@@ -93,8 +93,6 @@ int get_stack_info(unsigned long sp, struct task_struct *task,
        if (!sp)
                goto unknown;
 
-       task = task ? : current;
-
        /* Check per-task stack */
        if (in_task_stack(sp, task, info))
                goto recursion_check;
@@ -128,8 +126,6 @@ void show_stack(struct task_struct *task, unsigned long *stack)
        struct unwind_state state;
 
        printk("Call Trace:\n");
-       if (!task)
-               task = current;
        unwind_for_each_frame(&state, task, NULL, (unsigned long) stack)
                printk(state.reliable ? " [<%016lx>] %pSR \n" :
                                        "([<%016lx>] %pSR)\n",