Commit b76ac7e7 authored by Jianguo Wu's avatar Jianguo Wu Committed by Linus Torvalds

mm/mempolicy: use NUMA_NO_NODE

Use more appropriate NUMA_NO_NODE instead of -1
Signed-off-by: default avatarJianguo Wu <wujianguo@huawei.com>
Acked-by: default avatarKOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Acked-by: default avatarDavid Rientjes <rientjes@google.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 9f1b868a
...@@ -1125,7 +1125,7 @@ int do_migrate_pages(struct mm_struct *mm, const nodemask_t *from, ...@@ -1125,7 +1125,7 @@ int do_migrate_pages(struct mm_struct *mm, const nodemask_t *from,
tmp = *from; tmp = *from;
while (!nodes_empty(tmp)) { while (!nodes_empty(tmp)) {
int s,d; int s,d;
int source = -1; int source = NUMA_NO_NODE;
int dest = 0; int dest = 0;
for_each_node_mask(s, tmp) { for_each_node_mask(s, tmp) {
...@@ -1160,7 +1160,7 @@ int do_migrate_pages(struct mm_struct *mm, const nodemask_t *from, ...@@ -1160,7 +1160,7 @@ int do_migrate_pages(struct mm_struct *mm, const nodemask_t *from,
if (!node_isset(dest, tmp)) if (!node_isset(dest, tmp))
break; break;
} }
if (source == -1) if (source == NUMA_NO_NODE)
break; break;
node_clear(source, tmp); node_clear(source, tmp);
...@@ -1835,7 +1835,7 @@ static unsigned offset_il_node(struct mempolicy *pol, ...@@ -1835,7 +1835,7 @@ static unsigned offset_il_node(struct mempolicy *pol,
unsigned nnodes = nodes_weight(pol->v.nodes); unsigned nnodes = nodes_weight(pol->v.nodes);
unsigned target; unsigned target;
int c; int c;
int nid = -1; int nid = NUMA_NO_NODE;
if (!nnodes) if (!nnodes)
return numa_node_id(); return numa_node_id();
...@@ -1872,11 +1872,11 @@ static inline unsigned interleave_nid(struct mempolicy *pol, ...@@ -1872,11 +1872,11 @@ static inline unsigned interleave_nid(struct mempolicy *pol,
/* /*
* Return the bit number of a random bit set in the nodemask. * Return the bit number of a random bit set in the nodemask.
* (returns -1 if nodemask is empty) * (returns NUMA_NO_NODE if nodemask is empty)
*/ */
int node_random(const nodemask_t *maskp) int node_random(const nodemask_t *maskp)
{ {
int w, bit = -1; int w, bit = NUMA_NO_NODE;
w = nodes_weight(*maskp); w = nodes_weight(*maskp);
if (w) if (w)
......
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