Subject: Re: [PATCH] ixgbe: Introduce new 10GbE driver for Intel 82598 based PCI Express adapters...

From: "Kok, Auke" <[email-masked]>
Date: Mon, 02 Jul 2007 08:54:49 -0700

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