]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
powerpc/xmon: fix task state output
authorDenis Kirjanov <kda@linux-powerpc.org>
Tue, 26 Oct 2021 13:31:08 +0000 (16:31 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 17 Nov 2021 10:04:30 +0000 (11:04 +0100)
[ Upstream commit b1f896ce3542eb2eede5949ee2e481526fae1108 ]

p_state is unsigned since the commit 2f064a59a11f

The patch also uses TASK_RUNNING instead of null.

Fixes: 2f064a59a11f ("sched: Change task_struct::state")
Signed-off-by: Denis Kirjanov <kda@linux-powerpc.org>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20211026133108.7113-1-kda@linux-powerpc.org
Signed-off-by: Sasha Levin <sashal@kernel.org>
arch/powerpc/xmon/xmon.c

index da4d7f225a409bc03b0cf84a67fea7724833bed3..47518116e95333eba57e01fbc85c170207e080e8 100644 (file)
@@ -3274,8 +3274,7 @@ static void show_task(struct task_struct *volatile tsk)
         * appropriate for calling from xmon. This could be moved
         * to a common, generic, routine used by both.
         */
-       state = (p_state == 0) ? 'R' :
-               (p_state < 0) ? 'U' :
+       state = (p_state == TASK_RUNNING) ? 'R' :
                (p_state & TASK_UNINTERRUPTIBLE) ? 'D' :
                (p_state & TASK_STOPPED) ? 'T' :
                (p_state & TASK_TRACED) ? 'C' :