diff options
-rw-r--r-- | board/xilinx/common/board.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/board/xilinx/common/board.c b/board/xilinx/common/board.c index f5117012d62..b47d2d23f91 100644 --- a/board/xilinx/common/board.c +++ b/board/xilinx/common/board.c @@ -105,10 +105,14 @@ static void xilinx_eeprom_legacy_cleanup(char *eeprom, int size) for (i = 0; i < size; i++) { byte = eeprom[i]; - /* Remove all non printable chars but ignore MAC address */ - if ((i < offsetof(struct xilinx_legacy_format, eth_mac) || - i >= offsetof(struct xilinx_legacy_format, unused1)) && - (byte < '!' || byte > '~')) { + /* Ignore MAC address */ + if (i >= offsetof(struct xilinx_legacy_format, eth_mac) && + i < offsetof(struct xilinx_legacy_format, unused1)) { + continue; + } + + /* Remove all non printable chars */ + if (byte < '!' || byte > '~') { eeprom[i] = 0; continue; } |