[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v5 14/25] hw/intc/sh_intc: Move sh_intc_register() closer to its
From: |
BALATON Zoltan |
Subject: |
[PATCH v5 14/25] hw/intc/sh_intc: Move sh_intc_register() closer to its only user |
Date: |
Fri, 29 Oct 2021 18:23:36 +0200 |
The sh_intc_register() function is only used at one place. Move them
together so it's easier to see what's going on.
Signed-off-by: BALATON Zoltan <balaton@eik.bme.hu>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
hw/intc/sh_intc.c | 60 +++++++++++++++++++++++------------------------
1 file changed, 30 insertions(+), 30 deletions(-)
diff --git a/hw/intc/sh_intc.c b/hw/intc/sh_intc.c
index 763ebbfec2..54803bc2ca 100644
--- a/hw/intc/sh_intc.c
+++ b/hw/intc/sh_intc.c
@@ -270,36 +270,6 @@ struct intc_source *sh_intc_source(struct intc_desc *desc,
intc_enum id)
return NULL;
}
-static unsigned int sh_intc_register(MemoryRegion *sysmem,
- struct intc_desc *desc,
- const unsigned long address,
- const char *type,
- const char *action,
- const unsigned int index)
-{
- char name[60];
- MemoryRegion *iomem, *iomem_p4, *iomem_a7;
-
- if (!address) {
- return 0;
- }
-
- iomem = &desc->iomem;
- iomem_p4 = desc->iomem_aliases + index;
- iomem_a7 = iomem_p4 + 1;
-
- snprintf(name, sizeof(name), "intc-%s-%s-%s", type, action, "p4");
- 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), "intc-%s-%s-%s", type, action, "a7");
- memory_region_init_alias(iomem_a7, NULL, name, iomem, A7ADDR(address), 4);
- memory_region_add_subregion(sysmem, A7ADDR(address), iomem_a7);
-
- /* used to increment aliases index */
- return 2;
-}
-
static void sh_intc_register_source(struct intc_desc *desc,
intc_enum source,
struct intc_group *groups,
@@ -399,6 +369,36 @@ void sh_intc_register_sources(struct intc_desc *desc,
}
}
+static unsigned int sh_intc_register(MemoryRegion *sysmem,
+ struct intc_desc *desc,
+ const unsigned long address,
+ const char *type,
+ const char *action,
+ const unsigned int index)
+{
+ char name[60];
+ MemoryRegion *iomem, *iomem_p4, *iomem_a7;
+
+ if (!address) {
+ return 0;
+ }
+
+ iomem = &desc->iomem;
+ iomem_p4 = desc->iomem_aliases + index;
+ iomem_a7 = iomem_p4 + 1;
+
+ snprintf(name, sizeof(name), "intc-%s-%s-%s", type, action, "p4");
+ 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), "intc-%s-%s-%s", type, action, "a7");
+ memory_region_init_alias(iomem_a7, NULL, name, iomem, A7ADDR(address), 4);
+ memory_region_add_subregion(sysmem, A7ADDR(address), iomem_a7);
+
+ /* used to increment aliases index */
+ return 2;
+}
+
int sh_intc_init(MemoryRegion *sysmem,
struct intc_desc *desc,
int nr_sources,
--
2.21.4
- [PATCH v5 11/25] hw/intc/sh_intc: Turn some defines into an enum, (continued)
- [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, 2021/10/29
- [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 <=
- [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