[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <46891FC9.9060307@intel.com>
Date: Mon, 02 Jul 2007 08:54:49 -0700
From: "Kok, Auke" <auke-jan.h.kok@...el.com>
To: Jeff Garzik <jeff@...zik.org>
CC: Arjan van de Ven <arjan@...ux.intel.com>,
Ayyappan Veeraiyan <ayyappan.veeraiyan@...el.com>,
netdev@...r.kernel.org, akpm@...ux-foundation.org
Subject: Re: [PATCH] ixgbe: Introduce new 10GbE driver for Intel 82598 based
PCI Express adapters...
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 majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists