* [PATCH] pinctrl: rza1: fix incorrect failure check on platform_get_resources
@ 2017-06-30 10:33 Colin King
2017-06-30 13:50 ` Linus Walleij
0 siblings, 1 reply; 2+ messages in thread
From: Colin King @ 2017-06-30 10:33 UTC (permalink / raw)
To: Linus Walleij, linux-gpio; +Cc: kernel-janitors, linux-kernel
From: Colin Ian King <colin.king@canonical.com>
The return res from platform_get_resources should be checked for
a failure rather than ret. Fixes warning:
'ret' may be used uninitialized in this function [-Wmaybe-uninitialized]
Fixes: 5a49b644b307 ("pinctrl: Renesas RZ/A1 pin and gpio controller")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
drivers/pinctrl/pinctrl-rza1.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/pinctrl/pinctrl-rza1.c b/drivers/pinctrl/pinctrl-rza1.c
index 29ddd624fb98..e79c8b9818d7 100644
--- a/drivers/pinctrl/pinctrl-rza1.c
+++ b/drivers/pinctrl/pinctrl-rza1.c
@@ -1257,7 +1257,7 @@ static int rza1_pinctrl_probe(struct platform_device *pdev)
rza1_pctl->dev = &pdev->dev;
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
- if (ret)
+ if (!res)
return -ENODEV;
rza1_pctl->base = devm_ioremap_resource(&pdev->dev, res);
--
2.11.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] pinctrl: rza1: fix incorrect failure check on platform_get_resources
2017-06-30 10:33 [PATCH] pinctrl: rza1: fix incorrect failure check on platform_get_resources Colin King
@ 2017-06-30 13:50 ` Linus Walleij
0 siblings, 0 replies; 2+ messages in thread
From: Linus Walleij @ 2017-06-30 13:50 UTC (permalink / raw)
To: Colin King; +Cc: linux-gpio, kernel-janitors, linux-kernel
On Fri, Jun 30, 2017 at 12:33 PM, Colin King <colin.king@canonical.com> wrote:
> From: Colin Ian King <colin.king@canonical.com>
>
> The return res from platform_get_resources should be checked for
> a failure rather than ret. Fixes warning:
>
> 'ret' may be used uninitialized in this function [-Wmaybe-uninitialized]
>
> Fixes: 5a49b644b307 ("pinctrl: Renesas RZ/A1 pin and gpio controller")
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
Geert already sent the right fix for this.
Yours,
Linus Walleij
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2017-06-30 13:50 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-06-30 10:33 [PATCH] pinctrl: rza1: fix incorrect failure check on platform_get_resources Colin King
2017-06-30 13:50 ` 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).