mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] locking/rwbase: Return true/false (not 1/0) from bool functions
@ 2022-03-01  2:55 Haowen Bai
  0 siblings, 0 replies; only message in thread
From: Haowen Bai @ 2022-03-01  2:55 UTC (permalink / raw)
  To: peterz, mingo, will; +Cc: longman, boqun.feng, linux-kernel, Haowen Bai

Return boolean values ("true" or "false") instead of 1 or 0 from bool 
functions.  This fixes the following warnings from coccicheck:

kernel/locking/rwbase_rt.c:226:9-10: WARNING: return of 0/1 in function '__rwbase_write_trylock' with return type bool


Signed-off-by: Haowen Bai <baihaowen88@gmail.com>
---
 kernel/locking/rwbase_rt.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/kernel/locking/rwbase_rt.c b/kernel/locking/rwbase_rt.c
index 6fd3162..e3dd458 100644
--- a/kernel/locking/rwbase_rt.c
+++ b/kernel/locking/rwbase_rt.c
@@ -223,10 +223,10 @@ static inline bool __rwbase_write_trylock(struct rwbase_rt *rwb)
 	 */
 	if (!atomic_read_acquire(&rwb->readers)) {
 		atomic_set(&rwb->readers, WRITER_BIAS);
-		return 1;
+		return true;
 	}
 
-	return 0;
+	return false;
 }
 
 static int __sched rwbase_write_lock(struct rwbase_rt *rwb,
-- 
2.7.4


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

only message in thread, other threads:[~2022-03-01  2:56 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-01  2:55 [PATCH] locking/rwbase: Return true/false (not 1/0) from bool functions Haowen Bai

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®