Skip to content

Commit

Permalink
mempolicy: remove redundant code
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Bob Liu authored and Linus Torvalds committed May 25, 2010
1 parent e13861d commit 6d55629
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions mm/mempolicy.c
Original file line number Diff line number Diff line change
Expand Up @@ -127,9 +127,6 @@ static int is_valid_nodemask(const nodemask_t *nodemask)
{
int nd, k;

/* Check that there is something useful in this mask */
k = policy_zone;

for_each_node_mask(nd, *nodemask) {
struct zone *z;

Expand All @@ -145,7 +142,7 @@ static int is_valid_nodemask(const nodemask_t *nodemask)

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,
Expand Down

0 comments on commit 6d55629

Please sign in to comment.