[SUBMIT] tlv_eeprom: avoid code duplication in decode_tlv()
authorHugo Villeneuve <hvilleneuve@dimonoff.com>
Thu, 6 Nov 2025 16:29:14 +0000 (11:29 -0500)
committerHugo Villeneuve <hvilleneuve@dimonoff.com>
Mon, 17 Nov 2025 15:50:01 +0000 (10:50 -0500)
Signed-off-by: Hugo Villeneuve <hvilleneuve@dimonoff.com>
src/tlv_eeprom.c

index 210f911..78cb150 100644 (file)
@@ -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);