lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
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

Powered by Openwall GNU/*/Linux Powered by OpenVZ