qemu-arm
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 4/5] intc/exynos4210_gic: fix format-overflow warning


From: Peter Maydell
Subject: Re: [PATCH 4/5] intc/exynos4210_gic: fix format-overflow warning
Date: Tue, 29 Mar 2022 17:23:34 +0000

On Tue, 29 Mar 2022 at 18:08, Philippe Mathieu-Daudé
<philippe.mathieu.daude@gmail.com> wrote:
>
> On 28/3/22 11:15, Peter Maydell wrote:
> > On Mon, 28 Mar 2022 at 09:48, <marcandre.lureau@redhat.com> wrote:
> >>
> >> From: Marc-André Lureau <marcandre.lureau@redhat.com>
> >>
> >> Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.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 bc73d1f11524..5b6f4330a5f3 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%x", i);
> >> +        g_autofree char *dist_alias_name = 
> >> g_strdup_printf("exynos4210-gic-alias_dist%x", i);
>
> Dubious '%x' format... Maybe change to '%u'?

Makes no difference given that EXYNOS4210_NCPUS is 2, but I guess so.

-- PMM



reply via email to

[Prev in Thread] Current Thread [Next in Thread]