[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v5 13/25] hw/intc/sh_intc: Drop another useless macro
From: |
BALATON Zoltan |
Subject: |
[PATCH v5 13/25] hw/intc/sh_intc: Drop another useless macro |
Date: |
Fri, 29 Oct 2021 18:23:36 +0200 |
The INT_REG_PARAMS macro was only used a few times within one function
on adjacent lines and is actually more complex than writing out the
parameters so simplify it by expanding the macro at call sites and
dropping the #define.
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 | 15 ++++-----------
1 file changed, 4 insertions(+), 11 deletions(-)
diff --git a/hw/intc/sh_intc.c b/hw/intc/sh_intc.c
index e386372b6f..763ebbfec2 100644
--- a/hw/intc/sh_intc.c
+++ b/hw/intc/sh_intc.c
@@ -433,16 +433,12 @@ int sh_intc_init(MemoryRegion *sysmem,
memory_region_init_io(&desc->iomem, NULL, &sh_intc_ops, desc, "intc",
0x100000000ULL);
-#define INT_REG_PARAMS(reg_struct, type, action, j) \
- reg_struct->action##_reg, #type, #action, j
if (desc->mask_regs) {
for (i = 0; i < desc->nr_mask_regs; i++) {
struct intc_mask_reg *mr = desc->mask_regs + i;
- j += sh_intc_register(sysmem, desc,
- INT_REG_PARAMS(mr, mask, set, j));
- j += sh_intc_register(sysmem, desc,
- INT_REG_PARAMS(mr, mask, clr, j));
+ j += sh_intc_register(sysmem, desc, mr->set_reg, "mask", "set", j);
+ j += sh_intc_register(sysmem, desc, mr->clr_reg, "mask", "clr", j);
}
}
@@ -450,13 +446,10 @@ int sh_intc_init(MemoryRegion *sysmem,
for (i = 0; i < desc->nr_prio_regs; i++) {
struct intc_prio_reg *pr = desc->prio_regs + i;
- j += sh_intc_register(sysmem, desc,
- INT_REG_PARAMS(pr, prio, set, j));
- j += sh_intc_register(sysmem, desc,
- INT_REG_PARAMS(pr, prio, clr, j));
+ j += sh_intc_register(sysmem, desc, pr->set_reg, "prio", "set", j);
+ j += sh_intc_register(sysmem, desc, pr->clr_reg, "prio", "clr", j);
}
}
-#undef INT_REG_PARAMS
return 0;
}
--
2.21.4
- [PATCH v5 00/25] More SH4 clean ups, BALATON Zoltan, 2021/10/29
- [PATCH v5 04/25] hw/char/sh_serial: Do not abort on invalid access, BALATON Zoltan, 2021/10/29
- [PATCH v5 02/25] hw/sh4: Change debug printfs to traces, BALATON Zoltan, 2021/10/29
- [PATCH v5 06/25] hw/char/sh_serial: Embed QEMUTimer in state struct, BALATON Zoltan, 2021/10/29
- [PATCH v5 03/25] hw/sh4/r2d: Use error_report instead of fprintf to stderr, BALATON Zoltan, 2021/10/29
- [PATCH v5 18/25] hw/intc/sh_intc: Replace abort() with g_assert_not_reached(), BALATON Zoltan, 2021/10/29
- [PATCH v5 19/25] hw/intc/sh_intc: Avoid using continue in loops, BALATON Zoltan, 2021/10/29
- [PATCH v5 13/25] hw/intc/sh_intc: Drop another useless macro,
BALATON Zoltan <=
- [PATCH v5 17/25] hw/intc/sh_intc: Inline and drop sh_intc_source() function, BALATON Zoltan, 2021/10/29
- [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