[PATCH 1/1] board: gateworks: gw_ventana: fix building with GCC 12.2

Building with GCC 12.2 results in an error
board/gateworks/gw_ventana/gw_ventana.c:636:68: error: the comparison will always evaluate as 'true' for the address of 'pwm_padmux' will never be NULL [-Werror=address] 636 | } else if (hwconfig_subarg_cmp(arg, "mode", "pwm") && | ^~
Remove the superfluous check.
Signed-off-by: Heinrich Schuchardt heinrich.schuchardt@canonical.com --- board/gateworks/gw_ventana/gw_ventana.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/board/gateworks/gw_ventana/gw_ventana.c b/board/gateworks/gw_ventana/gw_ventana.c index 99f52b9953..78d317d864 100644 --- a/board/gateworks/gw_ventana/gw_ventana.c +++ b/board/gateworks/gw_ventana/gw_ventana.c @@ -633,8 +633,7 @@ void setup_board_gpio(int board, struct ventana_board_info *info) ctrl); gpio_requestf(cfg->gpio_param, "dio%d", i); gpio_direction_input(cfg->gpio_param); - } else if (hwconfig_subarg_cmp(arg, "mode", "pwm") && - cfg->pwm_padmux) { + } else if (hwconfig_subarg_cmp(arg, "mode", "pwm")) { if (!cfg->pwm_param) { printf("DIO%d: Error: pwm config invalid\n", i);

On Wed, Oct 12, 2022 at 9:59 AM Heinrich Schuchardt heinrich.schuchardt@canonical.com wrote:
Building with GCC 12.2 results in an error
board/gateworks/gw_ventana/gw_ventana.c:636:68: error: the comparison will always evaluate as 'true' for the address of 'pwm_padmux' will never be NULL [-Werror=address] 636 | } else if (hwconfig_subarg_cmp(arg, "mode", "pwm") && | ^~
Remove the superfluous check.
Signed-off-by: Heinrich Schuchardt heinrich.schuchardt@canonical.com
board/gateworks/gw_ventana/gw_ventana.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/board/gateworks/gw_ventana/gw_ventana.c b/board/gateworks/gw_ventana/gw_ventana.c index 99f52b9953..78d317d864 100644 --- a/board/gateworks/gw_ventana/gw_ventana.c +++ b/board/gateworks/gw_ventana/gw_ventana.c @@ -633,8 +633,7 @@ void setup_board_gpio(int board, struct ventana_board_info *info) ctrl); gpio_requestf(cfg->gpio_param, "dio%d", i); gpio_direction_input(cfg->gpio_param);
} else if (hwconfig_subarg_cmp(arg, "mode", "pwm") &&
cfg->pwm_padmux) {
} else if (hwconfig_subarg_cmp(arg, "mode", "pwm")) { if (!cfg->pwm_param) { printf("DIO%d: Error: pwm config invalid\n", i);
-- 2.37.2
Heinrich,
Thanks, adding the maintainers of U-Boot imx for inclusion.
Reviewed-By: Tim Harvey tharvey@gateworks.com
Best Regards,
Tim

On Wed, Oct 12, 2022 at 1:59 PM Heinrich Schuchardt heinrich.schuchardt@canonical.com wrote:
Building with GCC 12.2 results in an error
board/gateworks/gw_ventana/gw_ventana.c:636:68: error: the comparison will always evaluate as 'true' for the address of 'pwm_padmux' will never be NULL [-Werror=address] 636 | } else if (hwconfig_subarg_cmp(arg, "mode", "pwm") && | ^~
Remove the superfluous check.
Signed-off-by: Heinrich Schuchardt heinrich.schuchardt@canonical.com
Reviewed-by: Fabio Estevam festevam@denx.de

On Wed, Oct 12, 2022 at 06:59:27PM +0200, Heinrich Schuchardt wrote:
Building with GCC 12.2 results in an error
board/gateworks/gw_ventana/gw_ventana.c:636:68: error: the comparison will always evaluate as 'true' for the address of 'pwm_padmux' will never be NULL [-Werror=address] 636 | } else if (hwconfig_subarg_cmp(arg, "mode", "pwm") && | ^~
Remove the superfluous check.
Signed-off-by: Heinrich Schuchardt heinrich.schuchardt@canonical.com Reviewed-By: Tim Harvey tharvey@gateworks.com Reviewed-by: Fabio Estevam festevam@denx.de
Applied to u-boot/master, thanks!
participants (4)
-
Fabio Estevam
-
Heinrich Schuchardt
-
Tim Harvey
-
Tom Rini