mempolicy: remove redundant code
Subsystems (2)
PATCH 1/1 mempolicy: remove redundant code
From: Bob Liu <[email protected]>
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.
--- mempolicy.c | 5 +---- 1 files changed, 1 insertions(+), 4 deletions(-)
mm/mempolicy.c +1 -4
@@ -128,9 +128,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;
@@ -146,7 +143,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,
Signature · 7 lines
1.5.6.3 -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
Quoted 7 lines · Bob Liu
From: Bob Liu <[email protected]>
1. In funtion
is_valid_nodemask(), varibable k will be inited to 0 in the following loop, needn't init topolicy_zoneanymore.2. (
MPOL_F_STATIC_NODES|MPOL_F_RELATIVE_NODES) has already defined toMPOL_MODE_FLAGSinmempolicy.h.
Quoted 4 lines
--- mempolicy.c | 5 +---- 1 files changed, 1 insertions(+), 4 deletions(-)
(although the diffstat still doesn't have the mm/ path).
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
Quoted 10 lines · David Rientjes
Quoted 7 lines · Bob Liu
From: Bob Liu <[email protected]>
1. In funtion
is_valid_nodemask(), varibable k will be inited to 0 in the following loop, needn't init topolicy_zoneanymore.2. (
MPOL_F_STATIC_NODES|MPOL_F_RELATIVE_NODES) has already defined toMPOL_MODE_FLAGSinmempolicy.h.
Quoted 9 lines
Acked-by David Rientjes <[email protected]>Quoted 4 lines
---
mempolicy.c | 5 +----1 files changed, 1 insertions(+), 4 deletions(-)(although the diffstat still doesn't have the
mm/path).
Thanks a lot, I will check more careful next time :-)
Signature · 8 lines
Regards, -Bob Liu -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: <a href=mailto:"[email protected]"> [email protected] </a>