[lkml]   [2008]   [Jun]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
Patch in this message
SubjectRe: 2.6.26-rc7: x86 build error

Adrian Bunk <> writes:

> Commit d3942cff620bea073fc4e3c8ed878eb1e84615ce
> (x86: use BOOTMEM_EXCLUSIVE on 32-bit)
> causes the following compile error:
> <-- snip -->
> ...
> CC arch/x86/kernel/setup_32.o
> /home/bunk/linux/kernel-2.6/git/linux-2.6/arch/x86/kernel/setup_32.c: In function ‘reserve_crashkernel’:
> /home/bunk/linux/kernel-2.6/git/linux-2.6/arch/x86/kernel/setup_32.c:536: error: void value not ignored as it ought to be
> make[2]: *** [arch/x86/kernel/setup_32.o] Error 1
> <-- snip -->
> reserve_bootmem_node() returns void seems to cause it.

Yes, this triggers it since reserve_bootmem() is then defined to be
reserve_bootmem_node() which returns void while the
!CONFIG_HAVE_ARCH_BOOTMEM_NODE version of reserve_bootmem() in bootmem.c
already returns int.

The following fix is needed:


From: Bernhard Walle <>
Subject: Add return value to reserve_bootmem_node()

This patch changes the function reserve_bootmem_node() from void to int,
returning -ENOMEM if the allocation fails.

Signed-off-by: Bernhard Walle <>;


Actually, there was a discussion to return -EBUSY instead of -ENOMEM but
in the end it does not matter, because callsites just check for negative
return values. -hannes

include/linux/bootmem.h | 2 +-
mm/bootmem.c | 6 ++++--
2 files changed, 5 insertions(+), 3 deletions(-)
--- a/include/linux/bootmem.h
+++ b/include/linux/bootmem.h
@@ -94,7 +94,7 @@ extern unsigned long init_bootmem_node(p
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);
--- a/mm/bootmem.c
+++ b/mm/bootmem.c
@@ -442,15 +442,17 @@ unsigned long __init init_bootmem_node(p
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,
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at
 \ /
  Last update: 2008-06-21 19:05    [W:0.099 / U:0.068 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site