[PATCH v5 3/7] PCI: initial commit
Antony Pavlov
antonynpavlov at gmail.com
Tue Jul 8 02:48:43 PDT 2014
On Tue, 8 Jul 2014 08:29:34 +0200
Sascha Hauer <s.hauer at pengutronix.de> wrote:
> On Tue, Jul 08, 2014 at 01:23:46AM +0400, Antony Pavlov wrote:
> > On Mon, 7 Jul 2014 20:22:10 +0200
> > Jean-Christophe PLAGNIOL-VILLARD <plagnioj at jcrosoft.com> wrote:
> >
> > > > +static struct pci_bus *pci_alloc_bus(void)
> > > > +{
> > > > + struct pci_bus *b;
> > > > +
> > > > + b = kzalloc(sizeof(*b), GFP_KERNEL);
> > >
> > > if (!b)
> > > return b;
> >
> > kzalloc() eventually calls xmalloc().
> > xmalloc() calls panic() if malloc fails, so there is no need to check b at all.
>
> Then let's use xzalloc directly here. I think only the x functions
> should panic on failure. kzalloc should be implemented with
> malloc or calloc.
The PCI series consist much code from original August 2011 patchseries
(e.g. see http://lists.infradead.org/pipermail/barebox/2011-August/004349.html).
Some things have changed since 2011.
I'll prepare fix patches.
Can we ammend them into the PCI patch series (already in the 'next' but not in the 'master'?)
--
Best regards,
Antony Pavlov
More information about the barebox
mailing list