aboutsummaryrefslogtreecommitdiff
path: root/hw/intc/exynos4210_gic.c
diff options
context:
space:
mode:
Diffstat (limited to 'hw/intc/exynos4210_gic.c')
-rw-r--r--hw/intc/exynos4210_gic.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/hw/intc/exynos4210_gic.c b/hw/intc/exynos4210_gic.c
index 71a88c86bc..fcca85c6c6 100644
--- a/hw/intc/exynos4210_gic.c
+++ b/hw/intc/exynos4210_gic.c
@@ -56,10 +56,6 @@ static void exynos4210_gic_realize(DeviceState *dev, Error **errp)
Object *obj = OBJECT(dev);
Exynos4210GicState *s = EXYNOS4210_GIC(obj);
SysBusDevice *sbd = SYS_BUS_DEVICE(obj);
- const char cpu_prefix[] = "exynos4210-gic-alias_cpu";
- const char dist_prefix[] = "exynos4210-gic-alias_dist";
- char cpu_alias_name[sizeof(cpu_prefix) + 3];
- char dist_alias_name[sizeof(cpu_prefix) + 3];
SysBusDevice *gicbusdev;
uint32_t n = s->num_cpu;
uint32_t i;
@@ -89,8 +85,10 @@ static void exynos4210_gic_realize(DeviceState *dev, Error **errp)
*/
assert(n <= EXYNOS4210_GIC_NCPUS);
for (i = 0; i < n; i++) {
+ g_autofree char *cpu_alias_name = g_strdup_printf("exynos4210-gic-alias_cpu%u", i);
+ g_autofree char *dist_alias_name = g_strdup_printf("exynos4210-gic-alias_dist%u", i);
+
/* Map CPU interface per SMP Core */
- sprintf(cpu_alias_name, "%s%x", cpu_prefix, i);
memory_region_init_alias(&s->cpu_alias[i], obj,
cpu_alias_name,
sysbus_mmio_get_region(gicbusdev, 1),
@@ -100,7 +98,6 @@ static void exynos4210_gic_realize(DeviceState *dev, Error **errp)
EXYNOS4210_EXT_GIC_CPU_GET_OFFSET(i), &s->cpu_alias[i]);
/* Map Distributor per SMP Core */
- sprintf(dist_alias_name, "%s%x", dist_prefix, i);
memory_region_init_alias(&s->dist_alias[i], obj,
dist_alias_name,
sysbus_mmio_get_region(gicbusdev, 0),