mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
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/rtmutex: Return true/false (not 1/0) from bool functions
Date: Tue,  1 Mar 2022 10:52:28 +0800	[thread overview]
Message-ID: <1646103148-21514-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/rtmutex.c:375:9-10: WARNING: return of 0/1 in function '__waiter_less' with return type bool

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

diff --git a/kernel/locking/rtmutex.c b/kernel/locking/rtmutex.c
index 8555c4e..29db06a 100644
--- a/kernel/locking/rtmutex.c
+++ b/kernel/locking/rtmutex.c
@@ -372,24 +372,24 @@ static __always_inline bool __waiter_less(struct rb_node *a, const struct rb_nod
 	struct rt_mutex_waiter *bw = __node_2_waiter(b);
 
 	if (rt_mutex_waiter_less(aw, bw))
-		return 1;
+		return true;
 
 	if (!build_ww_mutex())
-		return 0;
+		return false;
 
 	if (rt_mutex_waiter_less(bw, aw))
-		return 0;
+		return false;
 
 	/* NOTE: relies on waiter->ww_ctx being set before insertion */
 	if (aw->ww_ctx) {
 		if (!bw->ww_ctx)
-			return 1;
+			return true;
 
 		return (signed long)(aw->ww_ctx->stamp -
 				     bw->ww_ctx->stamp) < 0;
 	}
 
-	return 0;
+	return false;
 }
 
 static __always_inline void
-- 
2.7.4


                 reply	other threads:[~2022-03-01  2:52 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=1646103148-21514-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®