From: Michael Ellerman <patch-notifications@ellerman.id.au>
To: Andrew Shadura <andrew.shadura@collabora.co.uk>,
linuxppc-dev@lists.ozlabs.org, linux-api@vger.kernel.org,
linux-kernel@vger.kernel.org
Cc: Shuah Khan <shuah@kernel.org>, Paul Mackerras <paulus@samba.org>,
Cyril Bur <cyrilbur@gmail.com>
Subject: Re: [RESEND] tools-powerpc: Return false instead of -1
Date: Mon, 14 Nov 2016 23:17:25 +1100 (AEDT) [thread overview]
Message-ID: <3tHTzn42Z9z9s5w@ozlabs.org> (raw)
In-Reply-To: <20161109085504.10799-1-andrew.shadura@collabora.co.uk>
On Wed, 2016-09-11 at 08:55:04 UTC, Andrew Shadura wrote:
> From: Peter Senna Tschudin <peter.senna@gmail.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@gmail.com>
> Signed-off-by: Andrew Shadura <andrew.shadura@collabora.co.uk>
Applied to powerpc next, thanks.
https://git.kernel.org/powerpc/c/0e27d27e0d6d92342797e0d37738c2
cheers
prev parent reply other threads:[~2016-11-14 12:17 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-11-09 8:55 [PATCH RESEND] tools-powerpc: Return false instead of -1 Andrew Shadura
2016-11-14 12:17 ` Michael Ellerman [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=3tHTzn42Z9z9s5w@ozlabs.org \
--to=patch-notifications@ellerman.id.au \
--cc=andrew.shadura@collabora.co.uk \
--cc=cyrilbur@gmail.com \
--cc=linux-api@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=paulus@samba.org \
--cc=shuah@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.