Skip to contentSkip to conversation

erst: drop cast to long long

PATCH In review Michael S. Tsirkin 3 participants 3 messages Feb 6, 2022 – Feb 7, 2022

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 erst: drop cast to long long

The way to print uint64_t is with PRIx64, not with a cast to long long.

---
 tests/qtest/erst-test.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tests/qtest/erst-test.c +1 -1
index c6a0ae4013..f94cd8dd8e 100644
@@ -75,7 +75,7 @@ static inline uint64_t in_reg64(ERSTState *s, unsigned reg)
     uint64_t res;
 
     res = qpci_io_readq(s->dev, s->reg_bar, reg);
-    g_test_message("*%s -> %016llx", name, (unsigned long long)res);
+    g_test_message("*%s -> %016" PRIx64, name, res);
 
     return res;
 }
Signature · 1 line
MST
Reviewed-by on v1 1/1
#2 lore raw
In reply to Michael S. Tsirkin
Quoted 14 lines · Michael S. Tsirkin

The way to print uint64_t is with PRIx64, not with a cast to long long.

---
  tests/qtest/erst-test.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
tests/qtest/erst-test.c +0 -0
index c6a0ae4013..f94cd8dd8e 100644

tests/qtest/erst-test.c static inline uint64_t in_reg64(ERSTState *s, unsigned reg) · line 81

Quoted 8 lines
tests/qtest/erst-test.c +1 -1
@@ -75,7 +75,7 @@ static inline uint64_t in_reg64(ERSTState *s, unsigned reg)
      uint64_t res;
 
      res = qpci_io_readq(s->dev, s->reg_bar, reg);
-    g_test_message("*%s -> %016llx", name, (unsigned long long)res);
+    g_test_message("*%s -> %016" PRIx64, name, res);
 
      return res;
  }