arm64: alternatives: add __init/__initconst to some functions/variables
PATCH 1/1 arm64: alternatives: add __init/__initconst to some functions/variables
apply_alternatives_vdso(), __apply_alternatives_multi_stop() and kernel_alternatives are not needed after booting, so mark the two functions as __init and the var as __initconst.
Signed-off-by Jisheng Zhang <[email protected]>
--- arch/arm64/kernel/alternative.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
arch/arm64/kernel/alternative.c +3 -3
@@ -196,7 +196,7 @@ static void __apply_alternatives(const struct alt_region *region, } } -static void apply_alternatives_vdso (void ) +static void __init apply_alternatives_vdso (void ) {struct alt_region region;const struct elf64_hdr *hdr;
@@ -220,7 +220,7 @@ static void apply_alternatives_vdso(void)__apply_alternatives (®ion, false, &all_capabilities[0 ]); } -static const struct alt_region kernel_alternatives = { +static const struct alt_region kernel_alternatives__initconst = { .begin = (struct alt_instr *)__alt_instructions, .end = (struct alt_instr *)__alt_instructions_end, };
@@ -229,7 +229,7 @@ static const struct alt_region kernel_alternatives = {* We might be patching the stop_machine state machine, so implement a * really simple polling protocol here. */ -static int __apply_alternatives_multi_stop (void *unused) +static int __init __apply_alternatives_multi_stop (void *unused) {/* We always have a CPU 0 at this point (__init) */ if (smp_processor_id ()) {
Signature · 7 lines
2.38.1 _______________________________________________ linux-arm-kernel mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Quoted 5 lines · Jisheng Zhang
apply_alternatives_vdso(),__apply_alternatives_multi_stop()andkernel_alternativesare not needed after booting, so mark the two functions as__initand the var as__initconst.
Applied to arm64 (for-next/trivial), thanks!
[1/1] arm64: alternatives: add __init/__initconst to some functions/variables
https://git.kernel.org/arm64/c/67bc5b2d6d48
Cheers,
Signature · 5 lines
Will https://fixes.arm64.dev https://next.arm64.dev https://will.arm64.dev