On Sat, Feb 7, 2026 at 10:16 AM Manish <[email protected]> wrote: > > From cef7f1f3d7b47338b7359ad4b815e04bc965d427 Mon Sep 17 00:00:00 2001 > From: "Manish." <[email protected]> > Date: Sat, 7 Feb 2026 23:26:09 +0530 > Subject: [PATCH] hw/xtensa: convert calloc to g_new0 in mx_pic.c > > Convert the calloc allocation in xtensa_mx_pic_init() to use > g_new0() for consistency. > > Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1798 > > Signed-off-by: Manish. <[email protected]> > --- > hw/xtensa/mx_pic.c | 3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-)
The patch is damaged and would not apply, but the change looks good to me. Reviewed-by: Max Filippov <[email protected]> > diff --git a/hw/xtensa/mx_pic.c b/hw/xtensa/mx_pic.c > index 07c3731aef..ab308c9490 100644 > --- a/hw/xtensa/mx_pic.c > +++ b/hw/xtensa/mx_pic.c > @@ -316,8 +316,7 @@ static void xtensa_mx_pic_set_irq(void *opaque, > int irq, int active) > XtensaMxPic *xtensa_mx_pic_init(unsigned n_irq) > { > - XtensaMxPic *mx = calloc(1, sizeof(XtensaMxPic)); > - > + XtensaMxPic *mx = g_new0(XtensaMxPic, 1); > mx->n_irq = n_irq + 1; > mx->irq_inputs = qemu_allocate_irqs(xtensa_mx_pic_set_irq, mx, > mx->n_irq); > -- > 2.52.0 -- Thanks. -- Max
