Re: [PATCH V2 4/5] mm/khugepaged: use enum scan_result for result variables and return types
From: David Hildenbrand (Red Hat)
Date: Thu Jan 15 2026 - 18:51:22 EST
On 12/24/25 12:13, Shivank Garg wrote:
Convert result variables and return types from int to enum scan_result
throughout khugepaged code. This improves type safety and code clarity
by making the intent explicit.
No functional change.
Signed-off-by: Shivank Garg <shivankg@xxxxxxx>
---
mm/khugepaged.c | 111 +++++++++++++++++++++++++-----------------------
1 file changed, 57 insertions(+), 54 deletions(-)
diff --git a/mm/khugepaged.c b/mm/khugepaged.c
index 04ff0730c9a1..6892b23d6fc4 100644
--- a/mm/khugepaged.c
+++ b/mm/khugepaged.c
@@ -537,17 +537,18 @@ static void release_pte_pages(pte_t *pte, pte_t *_pte,
}
}
-static int __collapse_huge_page_isolate(struct vm_area_struct *vma,
- unsigned long start_addr,
- pte_t *pte,
- struct collapse_control *cc,
- struct list_head *compound_pagelist)
+static enum scan_result __collapse_huge_page_isolate(struct vm_area_struct *vma,
+ unsigned long start_addr,
+ pte_t *pte,
+ struct collapse_control *cc,
+ struct list_head *compound_pagelist)
Another reason to use to tabs to indent.
(Again, applies to all cases where you touch the lines either way :) )
--
Cheers
David