[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 15/30] hw/intc/sh_intc: Use existing macro instead of local one
From: |
Philippe Mathieu-Daudé |
Subject: |
[PULL 15/30] hw/intc/sh_intc: Use existing macro instead of local one |
Date: |
Sat, 30 Oct 2021 19:06:00 +0200 |
From: BALATON Zoltan <balaton@eik.bme.hu>
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>
Message-Id:
<53f033477c73b7c9b021d36033c590416d6199c7.1635541329.git.balaton@eik.bme.hu>
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.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 673606b24b3..a98953d665f 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.31.1
- [PULL 05/30] hw/sh4: Coding style: Remove unnecessary casts, (continued)
- [PULL 05/30] hw/sh4: Coding style: Remove unnecessary casts, Philippe Mathieu-Daudé, 2021/10/30
- [PULL 06/30] hw/sh4: Fix typos in a comment, Philippe Mathieu-Daudé, 2021/10/30
- [PULL 07/30] hw/sh4: Change debug printfs to traces, Philippe Mathieu-Daudé, 2021/10/30
- [PULL 08/30] hw/sh4/r2d: Use error_report instead of fprintf to stderr, Philippe Mathieu-Daudé, 2021/10/30
- [PULL 09/30] hw/char/sh_serial: Do not abort on invalid access, Philippe Mathieu-Daudé, 2021/10/30
- [PULL 10/30] hw/char/sh_serial: Rename type sh_serial_state to SHSerialState, Philippe Mathieu-Daudé, 2021/10/30
- [PULL 11/30] hw/char/sh_serial: Embed QEMUTimer in state struct, Philippe Mathieu-Daudé, 2021/10/30
- [PULL 12/30] hw/char/sh_serial: Split off sh_serial_reset() from sh_serial_init(), Philippe Mathieu-Daudé, 2021/10/30
- [PULL 13/30] hw/char/sh_serial: QOM-ify, Philippe Mathieu-Daudé, 2021/10/30
- [PULL 14/30] hw/char/sh_serial: Add device id to trace output, Philippe Mathieu-Daudé, 2021/10/30
- [PULL 15/30] hw/intc/sh_intc: Use existing macro instead of local one,
Philippe Mathieu-Daudé <=
- [PULL 16/30] hw/intc/sh_intc: Turn some defines into an enum, Philippe Mathieu-Daudé, 2021/10/30
- [PULL 17/30] hw/intc/sh_intc: Rename iomem region, Philippe Mathieu-Daudé, 2021/10/30
- [PULL 18/30] hw/intc/sh_intc: Drop another useless macro, Philippe Mathieu-Daudé, 2021/10/30
- [PULL 19/30] hw/intc/sh_intc: Move sh_intc_register() closer to its only user, Philippe Mathieu-Daudé, 2021/10/30
- [PULL 20/30] hw/intc/sh_intc: Remove excessive parenthesis, Philippe Mathieu-Daudé, 2021/10/30
- [PULL 21/30] hw/intc/sh_intc: Use array index instead of pointer arithmetics, Philippe Mathieu-Daudé, 2021/10/30
- [PULL 22/30] hw/intc/sh_intc: Inline and drop sh_intc_source() function, Philippe Mathieu-Daudé, 2021/10/30
- [PULL 23/30] hw/intc/sh_intc: Replace abort() with g_assert_not_reached(), Philippe Mathieu-Daudé, 2021/10/30
- [PULL 24/30] hw/intc/sh_intc: Avoid using continue in loops, Philippe Mathieu-Daudé, 2021/10/30
- [PULL 25/30] hw/intc/sh_intc: Simplify allocating sources array, Philippe Mathieu-Daudé, 2021/10/30