[PATCH linux-next] x86:pgtable: fix boolreturn.cocci warnings

From: CGEL
Date: Tue Aug 24 2021 - 03:13:55 EST


From: Jing Yangyang <jing.yangyang@xxxxxxxxxx>

./arch/x86/include/asm/pgtable.h:1369:9-10:WARNING:return of 0/1 in
function '__pte_access_permitted' with return type bool

Return statements in functions returning bool should use true/false
instead of 1/0.

Generated by: scripts/coccinelle/misc/boolreturn.cocci

Reported-by: Zeal Robot <zealci@xxxxxxxxxx>
Signed-off-by: Jing Yangyang <jing.yangyang@xxxxxxxxxx>
---
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 448cd01..fc4801d 100644
--- a/arch/x86/include/asm/pgtable.h
+++ b/arch/x86/include/asm/pgtable.h
@@ -1366,7 +1366,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);
}
--
1.8.3.1