riscv: Improve arch_get_mmap_end() macro
authorLeonardo Bras <leobras@redhat.com>
Wed, 3 Jan 2024 16:00:19 +0000 (13:00 -0300)
committerPalmer Dabbelt <palmer@rivosinc.com>
Tue, 19 Mar 2024 23:39:36 +0000 (16:39 -0700)
commit6be7ee4bebd14b8e7e040a5e7fd6aec3d9167c72
tree0d10e98b0b0e0ba00342229f266cdd5bc37111d7
parentb85ea95d086471afb4ad062012a4d73cd328fa86
riscv: Improve arch_get_mmap_end() macro

This macro caused me some confusion, which took some reviewer's time to
make it clear, so I propose adding a short comment in code to avoid
confusion in the future.

Also, added some improvements to the macro, such as removing the
assumption of VA_USER_SV57 being the largest address space.

Signed-off-by: Leonardo Bras <leobras@redhat.com>
Reviewed-by: Guo Ren <guoren@kernel.org>
Link: https://lore.kernel.org/r/20240103160024.70305-3-leobras@redhat.com
Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
arch/riscv/include/asm/processor.h