Skip to content

Commit 062db29

Browse files
Baolin Wangtorvalds
authored andcommitted
mm/mempolicy: use readable NUMA_NO_NODE macro instead of magic number
The caller of mpol_misplaced() already use NUMA_NO_NODE to check whether current page node is misplaced, thus using NUMA_NO_NODE in mpol_misplaced() instead of magic number is more readable. Link: https://lkml.kernel.org/r/1b77c0ce21183fa86f4db250b115cf5e27396528.1627558356.git.baolin.wang@linux.alibaba.com Signed-off-by: Baolin Wang <baolin.wang@linux.alibaba.com> Reviewed-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent 65d759c commit 062db29

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

mm/mempolicy.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2425,8 +2425,8 @@ static void sp_free(struct sp_node *n)
24252425
* node id. Policy determination "mimics" alloc_page_vma().
24262426
* Called from fault path where we know the vma and faulting address.
24272427
*
2428-
* Return: -1 if the page is in a node that is valid for this policy, or a
2429-
* suitable node ID to allocate a replacement page from.
2428+
* Return: NUMA_NO_NODE if the page is in a node that is valid for this
2429+
* policy, or a suitable node ID to allocate a replacement page from.
24302430
*/
24312431
int mpol_misplaced(struct page *page, struct vm_area_struct *vma, unsigned long addr)
24322432
{
@@ -2437,7 +2437,7 @@ int mpol_misplaced(struct page *page, struct vm_area_struct *vma, unsigned long
24372437
int thiscpu = raw_smp_processor_id();
24382438
int thisnid = cpu_to_node(thiscpu);
24392439
int polnid = NUMA_NO_NODE;
2440-
int ret = -1;
2440+
int ret = NUMA_NO_NODE;
24412441

24422442
pol = get_vma_policy(vma, addr);
24432443
if (!(pol->flags & MPOL_F_MOF))

0 commit comments

Comments
 (0)