netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Miller <davem@davemloft.net>
To: jeff@garzik.org
Cc: shemminger@linux-foundation.org, romieu@fr.zoreil.com,
	netdev@vger.kernel.org
Subject: Re: [PATCH] 8139too: use err.h macros
Date: Sun, 23 Nov 2008 13:53:11 -0800 (PST)	[thread overview]
Message-ID: <20081123.135311.74121589.davem@davemloft.net> (raw)
In-Reply-To: <20081123183645.GA11340@havoc.gtf.org>

From: Jeff Garzik <jeff@garzik.org>
Date: Sun, 23 Nov 2008 13:36:45 -0500

> On Sun, Nov 23, 2008 at 10:22:37AM -0800, Stephen Hemminger wrote:
> > Instead of using call by reference use the PTR_ERR macros to handle
> > return value with error case. Compile tested only.
> > 
> > Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
> > 
> > --- a/drivers/net/8139too.c	2008-11-23 10:16:26.000000000 -0800
> > +++ b/drivers/net/8139too.c	2008-11-23 10:19:05.000000000 -0800
> > @@ -741,8 +741,7 @@ static void rtl8139_chip_reset (void __i
> >  }
> >  
> >  
> > -static int __devinit rtl8139_init_board (struct pci_dev *pdev,
> > -					 struct net_device **dev_out)
> > +static __devinit struct net_device * rtl8139_init_board (struct pci_dev *pdev)
> >  {
> >  	void __iomem *ioaddr;
> >  	struct net_device *dev;
> 
> I won't NAK this, but I do wonder why a solution based on yucky
> magic typecasting is preferred...?

Two return values without having to return it by reference
as an argument.

I blogged about the pros and cons of this earlier this year.

  parent reply	other threads:[~2008-11-23 21:53 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-11-23 18:22 [PATCH] 8139too: use err.h macros Stephen Hemminger
2008-11-23 18:36 ` Jeff Garzik
2008-11-23 18:45   ` Stephen Hemminger
2008-11-23 21:53   ` David Miller [this message]
2008-11-23 22:31     ` Francois Romieu
2008-11-24 22:47 ` David Miller

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=20081123.135311.74121589.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=jeff@garzik.org \
    --cc=netdev@vger.kernel.org \
    --cc=romieu@fr.zoreil.com \
    --cc=shemminger@linux-foundation.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;
as well as URLs for NNTP newsgroup(s).