2020-03-27 21:26:47

by Jules Irenge

[permalink] [raw]
Subject: [PATCH 01/10] locking/rtmutex: Remove Comparison to bool

From: Jules Irenge <[email protected]>

Coccinelle reports a warning inside rt_mutex_slowunlock()

WARNING: Comparison to bool

To fix this, the comparison to bool is removed
This not only fixes the issue but also removes the unnecessary comparison.

Remove comparison to bool

Signed-off-by: Jules Irenge <[email protected]>
---
kernel/locking/rtmutex.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/locking/rtmutex.c b/kernel/locking/rtmutex.c
index 851bbb10819d..7289e7b26be4 100644
--- a/kernel/locking/rtmutex.c
+++ b/kernel/locking/rtmutex.c
@@ -1378,7 +1378,7 @@ static bool __sched rt_mutex_slowunlock(struct rt_mutex *lock,
*/
while (!rt_mutex_has_waiters(lock)) {
/* Drops lock->wait_lock ! */
- if (unlock_rt_mutex_safe(lock, flags) == true)
+ if (unlock_rt_mutex_safe(lock, flags))
return false;
/* Relock the rtmutex and try again */
raw_spin_lock_irqsave(&lock->wait_lock, flags);
--
2.25.1


2020-03-28 11:29:49

by Thomas Gleixner

[permalink] [raw]
Subject: Re: [PATCH 01/10] locking/rtmutex: Remove Comparison to bool

Jules Irenge <[email protected]> writes:

> From: Jules Irenge <[email protected]>
>
> Coccinelle reports a warning inside rt_mutex_slowunlock()
>
> WARNING: Comparison to bool
>
> To fix this, the comparison to bool is removed
> This not only fixes the issue but also removes the unnecessary comparison.
>
> Remove comparison to bool

So you explain 3 times in different ways that the comparison to bool is
removed. What's the point?

Thanks,

tglx


2020-03-28 12:04:12

by Jules Irenge

[permalink] [raw]
Subject: Re: [PATCH 01/10] locking/rtmutex: Remove Comparison to bool



On Sat, 28 Mar 2020, Thomas Gleixner wrote:

> Jules Irenge <[email protected]> writes:
>
> > From: Jules Irenge <[email protected]>
> >
> > Coccinelle reports a warning inside rt_mutex_slowunlock()
> >
> > WARNING: Comparison to bool
> >
> > To fix this, the comparison to bool is removed
> > This not only fixes the issue but also removes the unnecessary comparison.
> >
> > Remove comparison to bool
>
> So you explain 3 times in different ways that the comparison to bool is
> removed. What's the point?
>
> Thanks,
>
> tglx
>
>
>
Thanks for the feedback I take good note. I will improve next time.

2020-03-28 12:45:39

by Thomas Gleixner

[permalink] [raw]
Subject: Re: [PATCH 01/10] locking/rtmutex: Remove Comparison to bool

Jules Irenge <[email protected]> writes:
> On Sat, 28 Mar 2020, Thomas Gleixner wrote:
>>
> Thanks for the feedback I take good note. I will improve next time.

And please remove these broken From: [email protected] lines.