Messages in this thread Patch in this message | | | From | cgel.zte@gmail ... | Subject | [PATCH] x86: mm: fix boolreturn.cocci warning | Date | Fri, 26 Nov 2021 08:09:17 +0000 |
| |
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
| |