linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] gpio: xgene: fix type of variable containing error codes
@ 2016-02-23  6:45 Andrzej Hajda
  2016-02-25 10:00 ` Linus Walleij
  0 siblings, 1 reply; 2+ messages in thread
From: Andrzej Hajda @ 2016-02-23  6:45 UTC (permalink / raw)
  To: Linus Walleij, Alexandre Courbot, open list:GPIO SUBSYSTEM
  Cc: Andrzej Hajda, Bartlomiej Zolnierkiewicz, Marek Szyprowski, open list

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

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH 1/2] gpio: xgene: fix type of variable containing error codes
  2016-02-23  6:45 [PATCH 1/2] gpio: xgene: fix type of variable containing error codes Andrzej Hajda
@ 2016-02-25 10:00 ` Linus Walleij
  0 siblings, 0 replies; 2+ messages in thread
From: Linus Walleij @ 2016-02-25 10:00 UTC (permalink / raw)
  To: Andrzej Hajda
  Cc: Alexandre Courbot, open list:GPIO SUBSYSTEM,
	Bartlomiej Zolnierkiewicz, Marek Szyprowski, open list

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-02-25 10:00 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-02-23  6:45 [PATCH 1/2] gpio: xgene: fix type of variable containing error codes Andrzej Hajda
2016-02-25 10:00 ` Linus Walleij

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