All of lore.kernel.org
 help / color / mirror / Atom feed
From: Johannes Weiner <hannes@saeurebad.de>
To: Adrian Bunk <bunk@kernel.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>,
	Bernhard Walle <bwalle@suse.de>, Ingo Molnar <mingo@elte.hu>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	stable@kernel.org
Subject: Re: 2.6.26-rc7: x86 build error
Date: Sat, 21 Jun 2008 19:01:02 +0200	[thread overview]
Message-ID: <87y74yn2nl.fsf@skyscraper.fehenstaub.lan> (raw)
In-Reply-To: <20080621095537.GA27069@cs181133002.pp.htv.fi> (Adrian Bunk's message of "Sat, 21 Jun 2008 12:55:37 +0300")

Hi,

Adrian Bunk <bunk@kernel.org> 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  -->
>
> CONFIG_KEXEC=y, CONFIG_NEED_MULTIPLE_NODES=y and the fact that 
> 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 <bwalle@suse.de>
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 <bwalle@suse.de>;

---

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,

  reply	other threads:[~2008-06-21 17:01 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-06-20 23:42 Linux 2.6.26-rc7 Linus Torvalds
2008-06-21  9:55 ` 2.6.26-rc7: x86 build error Adrian Bunk
2008-06-21 17:01   ` Johannes Weiner [this message]
2008-06-22  7:12 ` Linux 2.6.26-rc7 Jeff Chua
2008-06-22 16:29   ` Linus Torvalds
2008-06-22 17:26     ` Linus Torvalds
2008-06-23 15:21       ` Jeff Chua
2008-06-23 15:18     ` Jeff Chua
2008-06-22 16:58   ` Arjan van de Ven
2008-06-23 15:26     ` Jeff Chua

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87y74yn2nl.fsf@skyscraper.fehenstaub.lan \
    --to=hannes@saeurebad.de \
    --cc=bunk@kernel.org \
    --cc=bwalle@suse.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=stable@kernel.org \
    --cc=torvalds@linux-foundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.