From: linas@austin.ibm.com (Linas Vepstas)
To: Stephen Rothwell <sfr@canb.auug.org.au>
Cc: ppc-dev <linuxppc-dev@ozlabs.org>, paulus@samba.org
Subject: [PATCH] powerpc: another use of zalloc_maybe_bootmem()
Date: Tue, 2 Oct 2007 16:40:12 -0500 [thread overview]
Message-ID: <20071002214012.GL4338@austin.ibm.com> (raw)
In-Reply-To: <20071002133753.662397db.sfr@canb.auug.org.au>
Use alloc_maybe_bootmem() which wraps the if(mem_init_done)
malloc clause.
Signed-off-by: Linas Vepstas <linas@austin.ibm.com>
----
On Tue, Oct 02, 2007 at 01:37:53PM +1000, Stephen Rothwell wrote:
> This patch introduces zalloc_maybe_bootmem and uses it so that we don;t
> have to mark a whole (largish) routine as __init_ref_ok.
sfr missed a spot -- may as well get rid of this one too.
arch/powerpc/kernel/pci-common.c | 7 ++-----
1 file changed, 2 insertions(+), 5 deletions(-)
Index: linux-2.6.23-rc8-mm1/arch/powerpc/kernel/pci-common.c
===================================================================
--- linux-2.6.23-rc8-mm1.orig/arch/powerpc/kernel/pci-common.c 2007-09-26 15:02:41.000000000 -0500
+++ linux-2.6.23-rc8-mm1/arch/powerpc/kernel/pci-common.c 2007-10-02 16:28:16.000000000 -0500
@@ -65,14 +65,11 @@ static void __devinit pci_setup_pci_cont
spin_unlock(&hose_spinlock);
}
-__init_refok struct pci_controller * pcibios_alloc_controller(struct device_node *dev)
+struct pci_controller * pcibios_alloc_controller(struct device_node *dev)
{
struct pci_controller *phb;
- if (mem_init_done)
- phb = kmalloc(sizeof(struct pci_controller), GFP_KERNEL);
- else
- phb = alloc_bootmem(sizeof (struct pci_controller));
+ phb = alloc_maybe_bootmem(sizeof(struct pci_controller), GFP_KERNEL);
if (phb == NULL)
return NULL;
pci_setup_pci_controller(phb);
prev parent reply other threads:[~2007-10-02 21:40 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-10-02 3:37 [PATCH] [POWERPC] Limit range of __init_ref_ok somewhat Stephen Rothwell
2007-10-02 11:42 ` mem_init_done (was: Re: [PATCH] [POWERPC] Limit range of __init_ref_ok somewhat) Geert Uytterhoeven
2007-10-02 21:40 ` Linas Vepstas [this message]
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=20071002214012.GL4338@austin.ibm.com \
--to=linas@austin.ibm.com \
--cc=linuxppc-dev@ozlabs.org \
--cc=paulus@samba.org \
--cc=sfr@canb.auug.org.au \
/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.