Skip to content

Commit 67bc5b2

Browse files
xhackerustcwilldeacon
authored andcommitted
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]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Will Deacon <[email protected]>
1 parent d503d01 commit 67bc5b2

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

arch/arm64/kernel/alternative.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ static void __apply_alternatives(const struct alt_region *region,
196196
}
197197
}
198198

199-
static void apply_alternatives_vdso(void)
199+
static void __init apply_alternatives_vdso(void)
200200
{
201201
struct alt_region region;
202202
const struct elf64_hdr *hdr;
@@ -220,7 +220,7 @@ static void apply_alternatives_vdso(void)
220220
__apply_alternatives(&region, false, &all_capabilities[0]);
221221
}
222222

223-
static const struct alt_region kernel_alternatives = {
223+
static const struct alt_region kernel_alternatives __initconst = {
224224
.begin = (struct alt_instr *)__alt_instructions,
225225
.end = (struct alt_instr *)__alt_instructions_end,
226226
};
@@ -229,7 +229,7 @@ static const struct alt_region kernel_alternatives = {
229229
* We might be patching the stop_machine state machine, so implement a
230230
* really simple polling protocol here.
231231
*/
232-
static int __apply_alternatives_multi_stop(void *unused)
232+
static int __init __apply_alternatives_multi_stop(void *unused)
233233
{
234234
/* We always have a CPU 0 at this point (__init) */
235235
if (smp_processor_id()) {

0 commit comments

Comments
 (0)