Re: [PATCH] pinctrl: rza1: Remove unneeded wrong check for wrong variable

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Jun 30, 2017 at 8:57 AM, Geert Uytterhoeven
<geert+renesas@xxxxxxxxx> wrote:

> Depending on compiler version:
>
>     drivers/pinctrl/pinctrl-rza1.c: In function ‘rza1_pinctrl_probe’:
>     drivers/pinctrl/pinctrl-rza1.c:1260:5: warning: ‘ret’ may be used uninitialized in this function [-Wmaybe-uninitialized]
>       if (ret)
>          ^
>
> Indeed, the result returned by platform_get_resource() was stored in
> "res", not "ret".  In addition, the correct error check would be
> "if (!res)", as platform_get_resource() does not return an error code,
> but returns NULL on failure.
>
> However, as devm_ioremap_resource() verifies the validity of the passed
> resource pointer anyway, the check can just be removed.
>
> Reported-by: Stephen Rothwell <sfr@xxxxxxxxxxxxxxxx>
> Fixes: 5a49b644b3075f88 ("pinctrl: Renesas RZ/A1 pin and gpio controller")
> Signed-off-by: Geert Uytterhoeven <geert+renesas@xxxxxxxxx>

Patch applied.

Yours,
Linus Walleij
--
To unsubscribe from this list: send the line "unsubscribe linux-next" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Kernel]     [Linux USB Development]     [Yosemite News]     [Linux SCSI]

  Powered by Linux