From: Jeff Garzik <jgarzik@pobox.com>
To: "Randy.Dunlap" <rddunlap@osdl.org>
Cc: rmk@arm.linux.org.uk, netdev@oss.sgi.com
Subject: Re: [janitor] remove casts in drivers/net/arm/
Date: Tue, 02 Mar 2004 14:07:36 -0500 [thread overview]
Message-ID: <4044DB78.7040309@pobox.com> (raw)
In-Reply-To: <20040302110237.0f580736.rddunlap@osdl.org>
Randy.Dunlap wrote:
> On Tue, 02 Mar 2004 13:54:36 -0500 Jeff Garzik wrote:
>
> | Russell King wrote:
> | > On Sun, Feb 29, 2004 at 02:34:36PM -0800, Randy.Dunlap wrote:
> | >
> | >> drivers/net/arm/am79c961a.c | 18 +++++++++---------
> | >> drivers/net/arm/ether1.c | 18 +++++++++---------
> | >> drivers/net/arm/ether3.c | 18 +++++++++---------
> | >> drivers/net/arm/etherh.c | 4 ++--
> | >> 4 files changed, 29 insertions(+), 29 deletions(-)
> | >
> | >
> | > I think we should really consider using netdev_priv() in all these places
> | > so the compiler knows that 'dev' and 'priv' are related.
> |
> |
> | Good point.
>
> I respectfully disagree, but if the maintainter won't merge
> them as is, so be it.
>
> I have trouble understanding why this:
> return (char *)dev + ((sizeof(struct net_device) + 31) & ~31);
> is better than using a structure->field, i.e.,
> dev->priv
>
> Can one of you enlighten me?
One is an additional pointer load and dereference, and one is a constant
offset from the beginning of the dev structure, calculated at compile
time. netdev_priv() provides the same results as dev->priv but at less
cost.
Jeff
next prev parent reply other threads:[~2004-03-02 19:07 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20040229142516.3d218ed0.rddunlap@osdl.org>
2004-02-29 22:34 ` [janitor] remove casts in drivers/net/arm/ Randy.Dunlap
2004-03-02 12:10 ` Russell King
[not found] ` <4044D86C.70709@pobox.com>
2004-03-02 19:02 ` Randy.Dunlap
2004-03-02 19:07 ` Jeff Garzik [this message]
2004-03-02 19:17 ` Randy.Dunlap
2004-03-02 19:29 ` Jeff Garzik
2004-03-02 19:36 ` Russell King
2004-02-29 22:35 ` [janitor] remove unneeded casts in /hamradio/ Randy.Dunlap
2004-02-29 22:35 ` [janitor] remove unneeded casts in /appletalk/ & /fc/ Randy.Dunlap
2004-02-29 22:38 ` [janitor] remove unneeded casts in net/pcmcia/ Randy.Dunlap
2004-02-29 22:40 ` [janitor] remove unneeded casts in net/wan/ Randy.Dunlap
2004-02-29 22:42 ` [janitor] remove unneeded casts in net/wireless/ Randy.Dunlap
2004-02-29 22:53 ` [janitor] remove unneeded casts in lance drivers Randy.Dunlap
2004-02-29 22:54 ` [janitor] remove unneeded casts in 3com drivers Randy.Dunlap
2004-02-29 22:56 ` [janitor] remove unneeded casts in intel-ee drivers Randy.Dunlap
2004-02-29 22:57 ` [janitor] remove unneeded casts in generic drivers/net/ Randy.Dunlap
2004-02-29 23:01 ` [janitor] remove unneeded casts in 3c527 Randy.Dunlap
2004-02-29 23:02 ` [janitor] remove unneeded casts (others) Randy.Dunlap
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=4044DB78.7040309@pobox.com \
--to=jgarzik@pobox.com \
--cc=netdev@oss.sgi.com \
--cc=rddunlap@osdl.org \
--cc=rmk@arm.linux.org.uk \
/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).