From e84b8ff095f949c2956db09dddbdbade72dc28b0 Mon Sep 17 00:00:00 2001 From: Hugo Villeneuve Date: Thu, 6 Nov 2025 11:29:14 -0500 Subject: [PATCH] [SUBMIT] tlv_eeprom: avoid code duplication in decode_tlv() Signed-off-by: Hugo Villeneuve --- src/tlv_eeprom.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/src/tlv_eeprom.c b/src/tlv_eeprom.c index 210f911..78cb150 100644 --- a/src/tlv_eeprom.c +++ b/src/tlv_eeprom.c @@ -327,18 +327,12 @@ static void decode_tlv_value(struct tlvinfo_tlv *tlv, char *value, int value_len case TLV_CODE_MAC_SIZE: sprintf(value, "%u", (tlv->value[0] << 8) | tlv->value[1]); break; - case TLV_CODE_VENDOR_EXT: - value[0] = 0; - for (i = 0; (i < (DECODE_VALUE_MAX / 5)) && (i < tlv->length); - i++) { - sprintf(value, "%s 0x%02X", value, tlv->value[i]); - } - break; case TLV_CODE_CRC_32: sprintf(value, "0x%02X%02X%02X%02X", tlv->value[0], tlv->value[1], tlv->value[2], tlv->value[3]); break; + case TLV_CODE_VENDOR_EXT: default: value[0] = 0; for (i = 0; (i < (DECODE_VALUE_MAX / 5)) && (i < tlv->length); -- 2.20.1