Commit 6d556294d5b27fb12f18be7495af45b6156a409e
Committed by
Linus Torvalds
1 parent
e13861d822
Exists in
master
and in
20 other branches
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>
Showing 1 changed file with 1 additions and 4 deletions Side-by-side Diff
mm/mempolicy.c
... | ... | @@ -127,9 +127,6 @@ |
127 | 127 | { |
128 | 128 | int nd, k; |
129 | 129 | |
130 | - /* Check that there is something useful in this mask */ | |
131 | - k = policy_zone; | |
132 | - | |
133 | 130 | for_each_node_mask(nd, *nodemask) { |
134 | 131 | struct zone *z; |
135 | 132 | |
... | ... | @@ -145,7 +142,7 @@ |
145 | 142 | |
146 | 143 | static 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 | |
151 | 148 | static void mpol_relative_nodemask(nodemask_t *ret, const nodemask_t *orig, |