From: Andrew Jeffery <andrew@aj.id.au>
To: Colin King <colin.king@canonical.com>,
Linus Walleij <linus.walleij@linaro.org>,
Joel Stanley <joel@jms.id.au>,
linux-gpio@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, Arnd Bergmann <arnd@arndb.de>
Subject: Re: [PATCH] pinctrl: ret needs to be an int for -ve return value from regmap_update_bits
Date: Mon, 12 Sep 2016 11:30:55 +0930 [thread overview]
Message-ID: <1473645655.10397.44.camel@aj.id.au> (raw)
In-Reply-To: <20160911083625.7451-1-colin.king@canonical.com>
[-- Attachment #1: Type: text/plain, Size: 1260 bytes --]
On Sun, 2016-09-11 at 09:36 +0100, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
>
> Macro regmap_update_bits can return a -ve on an error value so ret
> needs to be an integer rather than a bool type.
>
> Fixes warning found by static analysis with cppcheck:
> [drivers/pinctrl/aspeed/pinctrl-aspeed.c:192]: (warning) Comparison of
> a boolean expression with an integer other than 0 or 1.
>
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
Thanks Colin. Arnd independently discovered this bug and Joel and I
have CC'ed you on our responses there - the intent is to take Arnd's
patch.
Cheers,
Andrew
> ---
> drivers/pinctrl/aspeed/pinctrl-aspeed.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/pinctrl/aspeed/pinctrl-aspeed.c b/drivers/pinctrl/aspeed/pinctrl-aspeed.c
> index 7d461fc..75935ab 100644
> --- a/drivers/pinctrl/aspeed/pinctrl-aspeed.c
> +++ b/drivers/pinctrl/aspeed/pinctrl-aspeed.c
> @@ -166,7 +166,7 @@ static bool aspeed_sig_expr_set(const struct aspeed_sig_expr *expr,
> bool enable, struct regmap *map)
> {
> int i;
> - bool ret;
> + int ret;
>
> ret = aspeed_sig_expr_eval(expr, enable, map);
> if (ret)
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
next prev parent reply other threads:[~2016-09-12 2:01 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-09-11 8:36 Colin King
2016-09-12 2:00 ` Andrew Jeffery [this message]
2016-09-13 8:44 ` Linus Walleij
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=1473645655.10397.44.camel@aj.id.au \
--to=andrew@aj.id.au \
--cc=arnd@arndb.de \
--cc=colin.king@canonical.com \
--cc=joel@jms.id.au \
--cc=linus.walleij@linaro.org \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-kernel@vger.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®