mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Sascha Hauer <s.hauer@pengutronix.de>
To: Antony Pavlov <antonynpavlov@gmail.com>
Cc: barebox@lists.infradead.org
Subject: Re: [PATCH v5 3/7] PCI: initial commit
Date: Tue, 8 Jul 2014 08:29:34 +0200	[thread overview]
Message-ID: <20140708062934.GB23282@pengutronix.de> (raw)
In-Reply-To: <20140708012346.2b0e75d53710d0dc68d5afac@gmail.com>

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

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@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

  reply	other threads:[~2014-07-08  6:30 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-03 21:26 [PATCH v5 0/7] barebox PCI support Antony Pavlov
2014-07-03 21:27 ` [PATCH v5 1/7] linux/ioport.h: include missed <linux/list.h> Antony Pavlov
2014-07-03 21:27 ` [PATCH v5 2/7] MIPS: add dma_alloc_coherent() Antony Pavlov
2014-07-03 21:27 ` [PATCH v5 3/7] PCI: initial commit Antony Pavlov
2014-07-07 18:22   ` Jean-Christophe PLAGNIOL-VILLARD
2014-07-07 21:23     ` Antony Pavlov
2014-07-08  6:29       ` Sascha Hauer [this message]
2014-07-08  9:48         ` Antony Pavlov
2014-07-08  9:51           ` Sascha Hauer
2014-07-08  9:50     ` Antony Pavlov
2014-07-08  9:53       ` Jean-Christophe PLAGNIOL-VILLARD
2014-07-03 21:27 ` [PATCH v5 4/7] commands: add 'lspci' command Antony Pavlov
2014-07-03 21:27 ` [PATCH v5 5/7] net: add RealTek RTL-8139 PCI Ethernet driver Antony Pavlov
2014-07-03 21:27 ` [PATCH v5 6/7] MIPS: add PCI support for GT64120-based Malta board Antony Pavlov
2014-07-03 21:27 ` [PATCH v5 7/7] MIPS: qemu-malta_defconfig: enable PCI & network stuff Antony Pavlov
2014-07-04  5:38 ` [PATCH v5 0/7] barebox PCI support Sascha Hauer

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=20140708062934.GB23282@pengutronix.de \
    --to=s.hauer@pengutronix.de \
    --cc=antonynpavlov@gmail.com \
    --cc=barebox@lists.infradead.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox