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 [EMAIL PROTECTED]
More majordomo info at http://vger.kernel.org/majordomo-info.html