tlv_eeprom: fix comparison of integer expressions of different signedness
authorHugo Villeneuve <hvilleneuve@dimonoff.com>
Tue, 4 Nov 2025 20:20:15 +0000 (15:20 -0500)
committerHugo Villeneuve <hvilleneuve@dimonoff.com>
Mon, 17 Nov 2025 15:36:11 +0000 (10:36 -0500)
Fixes the following warnings:

tlv_eeprom.c:246:23: warning: comparison of integer expressions of different signedness: ‘int’ and ‘long unsigned int’ [-Wsign-compare]
  246 |         for (i = 0; i < ARRAY_SIZE(tlv_code_list); i++) {
      |                       ^

Signed-off-by: Hugo Villeneuve <hvilleneuve@dimonoff.com>
src/tlv_eeprom.c

index 3127660..491b77a 100644 (file)
@@ -244,7 +244,7 @@ static struct tlv_code_desc tlv_code_list[] = {
 static inline const char *tlv_type2name(u8 type)
 {
        char *name = "Unknown";
-       int   i;
+       unsigned int   i;
 
        for (i = 0; i < ARRAY_SIZE(tlv_code_list); i++) {
                if (tlv_code_list[i].m_code == type) {
@@ -405,7 +405,7 @@ static int prog_eeprom(int devnum, u8 *eeprom)
  */
 void show_tlv_code_list(void)
 {
-       int i;
+       unsigned int i;
 
        printf("TLV Code    TLV Name\n");
        printf("========    =================\n");