[PATCH] Adds __init annotation at mmu_init_secondary func

Alexey Spirkov AlexeiS at astrosoft.ru
Fri Jul 27 20:57:29 AEST 2018


Without any additional option 

WARNING: modpost: Found 1 section mismatch(es).

If detailed debug is switched on than:

WARNING: vmlinux.o(.text+0x142ac): Section mismatch in reference from the function mmu_init_secondary() to the function .init.text:ppc44x_pin_tlb()
The function mmu_init_secondary() references
the function __init ppc44x_pin_tlb().
This is often because mmu_init_secondary lacks a __init 
annotation or the annotation of ppc44x_pin_tlb is wrong.

Best regards,
Alexey Spirkov

-----Original Message-----
From: Michael Ellerman <mpe at ellerman.id.au> 
Sent: Friday, July 27, 2018 1:48 PM
To: Alexey Spirkov <AlexeiS at astrosoft.ru>; Benjamin Herrenschmidt <benh at kernel.crashing.org>; Paul Mackerras <paulus at samba.org>; linuxppc-dev at lists.ozlabs.org
Cc: trivial at kernel.org; andrew at ncrmnt.org
Subject: Re: [PATCH] Adds __init annotation at mmu_init_secondary func

Alexey Spirkov <AlexeiS at astrosoft.ru> writes:

> mmu_init_secondary function called at initialization sequence but it 
> misses __init annotation. As result modpost warning is generated.
> Some building systems sensitive to such kind of warnings.

What warning are you seeing?

AFAICS it's not called from, nor does it call, any __init code.

So I'm a bit confused.

cheers

> diff --git a/arch/powerpc/mm/44x_mmu.c b/arch/powerpc/mm/44x_mmu.c 
> index 82b1ff7..12d9251 100644
> --- a/arch/powerpc/mm/44x_mmu.c
> +++ b/arch/powerpc/mm/44x_mmu.c
> @@ -229,7 +229,7 @@ void setup_initial_memory_limit(phys_addr_t 
> first_memblock_base,  }
>  
>  #ifdef CONFIG_SMP
> -void mmu_init_secondary(int cpu)
> +void __init mmu_init_secondary(int cpu)
>  {
>  	unsigned long addr;
>  	unsigned long memstart = memstart_addr & ~(PPC_PIN_SIZE - 1);
> --
> 2.9.5


More information about the Linuxppc-dev mailing list