[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 01/13] hw/timer/allwinner: Use the AW_A10_PIT_TIMER_NR definition
From: |
Philippe Mathieu-Daudé |
Subject: |
[PATCH 01/13] hw/timer/allwinner: Use the AW_A10_PIT_TIMER_NR definition |
Date: |
Thu, 19 Dec 2019 19:51:15 +0100 |
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
- [RFC PATCH 00/13] hw/timer/allwinner: Make it reusable, Philippe Mathieu-Daudé, 2019/12/19
- [PATCH 01/13] hw/timer/allwinner: Use the AW_A10_PIT_TIMER_NR definition,
Philippe Mathieu-Daudé <=
- [PATCH 03/13] hw/timer/allwinner: Remove unused definitions, Philippe Mathieu-Daudé, 2019/12/19
- [PATCH 04/13] hw/timer/allwinner: Move definitions from header to source, Philippe Mathieu-Daudé, 2019/12/19
- [PATCH 02/13] hw/timer/allwinner: Add AW_PIT_TIMER_MAX definition, Philippe Mathieu-Daudé, 2019/12/19
- [RFC PATCH 06/13] hw/timer/allwinner: Rename 'timer_context' as 'timer', Philippe Mathieu-Daudé, 2019/12/19
- [RFC PATCH 05/13] hw/timer/allwinner: Rename the ptimer field, Philippe Mathieu-Daudé, 2019/12/19
- [RFC PATCH 08/13] hw/timer/allwinner: Add a timer_count field, Philippe Mathieu-Daudé, 2019/12/19