* [PATCH] rtmutex: fix boolreturn.cocci warning:
@ 2021-11-15 7:04 Guo Zhengkui
2021-11-15 11:11 ` Peter Zijlstra
0 siblings, 1 reply; 2+ messages in thread
From: Guo Zhengkui @ 2021-11-15 7:04 UTC (permalink / raw)
To: Peter Zijlstra, Ingo Molnar, Will Deacon, Waiman Long,
Boqun Feng, open list:LOCKING PRIMITIVES
Cc: kernel, Guo Zhengkui
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@vivo.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
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] rtmutex: fix boolreturn.cocci warning:
2021-11-15 7:04 [PATCH] rtmutex: fix boolreturn.cocci warning: Guo Zhengkui
@ 2021-11-15 11:11 ` Peter Zijlstra
0 siblings, 0 replies; 2+ messages in thread
From: Peter Zijlstra @ 2021-11-15 11:11 UTC (permalink / raw)
To: Guo Zhengkui
Cc: Ingo Molnar, Will Deacon, Waiman Long, Boqun Feng,
open list:LOCKING PRIMITIVES, kernel
On Mon, Nov 15, 2021 at 03:04:10PM +0800, Guo Zhengkui wrote:
> 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.
The right patch it so delete that stupid script.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2021-11-15 11:11 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-15 7:04 [PATCH] rtmutex: fix boolreturn.cocci warning: Guo Zhengkui
2021-11-15 11:11 ` Peter Zijlstra
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).