Skip to content

Commit 3ac4a61

Browse files
committed
xtensa: add missing __user annotations to __{get,put}_user_check
__get_user_check and __put_user_check use temporary pointer but don't mark it as __user, resulting in sparse warnings: sparse: warning: incorrect type in initializer (different address spaces) sparse: expected long *__pu_addr sparse: got long [noderef] <asn:1> *ret sparse: warning: incorrect type in argument 1 (different address spaces) sparse: expected void [noderef] <asn:1> *to sparse: got long *__pu_addr Add __user annotation to temporary pointer in __get_user_check and __put_user_check. Reported-by: kbuild test robot <[email protected]> Reported-by: Arnd Bergmann <[email protected]> Signed-off-by: Max Filippov <[email protected]>
1 parent b9bbe6e commit 3ac4a61

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

arch/xtensa/include/asm/uaccess.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ extern long __put_user_bad(void);
8484
#define __put_user_check(x, ptr, size) \
8585
({ \
8686
long __pu_err = -EFAULT; \
87-
__typeof__(*(ptr)) *__pu_addr = (ptr); \
87+
__typeof__(*(ptr)) __user *__pu_addr = (ptr); \
8888
if (access_ok(__pu_addr, size)) \
8989
__put_user_size((x), __pu_addr, (size), __pu_err); \
9090
__pu_err; \
@@ -180,7 +180,7 @@ __asm__ __volatile__( \
180180
#define __get_user_check(x, ptr, size) \
181181
({ \
182182
long __gu_err = -EFAULT; \
183-
const __typeof__(*(ptr)) *__gu_addr = (ptr); \
183+
const __typeof__(*(ptr)) __user *__gu_addr = (ptr); \
184184
if (access_ok(__gu_addr, size)) \
185185
__get_user_size((x), __gu_addr, (size), __gu_err); \
186186
else \

0 commit comments

Comments
 (0)