Jeff Garzik wrote:
Kok, Auke wrote:
Maybe this is not most important for ixgbe, where we only have 8 or so
flags, but the new e1000 driver that I posted this weekend currently has
63 (you wanted flags ;)) of them. Do you want me to use 63 integers or
just 2 ?
Don't be silly. We are talking about single-bit feature flags
implemented using machine ints (a la tg3 with 32 flags per int), versus
bitfields.
tg3.c:
if ((tp->tg3_flags & TG3_FLAG_PCIX_TARGET_HWBUG) ||
(tp->tg3_flags2 & TG3_FLG2_ICH_WORKAROUND))
is obviously _not_ easier to read than
if (tp->tg3_flags.pcix_target_hwbug || tp->tg3_flags.ich_workaround)
you even have to cascade your flags into a second integer, prone to error and
confusion!
I would say that this method is definately worse for readability. I would much
rather then stick with 'bool' instead.
Auke
-
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