Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1480753 > unrolled thread
| Started by | Colin King <colin.king@canonical.com> |
|---|---|
| First post | 2016-09-11 10:40 +0200 |
| Last post | 2016-09-13 10:50 +0200 |
| Articles | 3 — 3 participants |
Back to article view | Back to linux.kernel
[PATCH] pinctrl: ret needs to be an int for -ve return value from regmap_update_bits Colin King <colin.king@canonical.com> - 2016-09-11 10:40 +0200
Re: [PATCH] pinctrl: ret needs to be an int for -ve return value from regmap_update_bits Andrew Jeffery <andrew@aj.id.au> - 2016-09-12 04:10 +0200
Re: [PATCH] pinctrl: ret needs to be an int for -ve return value from regmap_update_bits Linus Walleij <linus.walleij@linaro.org> - 2016-09-13 10:50 +0200
| From | Colin King <colin.king@canonical.com> |
|---|---|
| Date | 2016-09-11 10:40 +0200 |
| Subject | [PATCH] pinctrl: ret needs to be an int for -ve return value from regmap_update_bits |
| Message-ID | <sg8sV-3Vj-1@gated-at.bofh.it> |
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
[toc] | [next] | [standalone]
| From | Andrew Jeffery <andrew@aj.id.au> |
|---|---|
| Date | 2016-09-12 04:10 +0200 |
| Subject | Re: [PATCH] pinctrl: ret needs to be an int for -ve return value from regmap_update_bits |
| Message-ID | <sgoR3-5AI-1@gated-at.bofh.it> |
| In reply to | #1480753 |
[Multipart message — attachments visible in raw view] — view raw
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)
[toc] | [prev] | [next] | [standalone]
| From | Linus Walleij <linus.walleij@linaro.org> |
|---|---|
| Date | 2016-09-13 10:50 +0200 |
| Message-ID | <sgRzH-7TC-5@gated-at.bofh.it> |
| In reply to | #1480753 |
On Sun, Sep 11, 2016 at 10:36 AM, Colin King <colin.king@canonical.com> 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> Dropping this but added your Reported-by to Arnds patch. Yours, Linus Walleij
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web