From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54359) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e1Yvm-0007jQ-N4 for qemu-devel@nongnu.org; Mon, 09 Oct 2017 10:21:19 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e1Yvj-0004Aa-E5 for qemu-devel@nongnu.org; Mon, 09 Oct 2017 10:21:18 -0400 Date: Mon, 9 Oct 2017 10:21:10 -0400 From: "Gabriel L. Somlo" Message-ID: <20171009142109.GD8968@hedwig.ini.cmu.edu> References: <20171006235023.11952-1-f4bug@amsat.org> <20171006235023.11952-50-f4bug@amsat.org> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20171006235023.11952-50-f4bug@amsat.org> Subject: Re: [Qemu-devel] [PATCH 49/88] hw/misc: use g_new() family of functions List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Philippe =?iso-8859-1?Q?Mathieu-Daud=E9?= Cc: =?iso-8859-1?Q?Marc-Andr=E9?= Lureau , Markus Armbruster , Eric Blake , Gerd Hoffmann , "Denis V. Lunev" , Anton Nefedov , =?iso-8859-1?Q?Marc-Andr=E9?= Lureau , qemu-devel@nongnu.org, Kevin Wolf , qemu trival Reviewed-by: Gabriel Somlo On Fri, Oct 06, 2017 at 08:49:44PM -0300, Philippe Mathieu-Daudé wrote: > From: Marc-André Lureau > > Signed-off-by: Marc-André Lureau > Signed-off-by: Philippe Mathieu-Daudé > [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 >