[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v5 10/25] hw/intc/sh_intc: Use existing macro instead of local on
From: |
BALATON Zoltan |
Subject: |
[PATCH v5 10/25] hw/intc/sh_intc: Use existing macro instead of local one |
Date: |
Fri, 29 Oct 2021 18:23:36 +0200 |
The INTC_A7 local macro does the same as the A7ADDR from
include/sh/sh.h so use the latter and drop the local macro definition.
Signed-off-by: BALATON Zoltan <balaton@eik.bme.hu>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
---
hw/intc/sh_intc.c | 12 +++++-------
1 file changed, 5 insertions(+), 7 deletions(-)
diff --git a/hw/intc/sh_intc.c b/hw/intc/sh_intc.c
index c1058d97c0..0bd27aaf4f 100644
--- a/hw/intc/sh_intc.c
+++ b/hw/intc/sh_intc.c
@@ -16,8 +16,6 @@
#include "hw/sh4/sh.h"
#include "trace.h"
-#define INTC_A7(x) ((x) & 0x1fffffff)
-
void sh_intc_toggle_source(struct intc_source *source,
int enable_adj, int assert_adj)
{
@@ -112,12 +110,12 @@ int sh_intc_get_pending_vector(struct intc_desc *desc,
int imask)
static unsigned int sh_intc_mode(unsigned long address,
unsigned long set_reg, unsigned long clr_reg)
{
- if ((address != INTC_A7(set_reg)) &&
- (address != INTC_A7(clr_reg)))
+ if ((address != A7ADDR(set_reg)) &&
+ (address != A7ADDR(clr_reg)))
return INTC_MODE_NONE;
if (set_reg && clr_reg) {
- if (address == INTC_A7(set_reg)) {
+ if (address == A7ADDR(set_reg)) {
return INTC_MODE_DUAL_SET;
} else {
return INTC_MODE_DUAL_CLR;
@@ -297,11 +295,11 @@ static unsigned int sh_intc_register(MemoryRegion *sysmem,
#define SH_INTC_IOMEM_FORMAT "interrupt-controller-%s-%s-%s"
snprintf(name, sizeof(name), SH_INTC_IOMEM_FORMAT, type, action, "p4");
- memory_region_init_alias(iomem_p4, NULL, name, iomem, INTC_A7(address), 4);
+ memory_region_init_alias(iomem_p4, NULL, name, iomem, A7ADDR(address), 4);
memory_region_add_subregion(sysmem, P4ADDR(address), iomem_p4);
snprintf(name, sizeof(name), SH_INTC_IOMEM_FORMAT, type, action, "a7");
- memory_region_init_alias(iomem_a7, NULL, name, iomem, INTC_A7(address), 4);
+ memory_region_init_alias(iomem_a7, NULL, name, iomem, A7ADDR(address), 4);
memory_region_add_subregion(sysmem, A7ADDR(address), iomem_a7);
#undef SH_INTC_IOMEM_FORMAT
--
2.21.4
- [PATCH v5 12/25] hw/intc/sh_intc: Rename iomem region, (continued)
- [PATCH v5 12/25] hw/intc/sh_intc: Rename iomem region, BALATON Zoltan, 2021/10/29
- [PATCH v5 05/25] hw/char/sh_serial: Rename type sh_serial_state to SHSerialState, BALATON Zoltan, 2021/10/29
- [PATCH v5 11/25] hw/intc/sh_intc: Turn some defines into an enum, BALATON Zoltan, 2021/10/29
- [PATCH v5 08/25] hw/char/sh_serial: QOM-ify, BALATON Zoltan, 2021/10/29
- [PATCH v5 01/25] hw/sh4: Fix typos in a comment, BALATON Zoltan, 2021/10/29
- [PATCH v5 20/25] hw/intc/sh_intc: Simplify allocating sources array, BALATON Zoltan, 2021/10/29
- [PATCH v5 25/25] hw/timer/sh_timer: Remove use of hw_error, BALATON Zoltan, 2021/10/29
- [PATCH v5 22/25] hw/timer/sh_timer: Rename sh_timer_state to SHTimerState, BALATON Zoltan, 2021/10/29
- [PATCH v5 07/25] hw/char/sh_serial: Split off sh_serial_reset() from sh_serial_init(), BALATON Zoltan, 2021/10/29
- [PATCH v5 09/25] hw/char/sh_serial: Add device id to trace output, BALATON Zoltan, 2021/10/29
- [PATCH v5 10/25] hw/intc/sh_intc: Use existing macro instead of local one,
BALATON Zoltan <=
- [PATCH v5 15/25] hw/intc/sh_intc: Remove excessive parenthesis, BALATON Zoltan, 2021/10/29
- [PATCH v5 14/25] hw/intc/sh_intc: Move sh_intc_register() closer to its only user, BALATON Zoltan, 2021/10/29
- [PATCH v5 16/25] hw/intc/sh_intc: Use array index instead of pointer arithmetics, BALATON Zoltan, 2021/10/29
- [PATCH v5 21/25] hw/intc/sh_intc: Remove unneeded local variable initialisers, BALATON Zoltan, 2021/10/29
- [PATCH v5 24/25] hw/timer/sh_timer: Fix timer memory region size, BALATON Zoltan, 2021/10/29
- [PATCH v5 23/25] hw/timer/sh_timer: Do not wrap lines that are not too long, BALATON Zoltan, 2021/10/29