From ba49e6ef43eb7eaa9421f8a988c9eb31fa8cc637 Mon Sep 17 00:00:00 2001 From: Bilal Wasim Date: Tue, 19 May 2020 03:39:21 +0500 Subject: [PATCH] drivers: eth: stm32: Fix invalid assertion comparison The check for assertion on the "config_func" was added to validate that the function pointer is valid. However, in the code we are invoking the "config_func" and comparing its output with NULL. This causes build failures with CONFIG_ASSERT=1. Caused by PR-25393. Tested on Nucleo F767Zi board. Fixes #25427 Signed-off-by: Bilal Wasim --- drivers/ethernet/eth_stm32_hal.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/ethernet/eth_stm32_hal.c b/drivers/ethernet/eth_stm32_hal.c index e1edbcb4871cfb..fed4039d3c63fe 100644 --- a/drivers/ethernet/eth_stm32_hal.c +++ b/drivers/ethernet/eth_stm32_hal.c @@ -478,7 +478,7 @@ static void eth_iface_init(struct net_if *iface) dev_data->iface = iface; /* Now that the iface is setup, we are safe to enable IRQs. */ - __ASSERT_NO_MSG(DEV_CFG(dev)->config_func() != NULL); + __ASSERT_NO_MSG(DEV_CFG(dev)->config_func != NULL); DEV_CFG(dev)->config_func(); }