Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1340336 > unrolled thread

[PATCH 1/2] gpio: xgene: fix type of variable containing error codes

Started byAndrzej Hajda <a.hajda@samsung.com>
First post2016-02-23 07:50 +0100
Last post2016-02-25 11:10 +0100
Articles 2 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH 1/2] gpio: xgene: fix type of variable containing error codes Andrzej Hajda <a.hajda@samsung.com> - 2016-02-23 07:50 +0100
    Re: [PATCH 1/2] gpio: xgene: fix type of variable containing error codes Linus Walleij <linus.walleij@linaro.org> - 2016-02-25 11:10 +0100

#1340336 — [PATCH 1/2] gpio: xgene: fix type of variable containing error codes

FromAndrzej Hajda <a.hajda@samsung.com>
Date2016-02-23 07:50 +0100
Subject[PATCH 1/2] gpio: xgene: fix type of variable containing error codes
Message-ID<r5eXf-1sV-1@gated-at.bofh.it>
ret variable can contain error values and is compared with zero.
Its type must be signed.

The problem has been detected using coccinelle script
scripts/coccinelle/tests/unsigned_lesser_than_zero.cocci

Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
---
 drivers/gpio/gpio-xgene-sb.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpio/gpio-xgene-sb.c b/drivers/gpio/gpio-xgene-sb.c
index b993b86..fd81ebc 100644
--- a/drivers/gpio/gpio-xgene-sb.c
+++ b/drivers/gpio/gpio-xgene-sb.c
@@ -240,7 +240,7 @@ static const struct irq_domain_ops xgene_gpio_sb_domain_ops = {
 static int xgene_gpio_sb_probe(struct platform_device *pdev)
 {
 	struct xgene_gpio_sb *priv;
-	u32 ret;
+	int ret;
 	struct resource *res;
 	void __iomem *regs;
 	struct irq_domain *parent_domain = NULL;
-- 
1.9.1

[toc] | [next] | [standalone]


#1343071

FromLinus Walleij <linus.walleij@linaro.org>
Date2016-02-25 11:10 +0100
Message-ID<r611X-2fv-45@gated-at.bofh.it>
In reply to#1340336
On Tue, Feb 23, 2016 at 7:45 AM, Andrzej Hajda <a.hajda@samsung.com> wrote:

> ret variable can contain error values and is compared with zero.
> Its type must be signed.
>
> The problem has been detected using coccinelle script
> scripts/coccinelle/tests/unsigned_lesser_than_zero.cocci
>
> Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>

Patch applied as obviously correct.

Yours,
Linus Walleij

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web