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]
Message-ID: <m2ipe72u78.fsf@igel.home>
Date:	Sun, 01 Jul 2012 20:48:59 +0200
From:	Andreas Schwab <schwab@...ux-m68k.org>
To:	Joe Perches <joe@...ches.com>
Cc:	Ben Hutchings <bhutchings@...arflare.com>,
	Or Gerlitz <ogerlitz@...lanox.com>, davem@...emloft.net,
	roland@...nel.org, yevgenyp@...lanox.com, oren@...lanox.com,
	netdev@...r.kernel.org, Hadar Hen Zion <hadarh@...lanox.co.il>
Subject: Re: [PATCH net-next 09/10] net/mlx4_en: Manage flow steering rules with ethtool

Joe Perches <joe@...ches.com> writes:

> On Sun, 2012-07-01 at 09:38 -0700, Joe Perches wrote:
>
>> I think this macro is suboptimal because
>> negated names are easy to misuse.
>> 
>> I think type is also unnecessary and too
>> easy to mismatch or keep up to date with
>> field type changes.
>> 
>> Perhaps it's better as:
>> 
>> #define all_zeros_or_all_ones(field)		\
>> ({						\
>> 	field && (typeof(field))~field;		\
>> })
>
> Umm, or not.
>
> It helps when I actually test the code not just type
> it into an email client.
>
> 	!(field && (typeof(field))~field)

Or write it as (!field || !(typeof(field))~field) which more closely
resembles what the macro name expresses.

Andreas.

-- 
Andreas Schwab, schwab@...ux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."
--
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