Commit d276960d authored by Nick Child's avatar Nick Child Committed by Michael Ellerman
Browse files

powerpc/kernel: Add __init attribute to eligible functions



Some functions defined in `arch/powerpc/kernel` (and one in `arch/powerpc/
kexec`) are deserving of an `__init` macro attribute. These functions are
only called by other initialization functions and therefore should inherit
the attribute.
Also, change function declarations in header files to include `__init`.

Signed-off-by: default avatarNick Child <nick.child@ibm.com>
Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20211216220035.605465-2-nick.child@ibm.com
parent a8968521
Loading
Loading
Loading
Loading
+5 −5
Original line number Diff line number Diff line
@@ -23,12 +23,12 @@ extern void btext_unmap(void);

extern void btext_drawchar(char c);
extern void btext_drawstring(const char *str);
extern void btext_drawhex(unsigned long v);
extern void btext_drawtext(const char *c, unsigned int len);
void __init btext_drawhex(unsigned long v);
void __init btext_drawtext(const char *c, unsigned int len);

extern void btext_clearscreen(void);
extern void btext_flushscreen(void);
extern void btext_flushline(void);
void __init btext_clearscreen(void);
void __init btext_flushscreen(void);
void __init btext_flushline(void);

#endif /* __KERNEL__ */
#endif /* __PPC_BTEXT_H */
+1 −1
Original line number Diff line number Diff line
@@ -460,7 +460,7 @@ static inline void eeh_readsl(const volatile void __iomem *addr, void * buf,
}


void eeh_cache_debugfs_init(void);
void __init eeh_cache_debugfs_init(void);

#endif /* CONFIG_PPC64 */
#endif /* __KERNEL__ */
+3 −3
Original line number Diff line number Diff line
@@ -137,10 +137,10 @@ struct fadump_ops {
};

/* Helper functions */
s32 fadump_setup_cpu_notes_buf(u32 num_cpus);
s32 __init fadump_setup_cpu_notes_buf(u32 num_cpus);
void fadump_free_cpu_notes_buf(void);
u32 *fadump_regs_to_elf_notes(u32 *buf, struct pt_regs *regs);
void fadump_update_elfcore_header(char *bufp);
u32 *__init fadump_regs_to_elf_notes(u32 *buf, struct pt_regs *regs);
void __init fadump_update_elfcore_header(char *bufp);
bool is_fadump_boot_mem_contiguous(void);
bool is_fadump_reserved_mem_contiguous(void);

+1 −1
Original line number Diff line number Diff line
@@ -84,7 +84,7 @@ extern int crash_shutdown_register(crash_shutdown_t handler);
extern int crash_shutdown_unregister(crash_shutdown_t handler);

extern void crash_kexec_secondary(struct pt_regs *regs);
extern int overlaps_crashkernel(unsigned long start, unsigned long size);
int __init overlaps_crashkernel(unsigned long start, unsigned long size);
extern void reserve_crashkernel(void);
extern void machine_kexec_mask_interrupts(void);

+1 −1
Original line number Diff line number Diff line
@@ -16,7 +16,7 @@ static inline bool is_kvm_guest(void)
	return static_branch_unlikely(&kvm_guest);
}

int check_kvm_guest(void);
int __init check_kvm_guest(void);
#else
static inline bool is_kvm_guest(void) { return false; }
static inline int check_kvm_guest(void) { return 0; }
Loading