Commit 6d556294 authored by Bob Liu's avatar Bob Liu Committed by Linus Torvalds

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: default avatarBob Liu <lliubbo@gmail.com>
Acked-by: default avatarDavid 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: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent e13861d8
...@@ -127,9 +127,6 @@ static int is_valid_nodemask(const nodemask_t *nodemask) ...@@ -127,9 +127,6 @@ static int is_valid_nodemask(const nodemask_t *nodemask)
{ {
int nd, k; int nd, k;
/* Check that there is something useful in this mask */
k = policy_zone;
for_each_node_mask(nd, *nodemask) { for_each_node_mask(nd, *nodemask) {
struct zone *z; struct zone *z;
...@@ -145,7 +142,7 @@ static int is_valid_nodemask(const nodemask_t *nodemask) ...@@ -145,7 +142,7 @@ static int is_valid_nodemask(const nodemask_t *nodemask)
static inline int mpol_store_user_nodemask(const struct mempolicy *pol) static inline int mpol_store_user_nodemask(const struct mempolicy *pol)
{ {
return pol->flags & (MPOL_F_STATIC_NODES | MPOL_F_RELATIVE_NODES); return pol->flags & MPOL_MODE_FLAGS;
} }
static void mpol_relative_nodemask(nodemask_t *ret, const nodemask_t *orig, static void mpol_relative_nodemask(nodemask_t *ret, const nodemask_t *orig,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment