powerpc/xmon: Fix -Wswitch-unreachable warning in bpt_cmds
authorGustavo A. R. Silva <gustavoars@kernel.org>
Fri, 16 Sep 2022 14:15:04 +0000 (15:15 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 31 Dec 2022 12:14:35 +0000 (13:14 +0100)
commitb31e9647f1a26ab348641408da8ccad70b876997
tree470d3050eaf95c60e1287f9fb733e02c9af279d8
parent6a310e8db5409676b4b3e6c1f54dff174e4fd04d
powerpc/xmon: Fix -Wswitch-unreachable warning in bpt_cmds

[ Upstream commit 1c4a4a4c8410be4a231a58b23e7a30923ff954ac ]

When building with automatic stack variable initialization, GCC 12
complains about variables defined outside of switch case statements.
Move the variable into the case that uses it, which silences the warning:

arch/powerpc/xmon/xmon.c: In function ‘bpt_cmds’:
arch/powerpc/xmon/xmon.c:1529:13: warning: statement will never be executed [-Wswitch-unreachable]
 1529 |         int mode;
      |             ^~~~

Fixes: 09b6c1129f89 ("powerpc/xmon: Fix compile error with PPC_8xx=y")
Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>
Reviewed-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/YySE6FHiOcbWWR+9@work
Signed-off-by: Sasha Levin <sashal@kernel.org>
arch/powerpc/xmon/xmon.c