Commit a5ac40f5 authored by Will Deacon's avatar Will Deacon

arm64: memory: Simplify _VA_START and _PAGE_OFFSET definitions

Rather than subtracting from -1 and then adding 1, we can simply
subtract from 0.
Tested-by: default avatarSteve Capper <steve.capper@arm.com>
Reviewed-by: default avatarSteve Capper <steve.capper@arm.com>
Tested-by: default avatarGeert Uytterhoeven <geert+renesas@glider.be>
Reviewed-by: default avatarCatalin Marinas <catalin.marinas@arm.com>
Signed-off-by: default avatarWill Deacon <will@kernel.org>
parent 9ba33dcc
...@@ -44,8 +44,7 @@ ...@@ -44,8 +44,7 @@
* VA_START - the first kernel virtual address. * VA_START - the first kernel virtual address.
*/ */
#define VA_BITS (CONFIG_ARM64_VA_BITS) #define VA_BITS (CONFIG_ARM64_VA_BITS)
#define _PAGE_OFFSET(va) (UL(0xffffffffffffffff) - \ #define _PAGE_OFFSET(va) (-(UL(1) << (va)))
(UL(1) << (va)) + 1)
#define PAGE_OFFSET (_PAGE_OFFSET(VA_BITS)) #define PAGE_OFFSET (_PAGE_OFFSET(VA_BITS))
#define KIMAGE_VADDR (MODULES_END) #define KIMAGE_VADDR (MODULES_END)
#define BPF_JIT_REGION_START (KASAN_SHADOW_END) #define BPF_JIT_REGION_START (KASAN_SHADOW_END)
...@@ -63,8 +62,7 @@ ...@@ -63,8 +62,7 @@
#else #else
#define VA_BITS_MIN (VA_BITS) #define VA_BITS_MIN (VA_BITS)
#endif #endif
#define _VA_START(va) (UL(0xffffffffffffffff) - \ #define _VA_START(va) (-(UL(1) << ((va) - 1)))
(UL(1) << ((va) - 1)) + 1)
#define KERNEL_START _text #define KERNEL_START _text
#define KERNEL_END _end #define KERNEL_END _end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment