aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBob Liu <lliubbo@gmail.com>2010-05-24 17:31:59 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2010-05-25 11:06:57 -0400
commit6d556294d5b27fb12f18be7495af45b6156a409e (patch)
treecb8549b4a4dc53399abc596dcac4630b0d936abf
parente13861d822f8f443ca0c020ea8fc2dc01039cd63 (diff)
mempolicy: remove redundant code
1. In funtion is_valid_nodemask(), varibable k will be inited to 0 in the following loop, needn't init to policy_zone anymore. 2. (MPOL_F_STATIC_NODES | MPOL_F_RELATIVE_NODES) has already defined to MPOL_MODE_FLAGS in mempolicy.h. Signed-off-by: Bob Liu <lliubbo@gmail.com> Acked-by: David Rientjes <rientjes@google.com> Cc: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com> Cc: Christoph Lameter <cl@linux-foundation.org> Cc: Mel Gorman <mel@csn.ul.ie> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r--mm/mempolicy.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/mm/mempolicy.c b/mm/mempolicy.c
index 08f40a2f3fe0..ad500f3b12bf 100644
--- a/mm/mempolicy.c
+++ b/mm/mempolicy.c
@@ -127,9 +127,6 @@ static int is_valid_nodemask(const nodemask_t *nodemask)
127{ 127{
128 int nd, k; 128 int nd, k;
129 129
130 /* Check that there is something useful in this mask */
131 k = policy_zone;
132
133 for_each_node_mask(nd, *nodemask) { 130 for_each_node_mask(nd, *nodemask) {
134 struct zone *z; 131 struct zone *z;
135 132
@@ -145,7 +142,7 @@ static int is_valid_nodemask(const nodemask_t *nodemask)
145 142
146static inline int mpol_store_user_nodemask(const struct mempolicy *pol) 143static inline int mpol_store_user_nodemask(const struct mempolicy *pol)
147{ 144{
148 return pol->flags & (MPOL_F_STATIC_NODES | MPOL_F_RELATIVE_NODES); 145 return pol->flags & MPOL_MODE_FLAGS;
149} 146}
150 147
151static void mpol_relative_nodemask(nodemask_t *ret, const nodemask_t *orig, 148static void mpol_relative_nodemask(nodemask_t *ret, const nodemask_t *orig,