[PATCH v1 6/8] toradex: common: Remove #ifdef usage for 2nd ethaddr

Francesco Dolcini francesco.dolcini at toradex.com
Thu Jul 21 15:17:36 CEST 2022


Fix checkpatch warn, use `IS_ENABLED(CONFIG_TDX_CFG_BLOCK_2ND_ETHADDR)`
instead of `#ifdef CONFIG_TDX_CFG_BLOCK_2ND_ETHADDR`.

Signed-off-by: Francesco Dolcini <francesco.dolcini at toradex.com>
---
 board/toradex/common/tdx-common.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/board/toradex/common/tdx-common.c b/board/toradex/common/tdx-common.c
index 3643ebbb1632..2284fcddb510 100644
--- a/board/toradex/common/tdx-common.c
+++ b/board/toradex/common/tdx-common.c
@@ -151,8 +151,8 @@ int show_board_info(void)
 	if (!eth_env_get_enetaddr("ethaddr", ethaddr))
 		eth_env_set_enetaddr("ethaddr", (u8 *)&tdx_eth_addr);
 
-#ifdef CONFIG_TDX_CFG_BLOCK_2ND_ETHADDR
-	if (!eth_env_get_enetaddr("eth1addr", ethaddr)) {
+	if (IS_ENABLED(CONFIG_TDX_CFG_BLOCK_2ND_ETHADDR) &&
+	    !eth_env_get_enetaddr("eth1addr", ethaddr)) {
 		/*
 		 * Secondary MAC address is allocated from block
 		 * 0x100000 higher then the first MAC address
@@ -161,7 +161,6 @@ int show_board_info(void)
 		ethaddr[3] += 0x10;
 		eth_env_set_enetaddr("eth1addr", ethaddr);
 	}
-#endif
 
 	return 0;
 }
-- 
2.25.1



More information about the U-Boot mailing list