lkml.org 
[lkml]   [2021]   [Nov]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] x86: mm: fix boolreturn.cocci warning
Date
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
\
 
 \ /
  Last update: 2021-11-26 09:11    [W:0.082 / U:0.344 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site