Skip to contentSkip to conversation

vhost-user-scsi: fix printf format warning

PATCH In review Paolo Bonzini 2 participants 2 messages Dec 11, 2019

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 vhost-user-scsi: fix printf format warning

From: Marc-André Lureau <[email protected]>

Fixes:
../contrib/vhost-user-scsi/vhost-user-scsi.c:118:57: error: format specifies
type 'unsigned char' but the argument has type 'int' [-Werror,-Wformat]
g_warning("Unable to determine cdb len (0x%02hhX)", cdb[0] >> 5);

---
 contrib/vhost-user-scsi/vhost-user-scsi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
contrib/vhost-user-scsi/vhost-user-scsi.c +1 -1
index 0fc14d7..7a1db16 100644
@@ -115,7 +115,7 @@ static int get_cdb_len(uint8_t *cdb)
     case 4: return 16;
     case 5: return 12;
     }
-    g_warning("Unable to determine cdb len (0x%02hhX)", cdb[0] >> 5);
+    g_warning("Unable to determine cdb len (0x%02hhX)", (uint8_t)(cdb[0] >> 5));
     return -1;
 }
 
Signature · 1 line
1.8.3.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 18 lines · Paolo Bonzini

From: Marc-André Lureau <[email protected]>

Fixes:
../contrib/vhost-user-scsi/vhost-user-scsi.c:118:57: error: format specifies
type 'unsigned char' but the argument has type 'int' [-Werror,-Wformat]
g_warning("Unable to determine cdb len (0x%02hhX)", cdb[0] >> 5);

---
 contrib/vhost-user-scsi/vhost-user-scsi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
contrib/vhost-user-scsi/vhost-user-scsi.c +0 -0
index 0fc14d7..7a1db16 100644

contrib/vhost-user-scsi/vhost-user-scsi.c static int get_cdb_len(uint8_t *cdb) · line 120

Quoted 7 lines
contrib/vhost-user-scsi/vhost-user-scsi.c +1 -1
@@ -115,7 +115,7 @@ static int get_cdb_len(uint8_t *cdb)
     case 4: return 16;
     case 5: return 12;
     }
-    g_warning("Unable to determine cdb len (0x%02hhX)", cdb[0] >> 5);
+    g_warning("Unable to determine cdb len (0x%02hhX)", (uint8_t)(cdb[0] >> 5));
     return -1;
 }