Skip to content

Commit

Permalink
x86_64: fix section mismatch warning in init.c
Browse files Browse the repository at this point in the history
Fix following warning:
WARNING: vmlinux.o(.text+0x188ea): Section mismatch: reference to .init.text:__alloc_bootmem_core (between 'alloc_bootmem_high_node' and 'get_gate_vma')

alloc_bootmem_high_node() is only used from __init scope so declare it __init.
And in addition declare the weak variant __init too.

Signed-off-by: Sam Ravnborg <[email protected]>
Signed-off-by: Andi Kleen <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
sravnborg authored and Linus Torvalds committed Jul 22, 2007
1 parent 7aa6ec5 commit dec2e6b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion arch/x86_64/mm/init.c
Original file line number Diff line number Diff line change
Expand Up @@ -724,7 +724,7 @@ int in_gate_area_no_task(unsigned long addr)
return (addr >= VSYSCALL_START) && (addr < VSYSCALL_END);
}

void *alloc_bootmem_high_node(pg_data_t *pgdat, unsigned long size)
void * __init alloc_bootmem_high_node(pg_data_t *pgdat, unsigned long size)
{
return __alloc_bootmem_core(pgdat->bdata, size,
SMP_CACHE_BYTES, (4UL*1024*1024*1024), 0);
Expand Down
2 changes: 1 addition & 1 deletion mm/sparse.c
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ static int __meminit sparse_init_one_section(struct mem_section *ms,
return 1;
}

__attribute__((weak))
__attribute__((weak)) __init
void *alloc_bootmem_high_node(pg_data_t *pgdat, unsigned long size)
{
return NULL;
Expand Down

0 comments on commit dec2e6b

Please sign in to comment.