linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] x86: mm: fix boolreturn.cocci warning
@ 2021-11-26  8:09 cgel.zte
  0 siblings, 0 replies; only message in thread
From: cgel.zte @ 2021-11-26  8:09 UTC (permalink / raw)
  To: tglx
  Cc: mingo, bp, dave.hansen, x86, hpa, akpm, aneesh.kumar, sfr,
	deng.changcheng, linux-kernel, Zeal Robot

From: Changcheng Deng <deng.changcheng@zte.com.cn>

./arch/x86/include/asm/pgtable.h: 1394: 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.

Reported-by: Zeal Robot <zealci@zte.com.cn>
Signed-off-by: Changcheng Deng <deng.changcheng@zte.com.cn>
---
 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 448cd01eb3ec..fc4801d1863c 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);
 }
-- 
2.25.1


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2021-11-26  8:11 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-26  8:09 [PATCH] x86: mm: fix boolreturn.cocci warning cgel.zte

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).