mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Linus Torvalds <torvalds@osdl.org>
To: Jeff Garzik <jgarzik@pobox.com>
Cc: Franz Pletz <franz_pletz@t-online.de>,
	Michal Rokos <michal@rokos.info>,
	Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Andrew Morton <akpm@osdl.org>,
	Manfred Spraul <manfred@colorfullife.com>,
	"David S. Miller" <davem@davemloft.net>
Subject: Re: [PATCH 2.6] Natsemi - remove compilation warnings
Date: Thu, 30 Sep 2004 11:33:28 -0700 (PDT)	[thread overview]
Message-ID: <Pine.LNX.4.58.0409301129540.2403@ppc970.osdl.org> (raw)
In-Reply-To: <415C4EC5.4040603@pobox.com>



On Thu, 30 Sep 2004, Jeff Garzik wrote:
> >  
> > +static inline void __iomem *ns_ioaddr(struct net_device *dev)
> > +{
> > +	return (void __iomem *) dev->base_addr;
> > +}
> > +
> 
> hmmmm.  Since dev->base_addr gets exported to userspace, I don't think 
> it's that quick/easy to change.

Hmm? This maintains the _exact_ old semantics, ie we do exactly what it 
used to do before. The inline function doesn't save the value off 
anywhere, it's really just a nicer way to do a cast in _one_ place rather 
than all over the world. Also, it ends up resulting in just _one_ place 
that knows where to get the base address, instead of several places in 
pretty much every function in the whole driver ;-P

> Wouldn't it be better to just phase out the base of dev->base_addr 
> completely?  I tend to prefer adding a "void __iomem *regs" to struct 
> netdev_private, and ignore dev->base_addr completely.

Yes. I didn't want to change actual behaviour in a driver that I can't 
even test, so I went for the semantically 100% equivalent cleanup patch 
instead that just changes the syntax and gets rid of the warnings.

But that's the other advantage of the ns_ioaddr() accessor function:  
somebody who does have the hw can now phase out "base_addr", and just
change that one one-liner function, and you can now get the base address
from anywhere you like ;)

		Linus

  reply	other threads:[~2004-09-30 18:33 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-09-23  7:58 Michal Rokos
2004-09-23 14:18 ` Michal Rokos
2004-09-30 16:44   ` Franz Pletz
2004-09-30 17:24     ` Linus Torvalds
2004-09-30 18:09       ` Andrey S. Klochko
2004-09-30 18:22         ` Linus Torvalds
2004-09-30 18:16       ` Franz Pletz
2004-09-30 18:21       ` Jeff Garzik
2004-09-30 18:33         ` Linus Torvalds [this message]
2004-09-30 18:40         ` Tim Hockin
2004-09-30 19:53         ` David S. Miller
2004-09-30 20:08           ` Jeff Garzik

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=Pine.LNX.4.58.0409301129540.2403@ppc970.osdl.org \
    --to=torvalds@osdl.org \
    --cc=akpm@osdl.org \
    --cc=davem@davemloft.net \
    --cc=franz_pletz@t-online.de \
    --cc=jgarzik@pobox.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=manfred@colorfullife.com \
    --cc=michal@rokos.info \
    /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

all inboxes | Powered by JetHome®