Skip to content

Commit fef7ded

Browse files
Alexandre GhitiPaul Walmsley
authored andcommitted
riscv: Fix sparse warning in __get_user_error()
We used to assign 0 to x without an appropriate cast which results in sparse complaining when x is a pointer: >> block/ioctl.c:72:39: sparse: sparse: Using plain integer as NULL pointer So fix this by casting 0 to the correct type of x. Reported-by: kernel test robot <[email protected]> Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/ Fixes: f6bff78 ("riscv: uaccess: use 'asm_goto_output' for get_user()") Cc: [email protected] Signed-off-by: Alexandre Ghiti <[email protected]> Reviewed-by: Clément Léger <[email protected]> Reviewed-by: Cyril Bur <[email protected]> Link: https://lore.kernel.org/r/20250903-dev-alex-sparse_warnings_v1-v1-1-7e6350beb700@rivosinc.com Signed-off-by: Paul Walmsley <[email protected]>
1 parent 95c54cd commit fef7ded

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

arch/riscv/include/asm/uaccess.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ do { \
209209
err = 0; \
210210
break; \
211211
__gu_failed: \
212-
x = 0; \
212+
x = (__typeof__(x))0; \
213213
err = -EFAULT; \
214214
} while (0)
215215

0 commit comments

Comments
 (0)