On Thu, Dec 19, 2019 at 7:51 PM Philippe Mathieu-Daudé <
address@hidden> wrote:
We have a definition for this magic value '6', use it.
Signed-off-by: Philippe Mathieu-Daudé <address@hidden>
---
include/hw/timer/allwinner-a10-pit.h | 2 +-
hw/timer/allwinner-a10-pit.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/include/hw/timer/allwinner-a10-pit.h b/include/hw/timer/allwinner-a10-pit.h
index 871c95b512..6aceda81ee 100644
--- a/include/hw/timer/allwinner-a10-pit.h
+++ b/include/hw/timer/allwinner-a10-pit.h
@@ -32,7 +32,7 @@
#define AW_A10_PIT_TIMER_BASE 0x10
#define AW_A10_PIT_TIMER_BASE_END \
- (AW_A10_PIT_TIMER_BASE * 6 + AW_A10_PIT_TIMER_COUNT)
+ (AW_A10_PIT_TIMER_BASE * AW_A10_PIT_TIMER_NR + AW_A10_PIT_TIMER_COUNT)
#define AW_A10_PIT_DEFAULT_CLOCK 0x4
diff --git a/hw/timer/allwinner-a10-pit.c b/hw/timer/allwinner-a10-pit.c
index aae880f5b3..117e5c7bf8 100644
--- a/hw/timer/allwinner-a10-pit.c
+++ b/hw/timer/allwinner-a10-pit.c
@@ -225,7 +225,7 @@ static void a10_pit_reset(DeviceState *dev)
s->irq_status = 0;
a10_pit_update_irq(s);
- for (i = 0; i < 6; i++) {
+ for (i = 0; i < AW_A10_PIT_TIMER_NR; i++) {
s->control[i] = AW_A10_PIT_DEFAULT_CLOCK;
s->interval[i] = 0;
s->count[i] = 0;
--
2.21.0
Change looks fine to me:
Works fine with -M orangepi-pc and -M cubieboard: