pinctrl: at91-pio4: fix has_config check in atmel_pctl_dt_subnode_to_map()
authorDan Carpenter <dan.carpenter@oracle.com>
Mon, 10 Sep 2018 08:37:45 +0000 (11:37 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 20 Nov 2019 16:59:58 +0000 (17:59 +0100)
commite6b8633c15e0586c7cce507cfca060ece5401f5d
treec78451347aedf0882191be508e45223043083e73
parent9f66cf82a2333f441b03241f503fab1852273dc0
pinctrl: at91-pio4: fix has_config check in atmel_pctl_dt_subnode_to_map()

[ Upstream commit b97760ae8e3dc8bb91881c13425a0bff55f2bd85 ]

Smatch complains about this condition:

if (has_config && num_pins >= 1)

The "has_config" variable is either uninitialized or true.  The
"num_pins" variable is unsigned and we verified that it is non-zero on
the lines before so we know "num_pines >= 1" is true.  Really, we could
just check "num_configs" directly and remove the "has_config" variable.

Fixes: 776180848b57 ("pinctrl: introduce driver for Atmel PIO4 controller")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Ludovic Desroches <ludovic.desroches@microchip.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/pinctrl/pinctrl-at91-pio4.c