[PATCH] x86/pgtable: Return true/false (not 1/0) from bool functions
From: Haowen Bai
Date: Wed Apr 06 2022 - 09:01:50 EST
Return boolean values ("true" or "false") instead of 1 or 0 from bool
functions. This fixes the following warnings from coccicheck:
kernel/sched/fair.c:9846:9-10: WARNING: return of 0/1 in function
'imbalanced_active_balance' with return type bool
Signed-off-by: Haowen Bai <baihaowen@xxxxxxxxx>
---
arch/x86/include/asm/pgtable.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/x86/include/asm/pgtable.h b/arch/x86/include/asm/pgtable.h
index a3c22d2fe27e..6f0e261bae73 100644
--- a/arch/x86/include/asm/pgtable.h
+++ b/arch/x86/include/asm/pgtable.h
@@ -1414,7 +1414,7 @@ static inline bool __pte_access_permitted(unsigned long pteval, bool write)
need_pte_bits |= _PAGE_RW;
if ((pteval & need_pte_bits) != need_pte_bits)
- return 0;
+ return false;
return __pkru_allows_pkey(pte_flags_pkey(pteval), write);
}
--
2.7.4