Skip to content

Commit

Permalink
Add return value to reserve_bootmem_node()
Browse files Browse the repository at this point in the history
This patch changes the function reserve_bootmem_node() from void to int,
returning -ENOMEM if the allocation fails.

This fixes a build problem on x86 with CONFIG_KEXEC=y and
CONFIG_NEED_MULTIPLE_NODES=y

Signed-off-by: Bernhard Walle <[email protected]>
Reported-by: Adrian Bunk <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
Bernhard Walle authored and torvalds committed Jun 21, 2008
1 parent a192144 commit 71c2742
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion include/linux/bootmem.h
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ extern unsigned long init_bootmem_node(pg_data_t *pgdat,
unsigned long freepfn,
unsigned long startpfn,
unsigned long endpfn);
extern void reserve_bootmem_node(pg_data_t *pgdat,
extern int reserve_bootmem_node(pg_data_t *pgdat,
unsigned long physaddr,
unsigned long size,
int flags);
Expand Down
6 changes: 4 additions & 2 deletions mm/bootmem.c
Original file line number Diff line number Diff line change
Expand Up @@ -442,15 +442,17 @@ unsigned long __init init_bootmem_node(pg_data_t *pgdat, unsigned long freepfn,
return init_bootmem_core(pgdat, freepfn, startpfn, endpfn);
}

void __init reserve_bootmem_node(pg_data_t *pgdat, unsigned long physaddr,
int __init reserve_bootmem_node(pg_data_t *pgdat, unsigned long physaddr,
unsigned long size, int flags)
{
int ret;

ret = can_reserve_bootmem_core(pgdat->bdata, physaddr, size, flags);
if (ret < 0)
return;
return -ENOMEM;
reserve_bootmem_core(pgdat->bdata, physaddr, size, flags);

return 0;
}

void __init free_bootmem_node(pg_data_t *pgdat, unsigned long physaddr,
Expand Down

0 comments on commit 71c2742

Please sign in to comment.