netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: tsbogend@alpha.franken.de (Thomas Bogendoerfer)
To: Francois Romieu <romieu@fr.zoreil.com>
Cc: netdev@vger.kernel.org, akpm@linux-foundation.org, jgarzik@pobox.com
Subject: Re: [PATCH UPDATE]  Extract chip specific code out of lasi_82596.c
Date: Wed, 27 Jun 2007 00:17:36 +0200	[thread overview]
Message-ID: <20070626221736.GA22252@alpha.franken.de> (raw)
In-Reply-To: <20070626214755.GA11551@electric-eye.fr.zoreil.com>

On Tue, Jun 26, 2007 at 11:47:55PM +0200, Francois Romieu wrote:
> Thomas Bogendoerfer <tsbogend@alpha.franken.de> :
> [...]
> > +static inline void init_rx_bufs(struct net_device *dev)
> > +{
> > +	struct i596_private *lp = netdev_priv(dev);
> > +	struct i596_dma *dma = lp->dma;
> > +	int i;
> > +	struct i596_rfd *rfd;
> > +	struct i596_rbd *rbd;
> > +
> > +	/* First build the Receive Buffer Descriptor List */
> > +
> > +	for (i = 0, rbd = dma->rbds; i < rx_ring_size; i++, rbd++) {
> > +		dma_addr_t dma_addr;
> > +		struct sk_buff *skb = dev_alloc_skb(PKT_BUF_SZ + 4);
> > +
> > +		if (skb == NULL)
> > +			panic(KERN_ERR "%s: alloc_skb() failed", __FILE__);
> 
> The driver could use netdev_alloc_skb.

what's the advantage ?

> init_rx_bufs() should handle failure more gracefully and return a proper
> status code.

of course.

> 
> [...]
> > +static int init_i596_mem(struct net_device *dev)
> > +{
> [...]
> > +	if (request_irq(dev->irq, &i596_interrupt, 0, "i82596", dev)) {
> > +		printk(KERN_ERR "%s: IRQ %d not free\n", dev->name, dev->irq);
> > +		goto failed_free_irq;
> > +	}
> [...]
> > +failed_free_irq:
> > +	free_irq(dev->irq, dev);
> 
> Oops.

thanks, will fix.

Thomas.

-- 
Crap can work. Given enough thrust pigs will fly, but it's not necessary a
good idea.                                                [ RFC1925, 2.3 ]

  reply	other threads:[~2007-06-26 22:17 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-06-26 20:51 [PATCH UPDATE] Extract chip specific code out of lasi_82596.c Thomas Bogendoerfer
2007-06-26 21:47 ` Francois Romieu
2007-06-26 22:17   ` Thomas Bogendoerfer [this message]
2007-06-27 19:39     ` Francois Romieu

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=20070626221736.GA22252@alpha.franken.de \
    --to=tsbogend@alpha.franken.de \
    --cc=akpm@linux-foundation.org \
    --cc=jgarzik@pobox.com \
    --cc=netdev@vger.kernel.org \
    --cc=romieu@fr.zoreil.com \
    /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;
as well as URLs for NNTP newsgroup(s).