linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH next] arm64: alternatives: add __init/__initconst to some functions/variables
@ 2022-12-02 16:18 Jisheng Zhang
  2022-12-05 15:43 ` Will Deacon
  0 siblings, 1 reply; 2+ messages in thread
From: Jisheng Zhang @ 2022-12-02 16:18 UTC (permalink / raw)
  To: Catalin Marinas, Will Deacon, Mark Rutland; +Cc: linux-arm-kernel, linux-kernel

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 <jszhang@kernel.org>
---
 arch/arm64/kernel/alternative.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/arch/arm64/kernel/alternative.c b/arch/arm64/kernel/alternative.c
index 0f5eaa4c3a39..d32d4ed5519b 100644
--- a/arch/arm64/kernel/alternative.c
+++ b/arch/arm64/kernel/alternative.c
@@ -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(&region, 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()) {
-- 
2.38.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH next] arm64: alternatives: add __init/__initconst to some functions/variables
  2022-12-02 16:18 [PATCH next] arm64: alternatives: add __init/__initconst to some functions/variables Jisheng Zhang
@ 2022-12-05 15:43 ` Will Deacon
  0 siblings, 0 replies; 2+ messages in thread
From: Will Deacon @ 2022-12-05 15:43 UTC (permalink / raw)
  To: Jisheng Zhang, Catalin Marinas, Mark Rutland
  Cc: kernel-team, Will Deacon, linux-arm-kernel, linux-kernel

On Sat, 3 Dec 2022 00:18:59 +0800, Jisheng Zhang wrote:
> 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.
> 
> 

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,
-- 
Will

https://fixes.arm64.dev
https://next.arm64.dev
https://will.arm64.dev

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-12-05 15:44 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-12-02 16:18 [PATCH next] arm64: alternatives: add __init/__initconst to some functions/variables Jisheng Zhang
2022-12-05 15:43 ` Will Deacon

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).