From: Matt Mackall <mpm@selenic.com>
To: Jeff Garzik <jgarzik@pobox.com>
Cc: Michael Chan <mchan@broadcom.com>,
"David S. Miller" <davem@davemloft.net>,
netdev@oss.sgi.com
Subject: Re: [PATCH 2.6.11 1/8] tg3: add 5705_plus flag
Date: Wed, 23 Mar 2005 17:51:52 -0800 [thread overview]
Message-ID: <20050324015152.GB25554@waste.org> (raw)
In-Reply-To: <4240858B.5080209@pobox.com>
On Tue, Mar 22, 2005 at 03:52:27PM -0500, Jeff Garzik wrote:
> Michael Chan wrote:
> >Add a 5705_plus flag to indicate the device is 5705, 5750, or future chips
> >that all share the same basic architecture. This makes it easier to add
> >support for future devices.
> >
> >
> >Signed-off-by: Michael Chan <mchan@broadcom.com
>
> ACK, and two comments:
>
> 1) In general, I encourage changes like this, for both tg3 and other net
> drivers. It is -much- better to define a feature flag, and test the
> feature flag in the source code, than to define a list of affected
> [chips | arches]. Changes like this
>
> - if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5705 ||
> - GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5750) {
> + if (tp->tg3_flags2 & TG3_FLG2_5705_PLUS) {
>
> can be an example to others for future changes.
Except this isn't really a feature flag, per se. That would be
something like TG3_HAS_FOO, in other words "what particular feature
this if statement actually cares about". What is currently 5705_PLUS
would then be a bunch of flags HAS_SENSIBLE_X | HAS_FAST_Y | HAS_WORKING_Z.
The "family flag" approach is fine until you run into something that
has X and Y but not Z.
--
Mathematics is the supreme nostalgia of our time.
next prev parent reply other threads:[~2005-03-24 1:51 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-03-21 7:14 [PATCH 2.6.11 1/8] tg3: add 5705_plus flag Michael Chan
2005-03-22 20:52 ` Jeff Garzik
2005-03-24 1:51 ` Matt Mackall [this message]
2005-03-23 19:03 ` David S. 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=20050324015152.GB25554@waste.org \
--to=mpm@selenic.com \
--cc=davem@davemloft.net \
--cc=jgarzik@pobox.com \
--cc=mchan@broadcom.com \
--cc=netdev@oss.sgi.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).