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: <alpine.DEB.1.00.0802252017310.14627@chino.kir.corp.google.com>
Date:	Mon, 25 Feb 2008 20:21:50 -0800 (PST)
From:	David Rientjes <rientjes@...gle.com>
To:	Paul Jackson <pj@....com>
cc:	akpm@...ux-foundation.org, clameter@....com,
	Lee.Schermerhorn@...com, ak@...e.de, linux-kernel@...r.kernel.org
Subject: Re: [patch 1/6] mempolicy: convert MPOL constants to enum

On Mon, 25 Feb 2008, Paul Jackson wrote:

> Eh ... each bit of added clarity to the code reduces
> errors.
> 
> Looking around the kernel, it really seems to me to be
> a common coding to explicitly spell out enum values
> when for some reason they actually matter.
> 
> Like most coding mechanisms, nothing guarantees anything.
> 
> It just nicely represents one particular detail, that
> the values of these MPOL_* terms are not arbitrary.
> 

Of course the MPOL_* modes aren't arbitrary; they are defined in an enum 
that has a well-defined and explicit behavior for how they are mapped to 
int values based on a standard.

I have more mempolicy patches that add additional behavior and cleanups so 
I can queue the following for a later posting.  I'd like to avoid 
respinning this set unless there are actual design or implementation 
concerns that are raised. 
---
 include/linux/mempolicy.h |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/include/linux/mempolicy.h b/include/linux/mempolicy.h
--- a/include/linux/mempolicy.h
+++ b/include/linux/mempolicy.h
@@ -20,7 +20,9 @@ enum {
 	MPOL_PREFERRED,
 	MPOL_BIND,
 	MPOL_INTERLEAVE,
-	MPOL_MAX,	/* always last member of enum */
+	/* add additional MPOL_* modes here */
+
+	MPOL_MAX,
 };
 
 /* Flags for set_mempolicy */
--
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