linux-gpio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Colin King <colin.king@canonical.com>
To: Linus Walleij <linus.walleij@linaro.org>,
	Andrew Jeffery <andrew@aj.id.au>, Joel Stanley <joel@jms.id.au>,
	linux-gpio@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Subject: [PATCH] pinctrl: ret needs to be an int for -ve return value from regmap_update_bits
Date: Sun, 11 Sep 2016 09:36:25 +0100	[thread overview]
Message-ID: <20160911083625.7451-1-colin.king@canonical.com> (raw)

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>
---
 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)
-- 
2.9.3


             reply	other threads:[~2016-09-11  8:37 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-11  8:36 Colin King [this message]
2016-09-12  2:00 ` [PATCH] pinctrl: ret needs to be an int for -ve return value from regmap_update_bits Andrew Jeffery
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=20160911083625.7451-1-colin.king@canonical.com \
    --to=colin.king@canonical.com \
    --cc=andrew@aj.id.au \
    --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;
as well as URLs for NNTP newsgroup(s).