2014-06-26 16:56:11

by Rickard Strandqvist

[permalink] [raw]
Subject: [PATCH] pinctrl: pinctrl-adi2.c: Cleaning up wrong format string usage

%d in format string used, but the type is unsigned int

This was found using a static code analysis program called cppcheck

Signed-off-by: Rickard Strandqvist <[email protected]>
---
drivers/pinctrl/pinctrl-adi2.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/pinctrl/pinctrl-adi2.c b/drivers/pinctrl/pinctrl-adi2.c
index 5c44feb..7935988 100644
--- a/drivers/pinctrl/pinctrl-adi2.c
+++ b/drivers/pinctrl/pinctrl-adi2.c
@@ -401,7 +401,7 @@ static int adi_gpio_irq_type(struct irq_data *d, unsigned int type)

if (type & (IRQ_TYPE_EDGE_RISING | IRQ_TYPE_EDGE_FALLING |
IRQ_TYPE_LEVEL_HIGH | IRQ_TYPE_LEVEL_LOW)) {
- snprintf(buf, 16, "gpio-irq%d", irq);
+ snprintf(buf, 16, "gpio-irq%u", irq);
port_setup(port, d->hwirq, true);
} else
goto out;
--
1.7.10.4


2014-07-07 15:51:53

by Linus Walleij

[permalink] [raw]
Subject: Re: [PATCH] pinctrl: pinctrl-adi2.c: Cleaning up wrong format string usage

On Thu, Jun 26, 2014 at 6:57 PM, Rickard Strandqvist
<[email protected]> wrote:

> %d in format string used, but the type is unsigned int
>
> This was found using a static code analysis program called cppcheck
>
> Signed-off-by: Rickard Strandqvist <[email protected]>

Patch applied.

Yours,
Linus Walleij