[RESEND PATCH 1/2] hugetlb.h: flatten logic in arch_hugetlb_migration_supported

From: Gregory Price

Date: Fri Nov 21 2025 - 14:49:16 EST


Simplify if-true-return-true-else-false logic.

Signed-off-by: Gregory Price <gourry@xxxxxxxxxx>
Acked-by: David Hildenbrand <david@xxxxxxxxxx>
---
include/linux/hugetlb.h | 7 ++-----
1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/include/linux/hugetlb.h b/include/linux/hugetlb.h
index eb21619206af..d5282d52493b 100644
--- a/include/linux/hugetlb.h
+++ b/include/linux/hugetlb.h
@@ -876,12 +876,9 @@ static inline void folio_clear_hugetlb_hwpoison(struct folio *folio)
#ifndef arch_hugetlb_migration_supported
static inline bool arch_hugetlb_migration_supported(struct hstate *h)
{
- if ((huge_page_shift(h) == PMD_SHIFT) ||
+ return ((huge_page_shift(h) == PMD_SHIFT) ||
(huge_page_shift(h) == PUD_SHIFT) ||
- (huge_page_shift(h) == PGDIR_SHIFT))
- return true;
- else
- return false;
+ (huge_page_shift(h) == PGDIR_SHIFT));
}
#endif
#else
--
2.51.1