[U-Boot] [PATCH 1/1] rockchip: gpio: remove dead code

In the following statements if (a) return a; if (a) return c; the second return can never be executed.
Identified by cppcheck.
Signed-off-by: Heinrich Schuchardt xypron.glpk@gmx.de --- drivers/gpio/rk_gpio.c | 4 ---- 1 file changed, 4 deletions(-)
diff --git a/drivers/gpio/rk_gpio.c b/drivers/gpio/rk_gpio.c index 11fc3e26bd..2419636c5f 100644 --- a/drivers/gpio/rk_gpio.c +++ b/drivers/gpio/rk_gpio.c @@ -86,10 +86,6 @@ static int rockchip_gpio_get_function(struct udevice *dev, unsigned offset) ret = pinctrl_get_gpio_mux(priv->pinctrl, priv->bank, offset); if (ret) return ret; - - /* If it's not 0, then it is not a GPIO */ - if (ret) - return GPIOF_FUNC; is_output = readl(®s->swport_ddr) & OFFSET_TO_BIT(offset);
return is_output ? GPIOF_OUTPUT : GPIOF_INPUT;

On 31 Jan 2018, at 00:45, Heinrich Schuchardt xypron.glpk@gmx.de wrote:
In the following statements if (a) return a; if (a) return c; the second return can never be executed.
Identified by cppcheck.
Signed-off-by: Heinrich Schuchardt xypron.glpk@gmx.de
Acked-by: Philipp Tomsich philipp.tomsich@theobroma-systems.com Reviewed-by: Philipp Tomsich philipp.tomsich@theobroma-systems.com

In the following statements if (a) return a; if (a) return c; the second return can never be executed.
Identified by cppcheck.
Signed-off-by: Heinrich Schuchardt xypron.glpk@gmx.de Acked-by: Philipp Tomsich philipp.tomsich@theobroma-systems.com Reviewed-by: Philipp Tomsich philipp.tomsich@theobroma-systems.com
drivers/gpio/rk_gpio.c | 4 ---- 1 file changed, 4 deletions(-)
Applied to u-boot-rockchip, thanks!

In the following statements if (a) return a; if (a) return c; the second return can never be executed.
Identified by cppcheck.
Signed-off-by: Heinrich Schuchardt xypron.glpk@gmx.de Acked-by: Philipp Tomsich philipp.tomsich@theobroma-systems.com Reviewed-by: Philipp Tomsich philipp.tomsich@theobroma-systems.com
drivers/gpio/rk_gpio.c | 4 ---- 1 file changed, 4 deletions(-)
Applied to u-boot-rockchip, thanks!

In the following statements if (a) return a; if (a) return c; the second return can never be executed.
Identified by cppcheck.
Signed-off-by: Heinrich Schuchardt xypron.glpk@gmx.de Acked-by: Philipp Tomsich philipp.tomsich@theobroma-systems.com Reviewed-by: Philipp Tomsich philipp.tomsich@theobroma-systems.com
drivers/gpio/rk_gpio.c | 4 ---- 1 file changed, 4 deletions(-)
Applied to u-boot-rockchip, thanks!
participants (3)
-
Dr. Philipp Tomsich
-
Heinrich Schuchardt
-
Philipp Tomsich