diff mbox series

[v4,21/23] hw/timer/sh_timer: Fix format strings and remove casts

Message ID 7cc78641a1f9fa0f75cb23c6b8d8a0dce9eaaec8.1635449225.git.balaton@eik.bme.hu
State New
Headers show
Series More SH4 clean ups | expand

Commit Message

BALATON Zoltan Oct. 28, 2021, 7:27 p.m. UTC
The type casts are not needed when using the right format strings.

Signed-off-by: BALATON Zoltan <balaton@eik.bme.hu>
---
 hw/timer/sh_timer.c | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)
diff mbox series

Patch

diff --git a/hw/timer/sh_timer.c b/hw/timer/sh_timer.c
index 2038adfb0a..fca27cb247 100644
--- a/hw/timer/sh_timer.c
+++ b/hw/timer/sh_timer.c
@@ -77,7 +77,7 @@  static uint32_t sh_timer_read(void *opaque, hwaddr offset)
         }
         /* fall through */
     default:
-        hw_error("sh_timer_read: Bad offset %x\n", (int)offset);
+        hw_error("sh_timer_read: Bad offset 0x%"HWADDR_PRIx"\n", offset);
         return 0;
     }
 }
@@ -193,7 +193,7 @@  static void sh_timer_write(void *opaque, hwaddr offset,
         }
         /* fallthrough */
     default:
-        hw_error("sh_timer_write: Bad offset %x\n", (int)offset);
+        hw_error("sh_timer_write: Bad offset 0x%"HWADDR_PRIx"\n", offset);
     }
     sh_timer_update(s);
 }
@@ -264,7 +264,8 @@  static uint64_t tmu012_read(void *opaque, hwaddr offset,
     trace_sh_timer_read(offset);
     if (offset >= 0x20) {
         if (!(s->feat & TMU012_FEAT_3CHAN)) {
-            hw_error("tmu012_write: Bad channel offset %x\n", (int)offset);
+            hw_error("tmu012_write: Bad channel offset 0x%"HWADDR_PRIx"\n",
+                     offset);
         }
         return sh_timer_read(s->timer[2], offset - 0x20);
     }
@@ -282,7 +283,7 @@  static uint64_t tmu012_read(void *opaque, hwaddr offset,
         return s->tocr;
     }
 
-    hw_error("tmu012_write: Bad offset %x\n", (int)offset);
+    hw_error("tmu012_write: Bad offset 0x%"HWADDR_PRIx"\n", offset);
     return 0;
 }
 
@@ -294,7 +295,8 @@  static void tmu012_write(void *opaque, hwaddr offset,
     trace_sh_timer_write(offset, value);
     if (offset >= 0x20) {
         if (!(s->feat & TMU012_FEAT_3CHAN)) {
-            hw_error("tmu012_write: Bad channel offset %x\n", (int)offset);
+            hw_error("tmu012_write: Bad channel offset 0x%"HWADDR_PRIx"\n",
+                     offset);
         }
         sh_timer_write(s->timer[2], offset - 0x20, value);
         return;