Re: [PATCH v5 3/7] PCI: initial commit

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxxx> 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.

Sascha

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/barebox




[Index of Archives]     [Linux Embedded]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux