[PATCH] mm/x86: Redefine pgd_clear

zhangjiao2 posted 1 patch 1 year ago
arch/x86/include/asm/pgtable.h | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
[PATCH] mm/x86: Redefine pgd_clear
Posted by zhangjiao2 1 year ago
From: zhang jiao <zhangjiao2@cmss.chinamobile.com>

Do not use the 'void' type in conditional expression.

Signed-off-by: zhang jiao <zhangjiao2@cmss.chinamobile.com>
---
 arch/x86/include/asm/pgtable.h | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/arch/x86/include/asm/pgtable.h b/arch/x86/include/asm/pgtable.h
index 593f10aabd45..c149e47122b8 100644
--- a/arch/x86/include/asm/pgtable.h
+++ b/arch/x86/include/asm/pgtable.h
@@ -74,7 +74,10 @@ extern pmdval_t early_pmd_flags;
 
 #ifndef __PAGETABLE_P4D_FOLDED
 #define set_pgd(pgdp, pgd)		native_set_pgd(pgdp, pgd)
-#define pgd_clear(pgd)			(pgtable_l5_enabled() ? native_pgd_clear(pgd) : 0)
+#define pgd_clear(pgd) do {						\
+	if (pgtable_l5_enabled())					\
+		native_pgd_clear(pgd);			\
+} while (0)
 #endif
 
 #ifndef set_p4d
-- 
2.33.0