riscv: Optimize kernel virtual address conversion macro
authorAlexandre Ghiti <alex@ghiti.fr>
Wed, 21 Jul 2021 07:59:37 +0000 (09:59 +0200)
committerPalmer Dabbelt <palmerdabbelt@google.com>
Thu, 12 Aug 2021 01:37:48 +0000 (18:37 -0700)
commit59a27e1122133831111f9e2e40fec2307d742487
treecab189fe753a074c0474c43337673ecfc515ae7e
parent9f2a5aebb03c19180e3be75ed7263c6ab510b75e
riscv: Optimize kernel virtual address conversion macro

The current test in kernel_mapping_va_to_pa only applies when
CONFIG_XIP_KERNEL is set, so use IS_ENABLED to optimize this macro at
compile-time in standard kernels that do not require this test.

Signed-off-by: Alexandre Ghiti <alex@ghiti.fr>
Tested-by: Emil Renner Berthing <kernel@esmil.dk>
Reviewed-by: Jisheng Zhang <jszhang@kernel.org>
Reviewed-By: Vitaly Wool <vitaly.wool@konsulko.com>
Signed-off-by: Palmer Dabbelt <palmerdabbelt@google.com>
arch/riscv/include/asm/page.h