From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43557) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e0cSE-00027G-D2 for qemu-devel@nongnu.org; Fri, 06 Oct 2017 19:54:55 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e0cSD-0007qq-Ff for qemu-devel@nongnu.org; Fri, 06 Oct 2017 19:54:54 -0400 Sender: =?UTF-8?Q?Philippe_Mathieu=2DDaud=C3=A9?= From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Date: Fri, 6 Oct 2017 20:50:08 -0300 Message-Id: <20171006235023.11952-74-f4bug@amsat.org> In-Reply-To: <20171006235023.11952-1-f4bug@amsat.org> References: <20171006235023.11952-1-f4bug@amsat.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Subject: [Qemu-devel] [PATCH 73/88] hw/block/xen_disk: avoid use of g_new0() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Markus Armbruster , Eric Blake , Jeff Cody , Kevin Wolf , Max Reitz , Jan Beulich Cc: qemu-devel@nongnu.org, =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , qemu trival , qemu-block@nongnu.org, Paul Durrant , Anthony Perard , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= From: Jan Beulich Prefer g_new() / g_new0() to be farther backwards compatible with older glib versions. As there's no point in zeroing the allocation here (the loop right afterwards fully initializes the memory), use the former. Signed-off-by: Jan Beulich Reviewed-by: Paul Durrant Acked-by: Anthony Perard Signed-off-by: Philippe Mathieu-Daudé [PMD: rebase & subject tweak] --- hw/block/xen_disk.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/block/xen_disk.c b/hw/block/xen_disk.c index 536e2ee735..6d2fd4d284 100644 --- a/hw/block/xen_disk.c +++ b/hw/block/xen_disk.c @@ -1232,7 +1232,7 @@ static int blk_connect(struct XenDevice *xendev) return -1; } - domids = g_new0(uint32_t, blkdev->nr_ring_ref); + domids = g_new(uint32_t, blkdev->nr_ring_ref); for (i = 0; i < blkdev->nr_ring_ref; i++) { domids[i] = blkdev->xendev.dom; } -- 2.14.2