lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <alpine.LFD.2.21.2004031716310.10601@earth.lan>
Date:   Fri, 3 Apr 2020 17:17:02 +0100 (BST)
From:   Jules Irenge <jbi.octave@...il.com>
To:     Peter Zijlstra <peterz@...radead.org>
cc:     Jules Irenge <jbi.octave@...il.com>, linux-kernel@...r.kernel.org,
        julia.lawall@...6.fr, boqun.feng@...il.com,
        Ingo Molnar <mingo@...hat.com>, Will Deacon <will@...nel.org>
Subject: Re: [PATCH v2 4/4] locking/rtmutex: Remove Comparison to bool



On Mon, 30 Mar 2020, Peter Zijlstra wrote:

> On Mon, Mar 30, 2020 at 02:24:50AM +0100, Jules Irenge wrote:
>> Coccinelle reports a warning inside __sched rt_mutex_slowunlock()
>>
>> WARNING: Comparison to bool
>
> I don't mind the patch; but WTH is that a WARNING ?!? Superfluous, but
> definitely not wrong or even dangerous AFAICT.
>
>> To fix this,
>> a comparison (==) of a bool type function result to value true
>> together with the value are removed.
>>
>> Signed-off-by: Jules Irenge <jbi.octave@...il.com>
>> ---
>>  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
>>
>
Thanks for the reply, I will take good note.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ