arm64: mm: mark alloc_init_p{m,u}d as __ref
PATCH 1/1 arm64: mm: mark alloc_init_p{m,u}d as __ref
Both alloc_init_pmd and alloc_init_pud refer to the __init function early_alloc as part of a BUG_ON(alloc != early_alloc) statement.
This patch marks the functions as __ref to avoid the spurious section mismatch.
Signed-off-by Will Deacon <[email protected]>
--- arch/arm64/mm/mmu.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-)
arch/arm64/mm/mmu.c +8 -8
@@ -118,10 +118,10 @@ void split_pud(pud_t *old_pud, pmd_t *pmd) }while (pmd++, i++, i <PTRS_PER_PMD ); } -static void alloc_init_pmd (struct mm_struct *mm,pud_t *pud, -unsigned long addr,unsigned long end, -phys_addr_t phys,pgprot_t prot, -void *(*alloc)(unsigned long size)) +static void __ref alloc_init_pmd (struct mm_struct *mm,pud_t *pud, +unsigned long addr,unsigned long end, +phys_addr_t phys,pgprot_t prot, +void *(*alloc)(unsigned long size)) {pmd_t *pmd;unsigned long next;
@@ -183,10 +183,10 @@ static inline bool use_1G_block(unsigned long addr, unsigned long next,return true; } -static void alloc_init_pud (struct mm_struct *mm,pgd_t *pgd, -unsigned long addr,unsigned long end, -phys_addr_t phys,pgprot_t prot, -void *(*alloc)(unsigned long size)) +static void __ref alloc_init_pud (struct mm_struct *mm,pgd_t *pgd, +unsigned long addr,unsigned long end, +phys_addr_t phys,pgprot_t prot, +void *(*alloc)(unsigned long size)) {pud_t *pud;unsigned long next;
Signature · 1 line
2.1.4
Catalin Marinas
maintainerPATCH 1/1 arm64: mm: mark alloc_init_p{m,u}d as __ref
Quoted 5 lines · Will Deacon
Both
alloc_init_pmdandalloc_init_pudrefer to the__initfunctionearly_allocas part of aBUG_ON(alloc != early_alloc)statement.This patch marks the functions as
__refto avoid the spurious section mismatch.
Actually, I think it's better to do this:
arch/arm64/mm/mmu.c +5 -4
@@ -26,6 +26,7 @@#include <linux/memblock.h> #include <linux/fs.h> #include <linux/io.h> +#include <linux/slab.h> #include <linux/stop_machine.h> #include <asm/cputype.h>
@@ -159,8 +160,8 @@ static void alloc_init_pmd(struct mm_struct *mm, pud_t *pud,flush_tlb_all ();if (pmd_table (old_pmd)) {phys_addr_t table =__pa (pte_offset_map (&old_pmd,0 )); -BUG_ON (alloc != early_alloc); -memblock_free (table,PAGE_SIZE ); +if (!WARN_ON_ONCE (slab_is_available ())) +memblock_free (table,PAGE_SIZE ); } } }else {
@@ -220,8 +221,8 @@ static void alloc_init_pud(struct mm_struct *mm, pgd_t *pgd,flush_tlb_all ();if (pud_table (old_pud)) {phys_addr_t table =__pa (pmd_offset (&old_pud,0 )); -BUG_ON (alloc != early_alloc); -memblock_free (table,PAGE_SIZE ); +if (!WARN_ON_ONCE (slab_is_available ())) +memblock_free (table,PAGE_SIZE ); } } }else {