You've already forked linux-rockchip
mirror of
https://github.com/armbian/linux-rockchip.git
synced 2026-01-06 11:08:10 -08:00
x86/uaccess: Move variable into switch case statement
[ Upstream commit61646ca83d] 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/x86/include/asm/uaccess.h:317:23: warning: statement will never be executed [-Wswitch-unreachable] 317 | unsigned char x_u8__; \ | ^~~~~~ Fixes:865c50e1d2("x86/uaccess: utilize CONFIG_CC_HAS_ASM_GOTO_OUTPUT") Signed-off-by: Kees Cook <keescook@chromium.org> Signed-off-by: Dave Hansen <dave.hansen@linux.intel.com> Signed-off-by: Borislav Petkov <bp@suse.de> Link: https://lkml.kernel.org/r/20211209043456.1377875-1-keescook@chromium.org Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
3e801ea43c
commit
d21b47c607
@@ -314,11 +314,12 @@ do { \
|
||||
do { \
|
||||
__chk_user_ptr(ptr); \
|
||||
switch (size) { \
|
||||
unsigned char x_u8__; \
|
||||
case 1: \
|
||||
case 1: { \
|
||||
unsigned char x_u8__; \
|
||||
__get_user_asm(x_u8__, ptr, "b", "=q", label); \
|
||||
(x) = x_u8__; \
|
||||
break; \
|
||||
} \
|
||||
case 2: \
|
||||
__get_user_asm(x, ptr, "w", "=r", label); \
|
||||
break; \
|
||||
|
||||
Reference in New Issue
Block a user