• Jisheng Zhang's avatar
    riscv: mm: init: try best to remove #ifdef CONFIG_XIP_KERNEL usage · 805a3ebe
    Jisheng Zhang authored
    Currently, the #ifdef CONFIG_XIP_KERNEL usage can be divided into the
    following three types:
    
    The first one is for functions/declarations only used in XIP case.
    
    The second one is for XIP_FIXUP case. Something as below:
    |foo_type foo;
    |#ifdef CONFIG_XIP_KERNEL
    |#define foo    (*(foo_type *)XIP_FIXUP(&foo))
    |#endif
    
    Usually, it's better to let the foo macro sit with the foo var
    together. But if various foos are defined adjacently, we can
    save some #ifdef CONFIG_XIP_KERNEL usage by grouping them together.
    
    The third one is for different implementations for XIP, usually, this
    is a #ifdef...#else...#endif case.
    
    This patch moves the pt_ops macro to adjacent #ifdef CONFIG_XIP_KERNEL
    and group first type usage cases into one.
    Signed-off-by: default avatarJisheng Zhang <jszhang@kernel.org>
    Reviewed-by: default avatarAlexandre Ghiti <alex@ghiti.fr>
    Signed-off-by: default avatarPalmer Dabbelt <palmer@rivosinc.com>
    805a3ebe
init.c 23.8 KB