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

powerpc/mm: Add __init attribute to eligible functions



Some functions defined in 'arch/powerpc/mm' 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-4-nick.child@ibm.com
parent ce0c6be9
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -15,7 +15,7 @@

extern bool hugetlb_disabled;

void hugetlbpage_init_default(void);
void __init hugetlbpage_init_default(void);

int slice_is_hugepage_only_range(struct mm_struct *mm, unsigned long addr,
			   unsigned long len);
+1 −1
Original line number Diff line number Diff line
@@ -71,7 +71,7 @@ static inline void switch_mmu_context(struct mm_struct *prev,
}

extern int hash__alloc_context_id(void);
extern void hash__reserve_context_id(int id);
void __init hash__reserve_context_id(int id);
extern void __destroy_context(int context_id);
static inline void mmu_context_init(void) { }

+1 −1
Original line number Diff line number Diff line
@@ -76,7 +76,7 @@ unsigned long p_block_mapped(phys_addr_t pa)
	return 0;
}

static int find_free_bat(void)
static int __init find_free_bat(void)
{
	int b;
	int n = mmu_has_feature(MMU_FTR_USE_HIGH_BATS) ? 8 : 4;
+3 −3
Original line number Diff line number Diff line
@@ -662,7 +662,7 @@ static int __init htab_dt_scan_hugepage_blocks(unsigned long node,
}
#endif /* CONFIG_HUGETLB_PAGE */

static void mmu_psize_set_default_penc(void)
static void __init mmu_psize_set_default_penc(void)
{
	int bpsize, apsize;
	for (bpsize = 0; bpsize < MMU_PAGE_COUNT; bpsize++)
@@ -672,7 +672,7 @@ static void mmu_psize_set_default_penc(void)

#ifdef CONFIG_PPC_64K_PAGES

static bool might_have_hea(void)
static bool __init might_have_hea(void)
{
	/*
	 * The HEA ethernet adapter requires awareness of the
@@ -743,7 +743,7 @@ static void __init htab_scan_page_sizes(void)
 * low-order N bits as the encoding for the 2^(12+N) byte page size
 * (if it exists).
 */
static void init_hpte_page_sizes(void)
static void __init init_hpte_page_sizes(void)
{
	long int ap, bp;
	long int shift, penc;
+1 −1
Original line number Diff line number Diff line
@@ -150,7 +150,7 @@ void huge_ptep_modify_prot_commit(struct vm_area_struct *vma, unsigned long addr
	set_huge_pte_at(vma->vm_mm, addr, ptep, pte);
}

void hugetlbpage_init_default(void)
void __init hugetlbpage_init_default(void)
{
	/* Set default large page size. Currently, we pick 16M or 1M
	 * depending on what is available
Loading