From: Haowen Bai <baihaowen88@gmail.com>
To: peterz@infradead.org, mingo@redhat.com, will@kernel.org
Cc: longman@redhat.com, boqun.feng@gmail.com,
linux-kernel@vger.kernel.org, Haowen Bai <baihaowen88@gmail.com>
Subject: [PATCH] locking/rwbase: Return true/false (not 1/0) from bool functions
Date: Tue, 1 Mar 2022 10:55:58 +0800 [thread overview]
Message-ID: <1646103358-21591-1-git-send-email-baihaowen88@gmail.com> (raw)
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
reply other threads:[~2022-03-01 2:56 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1646103358-21591-1-git-send-email-baihaowen88@gmail.com \
--to=baihaowen88@gmail.com \
--cc=boqun.feng@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=longman@redhat.com \
--cc=mingo@redhat.com \
--cc=peterz@infradead.org \
--cc=will@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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®