From: Jeff Garzik <jeff@garzik.org>
To: Stephen Hemminger <shemminger@linux-foundation.org>
Cc: David Miller <davem@davemloft.net>,
netdev@vger.kernel.org, Ariel.Hendel@sun.com,
greg.onufer@sun.com
Subject: Re: [PATCH]: Preliminary release of Sun Neptune driver
Date: Wed, 19 Sep 2007 18:05:25 -0400 [thread overview]
Message-ID: <46F19D25.2010403@garzik.org> (raw)
In-Reply-To: <20070919145900.759ef19e@freepuppy.rosehill.hemminger.net>
Stephen Hemminger wrote:
> O
>> +#define DRV_MODULE_NAME "niu"
>> +#define PFX DRV_MODULE_NAME ": "
>> +#define DRV_MODULE_VERSION "0.06"
>> +#define DRV_MODULE_RELDATE "September 18, 2007"
>> +
>> +static char version[] __devinitdata =
>> + DRV_MODULE_NAME ".c:v" DRV_MODULE_VERSION " (" DRV_MODULE_RELDATE ")\n";
>> +
>> +MODULE_AUTHOR("David S. Miller (davem@davemloft.net)");
>> +MODULE_DESCRIPTION("NIU ethernet driver");
>> +MODULE_LICENSE("GPL");
>> +MODULE_VERSION(DRV_MODULE_VERSION);
>> +
>> +#ifndef DMA_44BIT_MASK
>> +#define DMA_44BIT_MASK 0x00000fffffffffffULL
>> +#endif
>> +
>> +#ifndef PCI_DEVICE_ID_SUN_NEPTUNE
>> +#define PCI_DEVICE_ID_SUN_NEPTUNE 0xabcd
>> +#endif
>
> Why bother defining the ID
Yes, its pointless to use anything but the hex number for PCI IDs that
are only used in a single place.
>> +static struct pci_device_id niu_pci_tbl[] = {
>> + {PCI_DEVICE(PCI_VENDOR_ID_SUN, PCI_DEVICE_ID_SUN_NEPTUNE),
>> + .driver_data = 0xff},
>> + {}
>> +};
>> +
>> +MODULE_DEVICE_TABLE(pci, niu_pci_tbl);
>> +
>> +#define NIU_TX_TIMEOUT (5 * HZ)
>> +
>> +#define nr64(reg) readq(np->regs + (reg))
>> +#define nw64(val, reg) writeq((val), np->regs + (reg))
>
> Macro's that make assumptions about context (ie variable name np)
> are evil and bad style.
No, that's a common and encouraged convenience that makes the code a lot
easier to read.
That said, the 2-arg macro arg order is wrong. It should be (reg,val)
like tg3 and other drivers.
Jeff
next prev parent reply other threads:[~2007-09-19 22:05 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-09-18 22:15 [PATCH]: Preliminary release of Sun Neptune driver David Miller
2007-09-19 21:59 ` Stephen Hemminger
2007-09-19 22:05 ` Jeff Garzik [this message]
2007-09-19 22:11 ` David Miller
2007-09-19 22:37 ` Jeff Garzik
2007-09-19 22:07 ` David Miller
2007-09-19 22:40 ` Jeff Garzik
2007-09-19 23:05 ` Stephen Hemminger
2007-09-19 23:17 ` David Miller
2007-09-19 23:20 ` Rick Jones
2007-09-19 23:53 ` David Miller
2007-09-20 16:06 ` Ariel Hendel
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=46F19D25.2010403@garzik.org \
--to=jeff@garzik.org \
--cc=Ariel.Hendel@sun.com \
--cc=davem@davemloft.net \
--cc=greg.onufer@sun.com \
--cc=netdev@vger.kernel.org \
--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).