linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] hugetlb.h: flatten logic in arch_hugetlb_migration_supported
@ 2025-10-08 21:26 Gregory Price
  2025-10-08 21:26 ` [PATCH 2/2] hugetlb: add __read_mostly to sysctl_hugetlb_shm_group Gregory Price
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Gregory Price @ 2025-10-08 21:26 UTC (permalink / raw)
  To: linux-mm; +Cc: muchun.song, osalvador, david, linux-kernel

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

Signed-off-by: Gregory Price <gourry@gourry.net>
---
 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 526d27e88b3b..b030850975ef 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.0



^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2025-10-20 18:15 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-10-08 21:26 [PATCH 1/2] hugetlb.h: flatten logic in arch_hugetlb_migration_supported Gregory Price
2025-10-08 21:26 ` [PATCH 2/2] hugetlb: add __read_mostly to sysctl_hugetlb_shm_group Gregory Price
2025-10-13  8:08   ` Oscar Salvador
2025-10-13  8:06 ` [PATCH 1/2] hugetlb.h: flatten logic in arch_hugetlb_migration_supported Oscar Salvador
2025-10-13  8:10 ` David Hildenbrand
2025-10-20 16:14   ` Gregory Price
2025-10-20 18:15     ` David Hildenbrand

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox