All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] x86/pgtable: Return true/false (not 1/0) from bool functions
@ 2022-04-06  9:24 Haowen Bai
  0 siblings, 0 replies; only message in thread
From: Haowen Bai @ 2022-04-06  9:24 UTC (permalink / raw)
  To: Thomas Gleixner, Ingo Molnar, Borislav Petkov, Dave Hansen, x86,
	H. Peter Anvin
  Cc: Haowen Bai, linux-kernel

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@meizu.com>
---
 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


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

only message in thread, other threads:[~2022-04-06 13:01 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-06  9:24 [PATCH] x86/pgtable: Return true/false (not 1/0) from bool functions Haowen Bai

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.