Skip to content

Commit

Permalink
mm/mempolicy: use NUMA_NO_NODE
Browse files Browse the repository at this point in the history
Use more appropriate NUMA_NO_NODE instead of -1

Signed-off-by: Jianguo Wu <[email protected]>
Acked-by: KOSAKI Motohiro <[email protected]>
Acked-by: David Rientjes <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
Jianguo Wu authored and torvalds committed Nov 13, 2013
1 parent 9f1b868 commit b76ac7e
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions mm/mempolicy.c
Original file line number Diff line number Diff line change
Expand Up @@ -1125,7 +1125,7 @@ int do_migrate_pages(struct mm_struct *mm, const nodemask_t *from,
tmp = *from;
while (!nodes_empty(tmp)) {
int s,d;
int source = -1;
int source = NUMA_NO_NODE;
int dest = 0;

for_each_node_mask(s, tmp) {
Expand Down Expand Up @@ -1160,7 +1160,7 @@ int do_migrate_pages(struct mm_struct *mm, const nodemask_t *from,
if (!node_isset(dest, tmp))
break;
}
if (source == -1)
if (source == NUMA_NO_NODE)
break;

node_clear(source, tmp);
Expand Down Expand Up @@ -1835,7 +1835,7 @@ static unsigned offset_il_node(struct mempolicy *pol,
unsigned nnodes = nodes_weight(pol->v.nodes);
unsigned target;
int c;
int nid = -1;
int nid = NUMA_NO_NODE;

if (!nnodes)
return numa_node_id();
Expand Down Expand Up @@ -1872,11 +1872,11 @@ static inline unsigned interleave_nid(struct mempolicy *pol,

/*
* 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 w, bit = -1;
int w, bit = NUMA_NO_NODE;

w = nodes_weight(*maskp);
if (w)
Expand Down

0 comments on commit b76ac7e

Please sign in to comment.