[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <46F1A545.7010700@garzik.org>
Date: Wed, 19 Sep 2007 18:40:05 -0400
From: Jeff Garzik <jeff@...zik.org>
To: David Miller <davem@...emloft.net>
CC: shemminger@...ux-foundation.org, netdev@...r.kernel.org,
Ariel.Hendel@....com, greg.onufer@....com
Subject: Re: [PATCH]: Preliminary release of Sun Neptune driver
David Miller wrote:
>> Macro's that make assumptions about context (ie variable name np)
>> are evil and bad style.
>
> Too bad, it saves developers who write 20,000 line drivers from carpel
> tunnel symdrome.
>
> It's so repetitive to state things over and over again, and this macro
> scheme is 1) established widely (tg3 amonst many other drivers do it)
> and 2) forces the driver to use a consistent naming convention for
> primary driver private struct variables.
It also makes review easier -- IMO an important factor.
Which is more clear at a glance:
status = tr32(MAC_STAT_1);
or
status = foo_mac_read32(priv, MAC_STAT_1);
?
tg3 and other net drivers show that this technique improves code
readability.
Jeff
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists