riscv: alternative: Use IS_ENABLED() over ifdeffery for apply_vdso_alternatives()

IS_ENABLED() allows better compilation coverage while still optimizing
away all the dead code. Also it will make some upcoming changes easier.

Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de>
Link: https://patch.msgid.link/20260504-riscv-cfi-vdso-alternative-v1-2-bcdf3d37f62e@linutronix.de
Signed-off-by: Paul Walmsley <pjw@kernel.org>
This commit is contained in:
Thomas Weißschuh 2026-05-04 08:30:51 +02:00 committed by Paul Walmsley
parent 499578e22a
commit 4fd6505f18

View File

@ -173,7 +173,6 @@ static void __init_or_module _apply_alternatives(struct alt_entry *begin,
stage);
}
#ifdef CONFIG_MMU
static void __init apply_vdso_alternatives(void)
{
const Elf_Ehdr *hdr;
@ -194,9 +193,6 @@ static void __init apply_vdso_alternatives(void)
(struct alt_entry *)end,
RISCV_ALTERNATIVES_BOOT);
}
#else
static void __init apply_vdso_alternatives(void) { }
#endif
void __init apply_boot_alternatives(void)
{
@ -207,7 +203,8 @@ void __init apply_boot_alternatives(void)
(struct alt_entry *)__alt_end,
RISCV_ALTERNATIVES_BOOT);
apply_vdso_alternatives();
if (IS_ENABLED(CONFIG_MMU))
apply_vdso_alternatives();
}
/*