Skip to content

Commit 2aa5801

Browse files
RISC-V: uaccess: Wrap the get_user_8 uaccess macro
I must have lost this rebasing things during the merge window, I know I got it at some point but it's not here now. Without this I get warnings along the lines of include/linux/fs.h:3975:15: warning: label followed by a declaration is a C23 extension [-Wc23-extensions] 3975 | if (unlikely(get_user(c, path))) | ^ arch/riscv/include/asm/uaccess.h:274:3: note: expanded from macro 'get_user' 274 | __get_user((x), __p) : \ | ^ arch/riscv/include/asm/uaccess.h:244:2: note: expanded from macro '__get_user' 244 | __get_user_error(__gu_val, __gu_ptr, __gu_err); \ | ^ arch/riscv/include/asm/uaccess.h:207:2: note: expanded from macro '__get_user_error' 207 | __ge LD [M] net/802/psnap.ko t_user_nocheck(x, ptr, __gu_failed); \ | ^ arch/riscv/include/asm/uaccess.h:196:3: note: expanded from macro '__get_user_nocheck' 196 | __get_user_8((x), __gu_ptr, label); \ | ^ arch/riscv/include/asm/uaccess.h:130:2: note: expanded from macro '__get_user_8' 130 | u32 __user *__ptr = (u32 __user *)(ptr); \ | ^ Link: https://lore.kernel.org/r/[email protected] Reviewed-by: Alexandre Ghiti <[email protected]> Cc: [email protected] Fixes: f6bff78 ("riscv: uaccess: use 'asm_goto_output' for get_user()") Signed-off-by: Palmer Dabbelt <[email protected]>
1 parent dbe0038 commit 2aa5801

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

arch/riscv/include/asm/uaccess.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,7 @@ do { \
127127

128128
#ifdef CONFIG_CC_HAS_ASM_GOTO_OUTPUT
129129
#define __get_user_8(x, ptr, label) \
130+
do { \
130131
u32 __user *__ptr = (u32 __user *)(ptr); \
131132
u32 __lo, __hi; \
132133
asm_goto_output( \
@@ -141,7 +142,7 @@ do { \
141142
: : label); \
142143
(x) = (__typeof__(x))((__typeof__((x) - (x)))( \
143144
(((u64)__hi << 32) | __lo))); \
144-
145+
} while (0)
145146
#else /* !CONFIG_CC_HAS_ASM_GOTO_OUTPUT */
146147
#define __get_user_8(x, ptr, label) \
147148
do { \

0 commit comments

Comments
 (0)