]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commitdiff
arm64: mm: Really fix sparse warning in untagged_addr()
authorWill Deacon <will@kernel.org>
Fri, 9 Aug 2019 14:39:37 +0000 (15:39 +0100)
committerWill Deacon <will@kernel.org>
Fri, 9 Aug 2019 14:39:37 +0000 (15:39 +0100)
untagged_addr() can be called with a '__user' pointer parameter and must
therefore use '__force' casts both when passing this parameter through
to sign_extend64() as a 'u64', but also when casting the 's64' return
value back to the '__user' pointer type.

Signed-off-by: Will Deacon <will@kernel.org>
arch/arm64/include/asm/memory.h

index 46c4c08a80a9e52308e9a80b34f6bad357c874be..76e0b232a47348eb6664d36aef2e9698b43754b8 100644 (file)
@@ -201,7 +201,7 @@ extern u64                  vabits_user;
  * pass on to access_ok(), for instance.
  */
 #define untagged_addr(addr)    \
-       ((__typeof__(addr))sign_extend64((__force u64)(addr), 55))
+       ((__force __typeof__(addr))sign_extend64((__force u64)(addr), 55))
 
 #ifdef CONFIG_KASAN_SW_TAGS
 #define __tag_shifted(tag)     ((u64)(tag) << 56)