From: Max Filippov Date: Fri, 22 May 2020 20:20:05 +0000 (-0700) Subject: xtensa: fix type conversion in __get_user_size X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=c22f9075044057f130f6b73a0638a2eb78f459ad;p=linux.git xtensa: fix type conversion in __get_user_size 8-byte access in __get_user_size converts pointer to temporary variable to the type of original user pointer and then dereferences it, resulting in the following sparse warning: sparse: warning: dereference of noderef expression Instead dereference the original user pointer under the __typeof__ and add indirection outside. Signed-off-by: Max Filippov --- diff --git a/arch/xtensa/include/asm/uaccess.h b/arch/xtensa/include/asm/uaccess.h index 754a7c96b9da3..445bb4cf3c287 100644 --- a/arch/xtensa/include/asm/uaccess.h +++ b/arch/xtensa/include/asm/uaccess.h @@ -204,7 +204,7 @@ do { \ retval = -EFAULT; \ (x) = 0; \ } else { \ - (x) = *(__force __typeof__((ptr)))&__x; \ + (x) = *(__force __typeof__(*(ptr)) *)&__x; \ } \ break; \ } \