[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <3tHTzn42Z9z9s5w@ozlabs.org>
Date: Mon, 14 Nov 2016 23:17:25 +1100 (AEDT)
From: Michael Ellerman <patch-notifications@...erman.id.au>
To: Andrew Shadura <andrew.shadura@...labora.co.uk>,
linuxppc-dev@...ts.ozlabs.org, linux-api@...r.kernel.org,
linux-kernel@...r.kernel.org
Cc: Shuah Khan <shuah@...nel.org>, Paul Mackerras <paulus@...ba.org>,
Cyril Bur <cyrilbur@...il.com>
Subject: Re: [RESEND] tools-powerpc: Return false instead of -1
On Wed, 2016-09-11 at 08:55:04 UTC, Andrew Shadura wrote:
> From: Peter Senna Tschudin <peter.senna@...il.com>
>
> Returning a negative value for a boolean function seem to have the
> undesired effect of returning true. require_paranoia_below() is a
> boolean function, but the variable used to store the return value is an
> integer, receiving -1 or 0. This patch convert rc to bool, replace -1
> by false, and 0 by true.
>
> This issue was found by the following Coccinelle semantic patch:
> <smpl>
> @@
> identifier f, ret;
> constant C;
> typedef bool;
> @@
> bool f (...){
> <+...
> ret = -C;
> ...
> * return ret;
> ...+>
> }
> </smpl>
>
> Signed-off-by: Peter Senna Tschudin <peter.senna@...il.com>
> Signed-off-by: Andrew Shadura <andrew.shadura@...labora.co.uk>
Applied to powerpc next, thanks.
https://git.kernel.org/powerpc/c/0e27d27e0d6d92342797e0d37738c2
cheers
Powered by blists - more mailing lists