qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH 59/88] ppce500: use g_new() family of functions


From: David Gibson
Subject: Re: [Qemu-devel] [PATCH 59/88] ppce500: use g_new() family of functions
Date: Sat, 7 Oct 2017 16:16:14 +1100
User-agent: Mutt/1.9.1 (2017-09-22)

On Fri, Oct 06, 2017 at 08:49:54PM -0300, Philippe Mathieu-Daudé wrote:
> From: Marc-André Lureau <address@hidden>
> 
> Signed-off-by: Marc-André Lureau <address@hidden>
> Signed-off-by: Philippe Mathieu-Daudé <address@hidden>
> [PMD: replaced g_new0() -> g_new() since no bzero() required]

Acked-by: David Gibson <address@hidden>

> ---
>  hw/ppc/e500.c | 7 +++----
>  1 file changed, 3 insertions(+), 4 deletions(-)
> 
> diff --git a/hw/ppc/e500.c b/hw/ppc/e500.c
> index db0e49ab8f..b396fd1a22 100644
> --- a/hw/ppc/e500.c
> +++ b/hw/ppc/e500.c
> @@ -737,8 +737,6 @@ static qemu_irq *ppce500_init_mpic(MachineState *machine, 
> PPCE500Params *params,
>      SysBusDevice *s;
>      int i;
>  
> -    mpic = g_new0(qemu_irq, 256);
> -
>      if (kvm_enabled()) {
>          Error *err = NULL;
>  
> @@ -756,6 +754,7 @@ static qemu_irq *ppce500_init_mpic(MachineState *machine, 
> PPCE500Params *params,
>          dev = ppce500_init_mpic_qemu(params, irqs);
>      }
>  
> +    mpic = g_new(qemu_irq, 256);
>      for (i = 0; i < 256; i++) {
>          mpic[i] = qdev_get_gpio_in(dev, i);
>      }
> @@ -808,7 +807,7 @@ void ppce500_init(MachineState *machine, PPCE500Params 
> *params)
>          machine->cpu_model = "e500v2_v30";
>      }
>  
> -    irqs = g_malloc0(smp_cpus * sizeof(qemu_irq *));
> +    irqs = g_new0(qemu_irq *, smp_cpus);
>      irqs[0] = g_malloc0(smp_cpus * sizeof(qemu_irq) * OPENPIC_OUTPUT_NB);
>      for (i = 0; i < smp_cpus; i++) {
>          PowerPCCPU *cpu;
> @@ -844,7 +843,7 @@ void ppce500_init(MachineState *machine, PPCE500Params 
> *params)
>          if (!i) {
>              /* Primary CPU */
>              struct boot_info *boot_info;
> -            boot_info = g_malloc0(sizeof(struct boot_info));
> +            boot_info = g_new0(struct boot_info, 1);
>              qemu_register_reset(ppce500_cpu_reset, cpu);
>              env->load_info = boot_info;
>          } else {

-- 
David Gibson                    | I'll have my music baroque, and my code
david AT gibson.dropbear.id.au  | minimalist, thank you.  NOT _the_ _other_
                                | _way_ _around_!
http://www.ozlabs.org/~dgibson

Attachment: signature.asc
Description: PGP signature


reply via email to

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