[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v2 11/11] hw/intc/sh_intc: Drop another useless macro
From: |
BALATON Zoltan |
Subject: |
[PATCH v2 11/11] hw/intc/sh_intc: Drop another useless macro |
Date: |
Wed, 27 Oct 2021 15:46:17 +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>
---
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 fc1905f299..d3616b0078 100644
--- a/hw/intc/sh_intc.c
+++ b/hw/intc/sh_intc.c
@@ -432,16 +432,12 @@ int sh_intc_init(MemoryRegion *sysmem,
desc->irqs = qemu_allocate_irqs(sh_intc_set_irq, desc, nr_sources);
memory_region_init_io(&desc->iomem, NULL, &sh_intc_ops, desc, "intc", 4);
-#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);
}
}
@@ -449,13 +445,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 v2 00/11] More SH4 clean ups, BALATON Zoltan, 2021/10/27
- [PATCH v2 04/11] hw/sh4/r2d: Use error_report instead of fprintf to stderr, BALATON Zoltan, 2021/10/27
- [PATCH v2 05/11] hw/char/sh_serial: Rename type sh_serial_state to SHSerialState, BALATON Zoltan, 2021/10/27
- [PATCH v2 01/11] hw/sh4: Fix a typo in a comment, BALATON Zoltan, 2021/10/27
- [PATCH v2 10/11] hw/intc/sh_intc: Clean up iomem region, BALATON Zoltan, 2021/10/27
- [PATCH v2 11/11] hw/intc/sh_intc: Drop another useless macro,
BALATON Zoltan <=
- [PATCH v2 02/11] hw//sh4: Use qemu_log instead of fprintf to stderr, BALATON Zoltan, 2021/10/27
- [PATCH v2 06/11] hw/char/sh_serial: QOM-ify, BALATON Zoltan, 2021/10/27
- [PATCH v2 07/11] hw/char/sh_serial: Add device id to trace output, BALATON Zoltan, 2021/10/27
- [PATCH v2 03/11] hw/sh4: Change debug printfs to traces, BALATON Zoltan, 2021/10/27
- [PATCH v2 08/11] hw/intc/sh_intc: Use existing macro instead of local one, BALATON Zoltan, 2021/10/27