[PATCH 3/4] xilinx: common: Optimise updating ethaddr from eeprom

Michal Simek michal.simek at xilinx.com
Wed Feb 23 15:00:58 CET 2022


From: Ashok Reddy Soma <ashok.reddy.soma at xilinx.com>

In board_late_init_xilinx() eth*addr are updated from the values read from
eeprom. Ideally the MAC addresses are updated sequencially. So if any
MAC address is invalid, it means there are no further valid values.
So optimise this logic by replacing continue with break.

Signed-off-by: Ashok Reddy Soma <ashok.reddy.soma at xilinx.com>
Signed-off-by: Michal Simek <michal.simek at xilinx.com>
---

 board/xilinx/common/board.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/board/xilinx/common/board.c b/board/xilinx/common/board.c
index 0068cb879263..db089c4a0b17 100644
--- a/board/xilinx/common/board.c
+++ b/board/xilinx/common/board.c
@@ -416,7 +416,7 @@ int board_late_init_xilinx(void)
 
 			for (i = 0; i < EEPROM_HDR_NO_OF_MAC_ADDR; i++) {
 				if (!desc->mac_addr[i])
-					continue;
+					break;
 
 				if (is_valid_ethaddr((const u8 *)desc->mac_addr[i]))
 					ret |= eth_env_set_enetaddr_by_index("eth",
-- 
2.35.1



More information about the U-Boot mailing list