From: Bob Liu Date: Mon, 24 May 2010 21:31:59 +0000 (-0700) Subject: mempolicy: remove redundant code X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=6d556294d5b27fb12f18be7495af45b6156a409e;p=GitHub%2Fexynos8895%2Fandroid_kernel_samsung_universal8895.git 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 Acked-by: David Rientjes Cc: KOSAKI Motohiro Cc: Christoph Lameter Cc: Mel Gorman Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- 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) { int nd, k; - /* Check that there is something useful in this mask */ - k = policy_zone; - for_each_node_mask(nd, *nodemask) { struct zone *z; @@ -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,