59 lines
2.7 KiB
Diff
59 lines
2.7 KiB
Diff
|
From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= <marcandre.lureau@redhat.com>
|
||
|
Date: Wed, 20 Apr 2022 17:25:58 +0400
|
||
|
Subject: intc/exynos4210_gic: replace snprintf() with g_strdup_printf()
|
||
|
MIME-Version: 1.0
|
||
|
Content-Type: text/plain; charset=UTF-8
|
||
|
Content-Transfer-Encoding: 8bit
|
||
|
|
||
|
Git-commit: a0e04317f3ef86d7b18ec6e6459d8aa66f787d12
|
||
|
|
||
|
While at it, replace '%x' with '%u' as suggested by Philippe Mathieu-Daudé.
|
||
|
|
||
|
Also fixes a GCC 12.0.1 -Wformat-overflow false-positive.
|
||
|
|
||
|
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
|
||
|
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
|
||
|
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
|
||
|
Message-Id: <20220420132624.2439741-16-marcandre.lureau@redhat.com>
|
||
|
[DF: Replaces downstream patch: hw-intc-exynos4210_gic-provide-more-room.patch]
|
||
|
Signed-off-by: Dario Faggioli <dfaggioli@suse.com>
|
||
|
---
|
||
|
hw/intc/exynos4210_gic.c | 9 +++------
|
||
|
1 file changed, 3 insertions(+), 6 deletions(-)
|
||
|
|
||
|
diff --git a/hw/intc/exynos4210_gic.c b/hw/intc/exynos4210_gic.c
|
||
|
index bc73d1f1152438de04c252a2ec84..f8dd719caa1e598a32ab6cc6ee7a 100644
|
||
|
--- a/hw/intc/exynos4210_gic.c
|
||
|
+++ b/hw/intc/exynos4210_gic.c
|
||
|
@@ -289,10 +289,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;
|
||
|
@@ -322,8 +318,10 @@ static void exynos4210_gic_realize(DeviceState *dev, Error **errp)
|
||
|
*/
|
||
|
assert(n <= EXYNOS4210_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),
|
||
|
@@ -333,7 +331,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),
|