Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d19fbfdf authored by Marcin Slusarz's avatar Marcin Slusarz Committed by Ingo Molnar
Browse files

x86: silence section mismatch warning - get_local_pda



Take out part of get_local_pda referencing __init function (free_bootmem)
to new (static) function marked as __ref. It's safe to do because free_bootmem
is called before __init sections are dropped.

WARNING: vmlinux.o(.cpuinit.text+0x3cd7): Section mismatch in reference from the function get_local_pda() to the function .init.text:free_bootmem()
The function __cpuinit get_local_pda() references
a function __init free_bootmem().
If free_bootmem is only used by get_local_pda then
annotate free_bootmem with a matching annotation.

Signed-off-by: default avatarMarcin Slusarz <marcin.slusarz@gmail.com>
Cc: Mike Travis <travis@sgi.com>
Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
parent c6a92a25
Loading
Loading
Loading
Loading
+9 −2
Original line number Original line Diff line number Diff line
@@ -756,6 +756,14 @@ static void __cpuinit do_fork_idle(struct work_struct *work)
}
}


#ifdef CONFIG_X86_64
#ifdef CONFIG_X86_64

/* __ref because it's safe to call free_bootmem when after_bootmem == 0. */
static void __ref free_bootmem_pda(struct x8664_pda *oldpda)
{
	if (!after_bootmem)
		free_bootmem((unsigned long)oldpda, sizeof(*oldpda));
}

/*
/*
 * Allocate node local memory for the AP pda.
 * Allocate node local memory for the AP pda.
 *
 *
@@ -784,8 +792,7 @@ int __cpuinit get_local_pda(int cpu)


	if (oldpda) {
	if (oldpda) {
		memcpy(newpda, oldpda, size);
		memcpy(newpda, oldpda, size);
		if (!after_bootmem)
		free_bootmem_pda(oldpda);
			free_bootmem((unsigned long)oldpda, size);
	}
	}


	newpda->in_bootmem = 0;
	newpda->in_bootmem = 0;