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, 11 Feb 2008 11:25:42 -0800 (PST)
From:	David Rientjes <rientjes@...gle.com>
To:	Andi Kleen <ak@...e.de>
cc:	Andrew Morton <akpm@...ux-foundation.org>,
	Paul Jackson <pj@....com>,
	Christoph Lameter <clameter@....com>,
	Lee Schermerhorn <Lee.Schermerhorn@...com>,
	linux-kernel@...r.kernel.org
Subject: Re: [patch 1/4] mempolicy: convert MPOL constants to enum

On Mon, 11 Feb 2008, Andi Kleen wrote:

> > The mempolicy mode constants, MPOL_DEFAULT, MPOL_PREFERRED, MPOL_BIND,
> > and MPOL_INTERLEAVE, are better declared as part of an enum for type
> > checking.
> 
> What type checking? There is none in standard C for enums.
> 

"Type checking" probably isn't the best description for it.  As I 
mentioned in the changelog for the second patch in this series, a function 
with a formal type of 'enum mempolicy_mode' indicates that the optional 
mode flags have already been stripped off and the only possible values are 
those of 'enum mempolicy_mode'.  The implementation will not need to use 
mpol_mode() in conditionals or switch statements.  I think it's a clean 
way of describing what is acting on modes and what is acting on flags.

Functions with a formal type of an 'int' contain both the mode and flags.

		David
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ