[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20211115070411.6842-1-guozhengkui@vivo.com>
Date: Mon, 15 Nov 2021 15:04:10 +0800
From: Guo Zhengkui <guozhengkui@...o.com>
To: Peter Zijlstra <peterz@...radead.org>,
Ingo Molnar <mingo@...hat.com>, Will Deacon <will@...nel.org>,
Waiman Long <longman@...hat.com>,
Boqun Feng <boqun.feng@...il.com>,
linux-kernel@...r.kernel.org (open list:LOCKING PRIMITIVES)
Cc: kernel@...o.com, Guo Zhengkui <guozhengkui@...o.com>
Subject: [PATCH] rtmutex: fix boolreturn.cocci warning:
Fix following boolreturn.cocci warning:
./kernel/locking/rtmutex.c:375:9-10: WARNING: return of 0/1 in function
'__waiter_less' with return type bool.
Signed-off-by: Guo Zhengkui <guozhengkui@...o.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 0c6a48dfcecb..fbdcf61b6824 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.20.1
Powered by blists - more mailing lists