[PATCH 1/1] xilinx: common: fix board_late_init_xilinx()

Heinrich Schuchardt heinrich.schuchardt at canonical.com
Sat Oct 8 11:13:17 CEST 2022


Compiling with GCC-12 leads to an error:

    +board/xilinx/common/board.c:479:37: error: the comparison will always
     evaluate as 'true' for the address of 'mac_addr' will never be NULL
     [-Werror=address]
    +  479 |                                 if (!desc->mac_addr[i])
    +      |                                     ^

Remove the redundant check.

Fixes: a03b594738f8 ("xilinx: board: Add support for additional card detection")
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt at canonical.com>
---
 board/xilinx/common/board.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/board/xilinx/common/board.c b/board/xilinx/common/board.c
index 391ce4dbd7..607868926e 100644
--- a/board/xilinx/common/board.c
+++ b/board/xilinx/common/board.c
@@ -476,9 +476,6 @@ int board_late_init_xilinx(void)
 				continue;
 
 			for (i = 0; i < EEPROM_HDR_NO_OF_MAC_ADDR; i++) {
-				if (!desc->mac_addr[i])
-					break;
-
 				if (is_valid_ethaddr((const u8 *)desc->mac_addr[i]))
 					ret |= eth_env_set_enetaddr_by_index("eth",
 							macid++, desc->mac_addr[i]);
-- 
2.37.2



More information about the U-Boot mailing list