qemu-trivial
[Top][All Lists]
Advanced

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

Re: [Qemu-trivial] [PATCH 49/88] hw/misc: use g_new() family of function


From: Gabriel L. Somlo
Subject: Re: [Qemu-trivial] [PATCH 49/88] hw/misc: use g_new() family of functions
Date: Mon, 9 Oct 2017 10:21:10 -0400
User-agent: Mutt/1.9.1 (2017-09-22)

Reviewed-by: Gabriel Somlo <address@hidden>

On Fri, Oct 06, 2017 at 08:49:44PM -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: added hw/misc/pvpanic.c]
> ---
>  hw/misc/applesmc.c | 2 +-
>  hw/misc/pvpanic.c  | 2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/hw/misc/applesmc.c b/hw/misc/applesmc.c
> index 7be8b5f13c..12e32b107e 100644
> --- a/hw/misc/applesmc.c
> +++ b/hw/misc/applesmc.c
> @@ -252,7 +252,7 @@ static void applesmc_add_key(AppleSMCState *s, const char 
> *key,
>  {
>      struct AppleSMCData *def;
>  
> -    def = g_malloc0(sizeof(struct AppleSMCData));
> +    def = g_new0(struct AppleSMCData, 1);
>      def->key = key;
>      def->len = len;
>      def->data = data;
> diff --git a/hw/misc/pvpanic.c b/hw/misc/pvpanic.c
> index 2b1e9a6450..dc51e4386c 100644
> --- a/hw/misc/pvpanic.c
> +++ b/hw/misc/pvpanic.c
> @@ -95,7 +95,7 @@ static void pvpanic_isa_realizefn(DeviceState *dev, Error 
> **errp)
>          return;
>      }
>  
> -    pvpanic_port = g_malloc(sizeof(*pvpanic_port));
> +    pvpanic_port = g_new(uint16_t, 1);
>      *pvpanic_port = cpu_to_le16(s->ioport);
>      fw_cfg_add_file(fw_cfg, "etc/pvpanic-port", pvpanic_port,
>                      sizeof(*pvpanic_port));
> -- 
> 2.14.2
> 



reply via email to

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