[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v4 21/23] hw/timer/sh_timer: Fix format strings and remove casts
From: |
BALATON Zoltan |
Subject: |
[PATCH v4 21/23] hw/timer/sh_timer: Fix format strings and remove casts |
Date: |
Thu, 28 Oct 2021 21:27:05 +0200 |
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 --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;
--
2.21.4
- Re: [PATCH v4 06/23] hw/char/sh_serial: QOM-ify, (continued)
[PATCH v4 13/23] hw/intc/sh_intc: Remove excessive parenthesis, BALATON Zoltan, 2021/10/28
[PATCH v4 11/23] hw/intc/sh_intc: Drop another useless macro, BALATON Zoltan, 2021/10/28
[PATCH v4 23/23] hw/timer/sh_timer: Fix timer memory region size, BALATON Zoltan, 2021/10/28
[PATCH v4 20/23] hw/timer/sh_timer: Rename sh_timer_state to SHTimerState, BALATON Zoltan, 2021/10/28
[PATCH v4 16/23] hw/intc/sh_intc: Replace abort() with g_assert_not_reached(), BALATON Zoltan, 2021/10/28
[PATCH v4 21/23] hw/timer/sh_timer: Fix format strings and remove casts,
BALATON Zoltan <=
[PATCH v4 22/23] hw/timer/sh_timer: Do not wrap lines that are not too long, BALATON Zoltan, 2021/10/28
[PATCH v4 17/23] hw/intc/sh_intc: Avoid using continue in loops, BALATON Zoltan, 2021/10/28
[PATCH v4 18/23] hw/intc/sh_intc: Simplify allocating sources array, BALATON Zoltan, 2021/10/28