From patchwork Fri Oct 6 23:48:56 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 822769 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="i1TsrS65"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3y85yK5xlVz9t3R for ; Sat, 7 Oct 2017 10:51:33 +1100 (AEDT) Received: from localhost ([::1]:47519 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e0cOv-0006jE-St for incoming@patchwork.ozlabs.org; Fri, 06 Oct 2017 19:51:29 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40357) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e0cO6-0006is-Jq for qemu-devel@nongnu.org; Fri, 06 Oct 2017 19:50:39 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e0cO5-0004e8-1k for qemu-devel@nongnu.org; Fri, 06 Oct 2017 19:50:38 -0400 Received: from mail-qk0-x244.google.com ([2607:f8b0:400d:c09::244]:35166) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1e0cO4-0004e2-TY; Fri, 06 Oct 2017 19:50:36 -0400 Received: by mail-qk0-x244.google.com with SMTP id w63so11295169qkd.2; Fri, 06 Oct 2017 16:50:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=i/vhrUBaARR/Mhy6khnw9WsMSCJbNAoI8AgQVF/EVpk=; b=i1TsrS65/hsywiFJv8cmSrW6St/IdNrApRlX+e24OWbAeoARGp0jpXw8p1MqRTrOA1 3Bksb+dm+Bk2ne6CKXUk5B16jUVFfmeBhokTPpzmOMtk45ofXdRDZhF7E3cGt/x1kFqg NENUgLAb0bBnkNhwfuiblc4HD37Q4dpiDrII5X7KbAxLYdRxzg4FeMJ+MmX/i2zZZorl EOLmx9pasMV43ZV0sy9Vsul//P+8Awi9q1qxoKvh9MlwaXafyMOiF+qG+8bfiG/B4Sbs zOogz8H3jxPWLe2ToeQooLn3FpAWraLhItYm7PI+BLBHYNLo6BSR+A8FGNS8Xh7IkG5Z NjbQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=i/vhrUBaARR/Mhy6khnw9WsMSCJbNAoI8AgQVF/EVpk=; b=fqExgyuaUpmr+Ui2D9i9WTmAvULvho4OwOoU3V9CJlWHQJ93yYiDQefOOTT1EXhLIy LxJcaUi1tOFX0j9NmqifOpr3/mJSJv3oQVTFwNEExLcLwnLGqNwkm6tQO6etl2vFRlep MPKufCOKxrYC0/5WCVhHWvVo+L5kxRKvrthmwI7h/lv2jY3mWh7nUUw5HjPTMZj70/C6 wZvD2bThzLHVJ/H+lKNzFxuiEgHc+c2q8pidbhQqDkyXHugwM/EG3r77DoXsXy2TE1l/ AEX2x9YSOI3QcNpOS4enA0Dz5SdxYnI5dLgCslad3EPONdkOnlaIV13MGESAnMvp0Hw8 MwIw== X-Gm-Message-State: AMCzsaW2MYP1BULindZar0DC8gSIaSqM8eHXXs/eCRbUdNEh+LQ1M2KY VbaEvdCmPtbF7WJVexUCknQ= X-Google-Smtp-Source: AOwi7QB/ZPKbCsUTS1NtP15Gj5C5IP6H6QG5buOlbgB/+EGSRHDZfytfgwJ8o1r7UNWkg009GhcMrg== X-Received: by 10.55.26.138 with SMTP id l10mr727791qkh.71.1507333836317; Fri, 06 Oct 2017 16:50:36 -0700 (PDT) Received: from yoga.lan ([181.93.89.178]) by smtp.gmail.com with ESMTPSA id g1sm1705226qta.95.2017.10.06.16.50.32 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 06 Oct 2017 16:50:35 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Markus Armbruster , Eric Blake , Peter Maydell , Paolo Bonzini , Laurent Vivier , Eduardo Habkost Date: Fri, 6 Oct 2017 20:48:56 -0300 Message-Id: <20171006235023.11952-2-f4bug@amsat.org> X-Mailer: git-send-email 2.14.2 In-Reply-To: <20171006235023.11952-1-f4bug@amsat.org> References: <20171006235023.11952-1-f4bug@amsat.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c09::244 Subject: [Qemu-devel] [PATCH 01/88] cocci: script to use g_new() & friends X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , qemu trival , =?utf-8?q?Philippe_Mathieu-Dau?= =?utf-8?b?ZMOp?= , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Imported from Markus Armbruster commit b45c03f Signed-off-by: Philippe Mathieu-Daudé --- Signed-off-by: Markus Armbruster ? scripts/coccinelle/g_new.cocci | 101 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 101 insertions(+) create mode 100644 scripts/coccinelle/g_new.cocci diff --git a/scripts/coccinelle/g_new.cocci b/scripts/coccinelle/g_new.cocci new file mode 100644 index 0000000000..1e57685a6b --- /dev/null +++ b/scripts/coccinelle/g_new.cocci @@ -0,0 +1,101 @@ +/* transform g_new*() alloc with size arguments of the form sizeof(T) [* N] + * + * g_new(T, n) is neater than g_malloc(sizeof(T) * n). It's also safer, + * for two reasons. One, it catches multiplication overflowing size_t. + * two, it returns T * rather than void *, which lets the compiler catch + * more type errors. + * + * Copyright: (C) 2017 Markus Armbruster . GPLv2+. + * (Imported from b45c03f585ea9bb1af76c73e82195418c294919d) + * + * See http://lists.nongnu.org/archive/html/qemu-devel/2017-09/msg00908.html: + * + * g_new() advantages (from glib doc): + * - the returned pointer is cast to a pointer to the given type. + * - care is taken to avoid overflow when calculating the size of the + * allocated block. + * + * p = g_malloc(sizeof(*p)) is idiomatic, and not obviously inferior to + * p = g_new(T, 1), where T is the type of *p. + * But once you add multiplication, g_new() adds something useful: overflow + * protection. Conversion to g_new() might make sense then. + */ + +@@ +type T; +@@ +-g_malloc(sizeof(T)) ++g_new(T, 1) +@@ +type T; +@@ +-g_try_malloc(sizeof(T)) ++g_try_new(T, 1) +@@ +type T; +@@ +-g_malloc0(sizeof(T)) ++g_new0(T, 1) +@@ +type T; +@@ +-g_try_malloc0(sizeof(T)) ++g_try_new0(T, 1) + +@@ +type T; +expression n; +@@ +-g_malloc(sizeof(T) * (n)) ++g_new(T, n) +@@ +type T; +expression n; +@@ +-g_try_malloc(sizeof(T) * (n)) ++g_try_new(T, n) +@@ +type T; +expression n; +@@ +-g_malloc0(sizeof(T) * (n)) ++g_new0(T, n) +@@ +type T; +expression n; +@@ +-g_try_malloc0(sizeof(T) * (n)) ++g_try_new0(T, n) + +@@ +type T; +expression p, n; +@@ +-g_realloc(p, sizeof(T) * (n)) ++g_renew(T, p, n) +@@ +type T; +expression p, n; +@@ +-g_try_realloc(p, sizeof(T) * (n)) ++g_try_renew(T, p, n) + +// drop superfluous cast +@@ +type T; +expression n; +@@ +-(T *)g_new(T, n) ++g_new(T, n) +@@ +type T; +expression n; +@@ +-(T *)g_new0(T, n) ++g_new0(T, n) +@@ +type T; +expression p, n; +@@ +-(T *)g_renew(T, p, n) ++g_renew(T, p, n) From patchwork Fri Oct 6 23:48:57 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 822770 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="IWiDkeM4"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3y85yK5vsVz9t3C for ; Sat, 7 Oct 2017 10:51:37 +1100 (AEDT) Received: from localhost ([::1]:47520 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e0cP1-0006kD-QM for incoming@patchwork.ozlabs.org; Fri, 06 Oct 2017 19:51:35 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40387) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e0cO9-0006j1-Id for qemu-devel@nongnu.org; Fri, 06 Oct 2017 19:50:42 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e0cO8-0004fg-Pa for qemu-devel@nongnu.org; Fri, 06 Oct 2017 19:50:41 -0400 Received: from mail-qt0-x242.google.com ([2607:f8b0:400d:c0d::242]:50902) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1e0cO8-0004fP-L0; Fri, 06 Oct 2017 19:50:40 -0400 Received: by mail-qt0-x242.google.com with SMTP id f15so34346253qtf.7; Fri, 06 Oct 2017 16:50:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=JsXbrPXUr8vAPutje9KpsJZsy/a75rUDkdTpn+HwdwQ=; b=IWiDkeM4R7mhR4QjipwFVrz9v8avasSYrIBniaiGpDcYPoQ6XmAEBmdJ+QqSn2G59g 5uPo4wIp435VwjDOAtpA+gcG/wDFktZSqiQY5u6KKhg/yK9eqBZCCR9Pl/3OuvoDeh7f kezsXN51/6CzVRgnegsDIlgINmzYPcL4G+zwY9uhOMtxNZzDlJa39tpx6gkrDIRlPx2m mDFKeCj77XM3ikJy0khRgrx1B4k6BuDpn/FxdySCgxToH9a301p3ghAMHxk1iTzUaoUE HRdM9JA2ghBKirti3KYxsRHXjzvCMSu/2x5ac0OxgrKXiILJpJmNN1tXgd74v5hyo0h9 RzlQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=JsXbrPXUr8vAPutje9KpsJZsy/a75rUDkdTpn+HwdwQ=; b=qsdQwBdWVVSaUhxYfmGOsKdBM6eUPm+xbDTnobBmcjPLj1zYLPfcjq5pbdqsom2765 RX1GMLUn3xBVr/VUiSYZP6VrSi5BRLVS6VnSyR6vBCEivwwQbl/Vmx4zNVk0rCAM0/SM lMJY0oE12FH3y4pvtXQjEO7SXS1YOdZxAiFHoZYgV0yUR6RuBruveOX/79xDf/c+yhgn fFcnkU/LhBcnpOEkR2BQbX/0vQlg+JTLA3sGyToEOhqUsZ9I/y/FJr9vNnlflbU40SbM +7l/CWMVOQmVtNUzHVMM6LDwlt0Z32I8kyZS/acA46M19XKYJ+HhcXrsT+wCtE9tARPO 51GQ== X-Gm-Message-State: AMCzsaVKZUnrYHrgvVD2kTe7dItn4WcCgu/GOmAoRZXNZWUzzXDaI3YU twHleloKlmmHNKiirDIc1pE= X-Google-Smtp-Source: AOwi7QAmTOvSlZl9txnTqfGUUr6xs3FbVgaN8NGZ6UE8lEmWbwQ1fGpSaLIcwaMaLiFs8hGlr/20BQ== X-Received: by 10.200.27.98 with SMTP id p31mr5461771qtk.149.1507333840060; Fri, 06 Oct 2017 16:50:40 -0700 (PDT) Received: from yoga.lan ([181.93.89.178]) by smtp.gmail.com with ESMTPSA id g1sm1705226qta.95.2017.10.06.16.50.36 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 06 Oct 2017 16:50:39 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Markus Armbruster , Eric Blake , Peter Maydell , Paolo Bonzini , Laurent Vivier , Eduardo Habkost Date: Fri, 6 Oct 2017 20:48:57 -0300 Message-Id: <20171006235023.11952-3-f4bug@amsat.org> X-Mailer: git-send-email 2.14.2 In-Reply-To: <20171006235023.11952-1-f4bug@amsat.org> References: <20171006235023.11952-1-f4bug@amsat.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c0d::242 Subject: [Qemu-devel] [PATCH 02/88] cocci: add more g_new() transformations X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , qemu trival , =?utf-8?q?Philippe_Mathieu-Dau?= =?utf-8?b?ZMOp?= , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Philippe Mathieu-Daudé --- scripts/coccinelle/g_new.cocci | 73 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 73 insertions(+) diff --git a/scripts/coccinelle/g_new.cocci b/scripts/coccinelle/g_new.cocci index 1e57685a6b..c767325a21 100644 --- a/scripts/coccinelle/g_new.cocci +++ b/scripts/coccinelle/g_new.cocci @@ -80,6 +80,49 @@ expression p, n; -g_try_realloc(p, sizeof(T) * (n)) +g_try_renew(T, p, n) +@@ +type T; +expression n; +@@ +( +-g_malloc_n(n, sizeof(T)) ++g_new(T, n) +| +-g_malloc0_n(n, sizeof(T)) ++g_new0(T, n) +| +-g_try_malloc_n(n, sizeof(T)) ++g_try_new(T, n) +| +-g_try_malloc0_n(n, sizeof(T)) ++g_try_new0(T, n) +) + +@@ +type T; +identifier m; +@@ +T *m; +... +( +-m = g_malloc(sizeof(*m)); ++m = g_new(T, 1); +| +-m = g_malloc0(sizeof(*m)); ++m = g_new0(T, 1); +| +-m = g_try_malloc(sizeof(*m)); ++m = g_try_new(T, 1); +| +-m = g_try_malloc0(sizeof(*m)); ++m = g_try_new0(T, 1); +) + +//////////////////////////////////////// +// +// last transformations: cleanups +// + // drop superfluous cast @@ type T; @@ -99,3 +142,33 @@ expression p, n; @@ -(T *)g_renew(T, p, n) +g_renew(T, p, n) +@@ +type T; +expression n; +@@ +( +-(T *)g_try_new(T, n) ++g_try_new(T, n) +| +-(T *)g_try_new0(T, n) ++g_try_new0(T, n) +) + +// drop superfluous parenthesis +@@ +type T; +expression c; +@@ +( +-g_new(T, (c)) ++g_new(T, c) +| +-g_try_new(T, (c)) ++g_try_new(T, c) +| +-g_new0(T, (c)) ++g_new0(T, c) +| +-g_try_new0(T, (c)) ++g_try_new0(T, c) +) From patchwork Fri Oct 6 23:48:58 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 822772 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="De6T2Au4"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3y85yW5JVSz9t3C for ; Sat, 7 Oct 2017 10:51:47 +1100 (AEDT) Received: from localhost ([::1]:47523 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e0cPB-0006sV-Po for incoming@patchwork.ozlabs.org; Fri, 06 Oct 2017 19:51:45 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40460) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e0cOI-0006pO-3j for qemu-devel@nongnu.org; Fri, 06 Oct 2017 19:50:50 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e0cOC-0004hI-MU for qemu-devel@nongnu.org; Fri, 06 Oct 2017 19:50:50 -0400 Received: from mail-qt0-x244.google.com ([2607:f8b0:400d:c0d::244]:52752) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1e0cOC-0004hA-Eg; Fri, 06 Oct 2017 19:50:44 -0400 Received: by mail-qt0-x244.google.com with SMTP id o52so34320322qtc.9; Fri, 06 Oct 2017 16:50:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=o1k2lCuaN0rpkGsOAU0W+x1++CfwLSSCaXE7Vnh7mlI=; b=De6T2Au4tvXQqEmdlrvEw2tSa4vb7O7gnYK5zYhZBzwOrIjk+yYNxUDWSwCg1Kot4S ieJiUjhjRe3pVihkgb/MJLqaUAnm8fVDRa+LRJEpBMccONpzwKyZyCXz4v+zRPhUu4ld Zx0c31BMo83z5MdG/9Urjn9jzVEjf76cInZuuj9zvaAK+aLa/rRBlVoFmkurVweoaZC+ oSfWHaF0HsNwMp2xubcwJbJocGuQ3tFVx/NUQxL1/YHFOyqP4+8GZ4o+pH3lvLuolvFM Y0mNYe/bhAPdf5aR8ktFRIY3YaV8T2Yf5ObRWe1WSmKth6OwzzbmvYfylxMlPnwM1AjD 1qfw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=o1k2lCuaN0rpkGsOAU0W+x1++CfwLSSCaXE7Vnh7mlI=; b=hyAsPp4TFizSRYJe5fJ+CIoY4AUtYBkj74ovt7N165bEGF3V8tyARYlRBi0r0qnFCi f14Sl3xG8aK91j3PmjXKeODnu0QtFhkUBzRa/OcyDKp4Ue6w90eMCj78KErWvLoSUiBs Gtu1vGgxJez4TcwWnqR4sA2oFssr5IzNJwEFIp9TKP3ZIq5vArxnR+FrbsFayq7vNFTz TBx3aG4ZukyRBCFpNzOVXbPXpcFpp6RmM1Mvw794u/VQtrkVFDL4bgAU+hIKDBiBO4rF /FlStE1XEcs42X0om2E+o10qwT0wnPSyyk76FwaMdhGETM+7dHDMMYw2+8CrAs417eCY ZV2w== X-Gm-Message-State: AMCzsaVYRrM3szdnQMUPgD7TeCN+s2xhmUJeOGE5uplgB1l58GOTnA24 yHJjZfReZzbx3h8dGaIWhDU= X-Google-Smtp-Source: AOwi7QBBmqpiWrCTKNUJq2IU0alZowlZkmwPPje9dDmHRfyvK6lka2QHqLU7YHQR9B+F5DA8rbQTvg== X-Received: by 10.200.8.109 with SMTP id x42mr5772420qth.54.1507333843863; Fri, 06 Oct 2017 16:50:43 -0700 (PDT) Received: from yoga.lan ([181.93.89.178]) by smtp.gmail.com with ESMTPSA id g1sm1705226qta.95.2017.10.06.16.50.40 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 06 Oct 2017 16:50:43 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Markus Armbruster , Eric Blake , Peter Maydell , Paolo Bonzini , Laurent Vivier , Eduardo Habkost Date: Fri, 6 Oct 2017 20:48:58 -0300 Message-Id: <20171006235023.11952-4-f4bug@amsat.org> X-Mailer: git-send-email 2.14.2 In-Reply-To: <20171006235023.11952-1-f4bug@amsat.org> References: <20171006235023.11952-1-f4bug@amsat.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c0d::244 Subject: [Qemu-devel] [PATCH 03/88] cocci: extract typeof() from g_new() X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , qemu trival , =?utf-8?q?Philippe_Mathieu-Dau?= =?utf-8?b?ZMOp?= , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Philippe Mathieu-Daudé --- scripts/coccinelle/g_new.cocci | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/scripts/coccinelle/g_new.cocci b/scripts/coccinelle/g_new.cocci index c767325a21..368f0c5651 100644 --- a/scripts/coccinelle/g_new.cocci +++ b/scripts/coccinelle/g_new.cocci @@ -118,6 +118,15 @@ T *m; +m = g_try_new0(T, 1); ) +@@ +type T; +identifier m; +@@ +T **m; +... +- *m = g_malloc0(sizeof(**m)); ++ *m = g_new0(T *, 1); + //////////////////////////////////////// // // last transformations: cleanups From patchwork Fri Oct 6 23:48:59 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 822773 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="STinJnO2"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3y861n02HCz9s8J for ; Sat, 7 Oct 2017 10:54:37 +1100 (AEDT) Received: from localhost ([::1]:47528 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e0cRv-00010D-3I for incoming@patchwork.ozlabs.org; Fri, 06 Oct 2017 19:54:35 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40458) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e0cOI-0006pJ-2w for qemu-devel@nongnu.org; Fri, 06 Oct 2017 19:50:53 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e0cOG-0004im-6E for qemu-devel@nongnu.org; Fri, 06 Oct 2017 19:50:50 -0400 Received: from mail-qt0-x242.google.com ([2607:f8b0:400d:c0d::242]:52753) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1e0cOG-0004ic-1g; Fri, 06 Oct 2017 19:50:48 -0400 Received: by mail-qt0-x242.google.com with SMTP id o52so34320457qtc.9; Fri, 06 Oct 2017 16:50:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=vcj6Jlodf4B7QdgUY0fLzYwgMTJp2L4HdhMmrytvkpE=; b=STinJnO2+jOW2QKjv/0vG7eSTK2SMQqMiQUzsCdSZzytE+ZY+4xJ8B/6j9JgO96Nvq Ll4NLtL03bKWksQ2Nv4mjLK56R4Rnnzs3pLDMHzRDEp7QEwzgADiHkiP8Xcqv0u+aQ6D /QwCcm/b/fcOxkzoS8End+9oKV9zSmkr0EuW1HgcEdKB6kGs1ulnbUmnEHJyfQhONE/j kvyoOQ54oiplA3mUluMXwMeRBpDjUoaJee2YUVkK0rUhhgzhmbswc/GL9QTWgw7dGjTA Ig36qNIe47hJLOVu/qhNvEMqaVr0y5P5GcEZX44HITfo46ZLPQdRzXrzXX9bqFtFmdhC WG9w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=vcj6Jlodf4B7QdgUY0fLzYwgMTJp2L4HdhMmrytvkpE=; b=U3JSVcWL533TgQe4esX/GVo630CE4OfwpS968OqCJWVOFPUDp3tco9+O81+6FKbIcJ 1Pc7gf/gF/ZmXzcVmfJm4Wg8aI25Y/zbNcLbtad5SE5FlEmhkvtMQfCSiMmloDLc8q7a vd5U+3GJho4GqwD1GboD04mZhs7WKqtISSjgwBQGNeFvCEFbP6qVUiXcBomLICD6A4CA mtxSJI16aPreIWAaaJaUEo3jf81GOzsKgdX7BfBEEF/ohHhVCcAEyJQpSG3xHIk8l42I KpVqQWugjlzn2aydkSLP3P3WkNzCrqnff7Q0DFI+KrjA8iXEh4aNoW/gBKotpzASOdjD khAw== X-Gm-Message-State: AMCzsaW7LkqobpnZ8fjT4o3g+uxbC8pfGFIKvyphRuq0VdiIjOHoGEsJ KOqz47PG29X/H+GHHJTY9ww= X-Google-Smtp-Source: AOwi7QC7UwcOFtn2j0dGhcTH7PZlQXXo81OExZG5Lo4Z/qrDaP4ekMMCr87isSmkpdRWRry6EfDCsA== X-Received: by 10.200.25.137 with SMTP id u9mr5693239qtj.81.1507333847539; Fri, 06 Oct 2017 16:50:47 -0700 (PDT) Received: from yoga.lan ([181.93.89.178]) by smtp.gmail.com with ESMTPSA id g1sm1705226qta.95.2017.10.06.16.50.44 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 06 Oct 2017 16:50:46 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Markus Armbruster , Eric Blake , Peter Maydell , Paolo Bonzini , Laurent Vivier , Eduardo Habkost Date: Fri, 6 Oct 2017 20:48:59 -0300 Message-Id: <20171006235023.11952-5-f4bug@amsat.org> X-Mailer: git-send-email 2.14.2 In-Reply-To: <20171006235023.11952-1-f4bug@amsat.org> References: <20171006235023.11952-1-f4bug@amsat.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c0d::242 Subject: [Qemu-devel] [PATCH 04/88] cocci: avoid use of g_new0() X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , qemu trival , =?utf-8?q?Philippe_Mathieu-Dau?= =?utf-8?b?ZMOp?= , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Philippe Mathieu-Daudé --- scripts/coccinelle/g_new.cocci | 46 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) diff --git a/scripts/coccinelle/g_new.cocci b/scripts/coccinelle/g_new.cocci index 368f0c5651..9643ce3f23 100644 --- a/scripts/coccinelle/g_new.cocci +++ b/scripts/coccinelle/g_new.cocci @@ -127,6 +127,52 @@ T **m; - *m = g_malloc0(sizeof(**m)); + *m = g_new0(T *, 1); +//////////////////////////////////////// +// +// no point in zeroing the allocation +// + +// the loop right afterwards fully initializes the memory +@@ +type T; +identifier a, i; +expression c, e; +@@ +( +-a = g_new0(T, c); + ... when != a, c ++a = g_new(T, c); + for (i = 0; i < c; i++) { + a[i] = e; + } +| +-a = g_try_new0(T, c); + ... when != a, c ++a = g_try_new(T, c); + for (i = 0; i < c; i++) { + a[i] = e; + } +) + +// compound literals +@@ +type T; +identifier p; +expression s, e; +@@ +( +- p = g_malloc0(s); ++ p = g_malloc(s); +| +- p = g_try_malloc0(s); ++ p = g_try_malloc(s); +| +- p = g_new0(T, 1); ++ p = g_new(T, 1); +) + ... when != p + *p = e; + //////////////////////////////////////// // // last transformations: cleanups From patchwork Fri Oct 6 23:49:00 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 822774 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="Qxy1IIHC"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3y86253WD0z9s8J for ; Sat, 7 Oct 2017 10:54:53 +1100 (AEDT) Received: from localhost ([::1]:47531 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e0cSB-0001HT-GQ for incoming@patchwork.ozlabs.org; Fri, 06 Oct 2017 19:54:51 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40488) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e0cOL-0006qD-3c for qemu-devel@nongnu.org; Fri, 06 Oct 2017 19:50:53 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e0cOK-0004l4-Ar for qemu-devel@nongnu.org; Fri, 06 Oct 2017 19:50:53 -0400 Received: from mail-qk0-x243.google.com ([2607:f8b0:400d:c09::243]:36724) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1e0cOK-0004kv-6u; Fri, 06 Oct 2017 19:50:52 -0400 Received: by mail-qk0-x243.google.com with SMTP id z14so12858900qkg.3; Fri, 06 Oct 2017 16:50:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=pBhRk7wefM0Jo6cp0PZP7qgT8QF9OW/vpm+XVmBMWmY=; b=Qxy1IIHCFySqduRHOOVfqOH7/e7fcoOkYIBf+hDgKGH6NouDJn5omHeJWfxzDQ3o76 +zCJYI2iL6KPqcSF8LjtTnuOhAxnjM50RP5pHZwphAD1nPN0OpIHipxnbBYq7ix0sSwe gdNwU04FMz9iazTv3+CFl1XS06cKW4T5vL3jFHYmaUqeZ8rS9aCZj3IV2uauVbiGq0AF LSTDMIFrZX2bgDCKKaAYVB0I/5Y/UHhk9S40txZ6u/3ZNPrSC5b/E1T8KDZC5S5V1GoJ inJM8RVa+nzcDtjFmJmtFhrFtTKaUdhYfS2Y9WDtgjAQovdc/8mCfbkLNre+G0oM2LbL lGNg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=pBhRk7wefM0Jo6cp0PZP7qgT8QF9OW/vpm+XVmBMWmY=; b=QLswaA1dlWBU+Ko14vPN0IDMxL0rCbPoYq0BBQVTCaDlqx6bDlV8aV2yS7gw0e7kYZ VoMAogJH4eqjLxutmWUI5UVrWjzDhSslJtPVqfz8Y/1SptFRN+9UgOuhYv6VHBueKr4B xUUVas/YLg32LRws5463U4M9NIEka+yYaY75ZSdVPP4Mvpn9BtsbsckTkz/9gdneqg2/ mRW6uaJqfl6qTSfYfkbPpFTlWIhqq79jvbOtv1UNYDY15MnENOBh9/l5mhBoKjIGnYk0 OEVelJMTqHboFZC423fJpORJ7kbfo8NGrFrDTREKs01MH7WzkDySIe+BwP8Is7r/iQM8 Ge1A== X-Gm-Message-State: AMCzsaU3XIywPtwrzNlx/CTbG5iLa78bt9QiM0LbW+tfpCuZCwKSYmmi i2TzzGSaXkzbjzBOPCHBT0M= X-Google-Smtp-Source: AOwi7QCr0uacMItXF8w/roZRlW9A34XHKk3ZfyUrCwYMZzinZCAkp/IyoalbAmjLd1uiNRuwbKwWdA== X-Received: by 10.55.162.7 with SMTP id l7mr759629qke.74.1507333851533; Fri, 06 Oct 2017 16:50:51 -0700 (PDT) Received: from yoga.lan ([181.93.89.178]) by smtp.gmail.com with ESMTPSA id g1sm1705226qta.95.2017.10.06.16.50.47 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 06 Oct 2017 16:50:51 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Markus Armbruster , Eric Blake , Peter Maydell , Paolo Bonzini , Laurent Vivier , Eduardo Habkost Date: Fri, 6 Oct 2017 20:49:00 -0300 Message-Id: <20171006235023.11952-6-f4bug@amsat.org> X-Mailer: git-send-email 2.14.2 In-Reply-To: <20171006235023.11952-1-f4bug@amsat.org> References: <20171006235023.11952-1-f4bug@amsat.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c09::243 Subject: [Qemu-devel] [PATCH 05/88] cocci: use g_strfreev() X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , qemu trival , =?utf-8?q?Philippe_Mathieu-Dau?= =?utf-8?b?ZMOp?= , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Philippe Mathieu-Daudé --- scripts/coccinelle/g_new.cocci | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/scripts/coccinelle/g_new.cocci b/scripts/coccinelle/g_new.cocci index 9643ce3f23..42ab166d04 100644 --- a/scripts/coccinelle/g_new.cocci +++ b/scripts/coccinelle/g_new.cocci @@ -173,6 +173,17 @@ expression s, e; ... when != p *p = e; +// g_strfreev() +@@ +identifier p, a; +@@ +- for (p = a; *p; p++) { +- g_free(*p); +- } + ... when != a +- g_free(a); ++ g_strfreev(a); + //////////////////////////////////////// // // last transformations: cleanups From patchwork Fri Oct 6 23:49:01 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 822777 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="PjYM1ZxO"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3y865K4Sykz9s8J for ; Sat, 7 Oct 2017 10:57:41 +1100 (AEDT) Received: from localhost ([::1]:47550 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e0cUt-0003ur-MM for incoming@patchwork.ozlabs.org; Fri, 06 Oct 2017 19:57:39 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40556) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e0cOR-0006wS-2Y for qemu-devel@nongnu.org; Fri, 06 Oct 2017 19:51:00 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e0cOO-0004nI-0n for qemu-devel@nongnu.org; Fri, 06 Oct 2017 19:50:59 -0400 Received: from mail-qk0-x241.google.com ([2607:f8b0:400d:c09::241]:36726) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1e0cON-0004n1-TX; Fri, 06 Oct 2017 19:50:55 -0400 Received: by mail-qk0-x241.google.com with SMTP id z14so12858946qkg.3; Fri, 06 Oct 2017 16:50:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Lpf/nxAWo+r73VINyBQS1FQePxjTqVmUzHvLbqsm23w=; b=PjYM1ZxOOyDOnn00a2sE5fGX/oCAFQXGDcGTw6jG0+7GQ+DMajSlTcIDyQZn4pvHfA Zd/WGhHJl3akqpVBmsx5hGknWIEJ8iKGGwK8UXKaVxPim6tfiz04dNPS3XGjx2qbE5pL 7E2vCs6hGofJYjs/zLcVpgD5cVGRXm3Jp/PuC9P/fuycOJASGThkv1eeNi30pC5uxVy4 ut0FQQlgb45C0Le/FfFgivEqKncS6rKuFrFWp3joljzdJnPEKhG3mQMngYFYk1F21qJ9 u9LNrl5mmQd1oQXT0UsNerSES3p1spTNqtfuoeehexQGzDf/5f8ZhhIsV6rxyCqGlWDz dUCw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=Lpf/nxAWo+r73VINyBQS1FQePxjTqVmUzHvLbqsm23w=; b=khufsrTCwlhoSlwi2lT9eCMqxnBqSkt8iG62j9H3FzmYfZkfCLERVVsrZZgbFNS0pm YWR8B6oaphrvpxIiAqpiqvhupOva+C2d69js/ZQHPGRbfNiZtRfYUjQLmaJoO2KO76ZJ Jgc1M6sgC4ygdvQ/y3qeDdsas/cmGT16t8BZhpwjbiI4SWLvsz52sNY/PxwCfnkWts9o CX5gGe8EgEBP4Sfn1+TsThkT3Lo8b+VAazWXrnEhvG3xJ8RGyUrGH4xqPpZfHN7c17Xe sKzt5ZFvyW70iglynG6rZj6vspJY4lKdygvSCv1egoyasZ5YyOMhQ5ZqzaFsObpZ6Arm pbGA== X-Gm-Message-State: AMCzsaUH1y/OZLl70KYHj7o40gVTfKcLa75dJ0YVJkRaVjXR82fVIW/v UYUFITvTfLcR8XsUVDWkANo= X-Google-Smtp-Source: AOwi7QCEQoHy5fYKpUpThsxUMpnJfNx1eTkEE9tIKgOcngv6zSszD9r4R9wDZi3nBujJWcJucYQn0Q== X-Received: by 10.55.6.149 with SMTP id 143mr666076qkg.231.1507333855326; Fri, 06 Oct 2017 16:50:55 -0700 (PDT) Received: from yoga.lan ([181.93.89.178]) by smtp.gmail.com with ESMTPSA id g1sm1705226qta.95.2017.10.06.16.50.51 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 06 Oct 2017 16:50:54 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Markus Armbruster , Eric Blake , Shannon Zhao , "Michael S. Tsirkin" , Igor Mammedov , Peter Maydell Date: Fri, 6 Oct 2017 20:49:01 -0300 Message-Id: <20171006235023.11952-7-f4bug@amsat.org> X-Mailer: git-send-email 2.14.2 In-Reply-To: <20171006235023.11952-1-f4bug@amsat.org> References: <20171006235023.11952-1-f4bug@amsat.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c09::241 Subject: [Qemu-devel] [PATCH 06/88] ARM: use g_new() family of functions X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , qemu trival , qemu-devel@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , qemu-arm@nongnu.org, =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Marc-André Lureau Signed-off-by: Marc-André Lureau Signed-off-by: Philippe Mathieu-Daudé [PMD: added hw/arm/virt-acpi-build.c and target/arm/helper.c] --- hw/arm/virt-acpi-build.c | 2 +- hw/timer/arm_timer.c | 2 +- target/arm/helper.c | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/hw/arm/virt-acpi-build.c b/hw/arm/virt-acpi-build.c index 3d78ff68e6..812c3c3f5b 100644 --- a/hw/arm/virt-acpi-build.c +++ b/hw/arm/virt-acpi-build.c @@ -869,7 +869,7 @@ void virt_acpi_setup(VirtMachineState *vms) return; } - build_state = g_malloc0(sizeof *build_state); + build_state = g_new0(AcpiBuildState, 1); acpi_build_tables_init(&tables); virt_acpi_build(vms, &tables); diff --git a/hw/timer/arm_timer.c b/hw/timer/arm_timer.c index 98fddd7ac1..75affcb8a6 100644 --- a/hw/timer/arm_timer.c +++ b/hw/timer/arm_timer.c @@ -166,7 +166,7 @@ static arm_timer_state *arm_timer_init(uint32_t freq) arm_timer_state *s; QEMUBH *bh; - s = (arm_timer_state *)g_malloc0(sizeof(arm_timer_state)); + s = g_new0(arm_timer_state, 1); s->freq = freq; s->control = TIMER_CTRL_IE; diff --git a/target/arm/helper.c b/target/arm/helper.c index 1d689f00b3..b320772cc6 100644 --- a/target/arm/helper.c +++ b/target/arm/helper.c @@ -5333,12 +5333,12 @@ static void arm_cpu_add_definition(gpointer data, gpointer user_data) const char *typename; typename = object_class_get_name(oc); - info = g_malloc0(sizeof(*info)); + info = g_new0(CpuDefinitionInfo, 1); info->name = g_strndup(typename, strlen(typename) - strlen("-" TYPE_ARM_CPU)); info->q_typename = g_strdup(typename); - entry = g_malloc0(sizeof(*entry)); + entry = g_new0(CpuDefinitionInfoList, 1); entry->value = info; entry->next = *cpu_list; *cpu_list = entry; From patchwork Fri Oct 6 23:49:02 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 822775 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="g8Wf9Luq"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3y862s1Kk5z9s8J for ; Sat, 7 Oct 2017 10:55:33 +1100 (AEDT) Received: from localhost ([::1]:47535 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e0cSp-0001uO-8C for incoming@patchwork.ozlabs.org; Fri, 06 Oct 2017 19:55:31 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40569) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e0cOS-0006z4-DP for qemu-devel@nongnu.org; Fri, 06 Oct 2017 19:51:01 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e0cOR-0004od-Ap for qemu-devel@nongnu.org; Fri, 06 Oct 2017 19:51:00 -0400 Received: from mail-qt0-x244.google.com ([2607:f8b0:400d:c0d::244]:49199) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1e0cOR-0004oL-63; Fri, 06 Oct 2017 19:50:59 -0400 Received: by mail-qt0-x244.google.com with SMTP id o3so34343209qte.6; Fri, 06 Oct 2017 16:50:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Z3Jl1DU9Qsb1C3WWKK2RM7cka5/FfovhCUGw84Hbmb8=; b=g8Wf9LuqMp4BZsAQ4nen86G8O3bZhCgQ5IQJdADukN/9GCSmJTEDZlvBT/9Jho8o2G PKnAdwzFwYyJzwWXaCtMxfkFs+pW4DiRGsoWgqM3dOazCnh22x0gMmGjjD6E7850KJuV koVmXzZhYaK5Jyvvq5M/i4ukUxvFoKOBJEDnjcFZgtEtXyNYhbkNhvL3nS6tboXc++ZY GwT7wLKXCgsSpeTzng8k21ZROyvTuDiXHpcYE0j7WfNg8s8RvcbhzruHaw/BI8yYQK7G fD85wF7efDJ1S14rfJts9Uo0I41mRw3ldgT8C+8TDKXuAqZBYGCMwhjePGg7h/3gIFar h0Ig== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=Z3Jl1DU9Qsb1C3WWKK2RM7cka5/FfovhCUGw84Hbmb8=; b=s0YrBGiAd0gAe3OSpn/USTsrIUuVRskfm1s68Hn5PU7uYUSTeEFWaBFzG4XIuQc+cp sNkY//iEV1JpkgqsFR+GcWsvWYd3dzAvEuvj3x8IiQWXoMikbWKvMln9klrOV00Qqoqc 5b3qY7L3AEJxaHHhLzfZuh77JO3l0Y61N13WWANE+6+6QToLA3d/0ih0GiwdZo4qPpKS 1lDKXaH4UcJ9w5Hyfo6VpMr/iP0wjzvvM+0DNNOfXQLgYwVGxoh+CFicJgvKIYY/fJP9 tKKC/4IdyUBLGieXAk+Nk/4bcKYd2oTkL/M4KRgoKNTGmXg9uMQpS5lZo/RjMHd0hg+L VQog== X-Gm-Message-State: AMCzsaXornFAx+CHEQaYUIwLErNDtpiWr4jpt3t21kW08j81g8I2HGWT 6+L54mae998pZOgJ/kaow/w= X-Google-Smtp-Source: AOwi7QAZwkl0ZOjcplAKcTrAjyCO0CsZihgj6vP3hKKH3FWRf9WSbtNpTaYtDfpn6v36M6p2KFQtrg== X-Received: by 10.200.37.8 with SMTP id 8mr5392722qtm.77.1507333858619; Fri, 06 Oct 2017 16:50:58 -0700 (PDT) Received: from yoga.lan ([181.93.89.178]) by smtp.gmail.com with ESMTPSA id g1sm1705226qta.95.2017.10.06.16.50.55 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 06 Oct 2017 16:50:58 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Markus Armbruster , Eric Blake , Gerd Hoffmann Date: Fri, 6 Oct 2017 20:49:02 -0300 Message-Id: <20171006235023.11952-8-f4bug@amsat.org> X-Mailer: git-send-email 2.14.2 In-Reply-To: <20171006235023.11952-1-f4bug@amsat.org> References: <20171006235023.11952-1-f4bug@amsat.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c0d::244 Subject: [Qemu-devel] [PATCH 07/88] Audio: use g_new() family of functions X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , qemu trival , qemu-devel@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Marc-André Lureau Signed-off-by: Marc-André Lureau Signed-off-by: Philippe Mathieu-Daudé [PMD: added audio/alsaaudio.c and audio/coreaudio.c] --- audio/alsaaudio.c | 2 +- audio/coreaudio.c | 2 +- audio/dsoundaudio.c | 2 +- audio/ossaudio.c | 2 +- audio/paaudio.c | 2 +- audio/wavaudio.c | 2 +- audio/wavcapture.c | 2 +- hw/audio/intel-hda.c | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/audio/alsaaudio.c b/audio/alsaaudio.c index 3652a7b5fa..1a129c79e3 100644 --- a/audio/alsaaudio.c +++ b/audio/alsaaudio.c @@ -1126,7 +1126,7 @@ static ALSAConf glob_conf = { static void *alsa_audio_init (void) { - ALSAConf *conf = g_malloc(sizeof(ALSAConf)); + ALSAConf *conf = g_new(ALSAConf, 1); *conf = glob_conf; return conf; } diff --git a/audio/coreaudio.c b/audio/coreaudio.c index c75142084f..651b390b5e 100644 --- a/audio/coreaudio.c +++ b/audio/coreaudio.c @@ -687,7 +687,7 @@ static CoreaudioConf glob_conf = { static void *coreaudio_audio_init (void) { - CoreaudioConf *conf = g_malloc(sizeof(CoreaudioConf)); + CoreaudioConf *conf = g_new(CoreaudioConf, 1); *conf = glob_conf; return conf; diff --git a/audio/dsoundaudio.c b/audio/dsoundaudio.c index 516846eb80..0492d9075e 100644 --- a/audio/dsoundaudio.c +++ b/audio/dsoundaudio.c @@ -787,7 +787,7 @@ static void *dsound_audio_init (void) { int err; HRESULT hr; - dsound *s = g_malloc0(sizeof(dsound)); + dsound *s = g_new0(dsound, 1); s->conf = glob_conf; hr = CoInitialize (NULL); diff --git a/audio/ossaudio.c b/audio/ossaudio.c index 0edd7ea5fe..50d772011c 100644 --- a/audio/ossaudio.c +++ b/audio/ossaudio.c @@ -846,7 +846,7 @@ static OSSConf glob_conf = { static void *oss_audio_init (void) { - OSSConf *conf = g_malloc(sizeof(OSSConf)); + OSSConf *conf = g_new(OSSConf, 1); *conf = glob_conf; if (access(conf->devpath_in, R_OK | W_OK) < 0 || diff --git a/audio/paaudio.c b/audio/paaudio.c index 65beb6f010..fc32960c25 100644 --- a/audio/paaudio.c +++ b/audio/paaudio.c @@ -814,7 +814,7 @@ static PAConf glob_conf = { static void *qpa_audio_init (void) { - paaudio *g = g_malloc(sizeof(paaudio)); + paaudio *g = g_new(paaudio, 1); g->conf = glob_conf; g->mainloop = NULL; g->context = NULL; diff --git a/audio/wavaudio.c b/audio/wavaudio.c index 341eec3121..f90a02610f 100644 --- a/audio/wavaudio.c +++ b/audio/wavaudio.c @@ -231,7 +231,7 @@ static WAVConf glob_conf = { static void *wav_audio_init (void) { - WAVConf *conf = g_malloc(sizeof(WAVConf)); + WAVConf *conf = g_new(WAVConf, 1); *conf = glob_conf; return conf; } diff --git a/audio/wavcapture.c b/audio/wavcapture.c index 5863803584..a744b748a5 100644 --- a/audio/wavcapture.c +++ b/audio/wavcapture.c @@ -145,7 +145,7 @@ int wav_start_capture (CaptureState *s, const char *path, int freq, ops.capture = wav_capture; ops.destroy = wav_destroy; - wav = g_malloc0 (sizeof (*wav)); + wav = g_new0(WAVState, 1); shift = bits16 + stereo; hdr[34] = bits16 ? 0x10 : 0x08; diff --git a/hw/audio/intel-hda.c b/hw/audio/intel-hda.c index 18a50a8f83..3a2b611d41 100644 --- a/hw/audio/intel-hda.c +++ b/hw/audio/intel-hda.c @@ -470,7 +470,7 @@ static void intel_hda_parse_bdl(IntelHDAState *d, IntelHDAStream *st) addr = intel_hda_addr(st->bdlp_lbase, st->bdlp_ubase); st->bentries = st->lvi +1; g_free(st->bpl); - st->bpl = g_malloc(sizeof(bpl) * st->bentries); + st->bpl = g_new(bpl, st->bentries); for (i = 0; i < st->bentries; i++, addr += 16) { pci_dma_read(&d->pci, addr, buf, 16); st->bpl[i].addr = le64_to_cpu(*(uint64_t *)buf); From patchwork Fri Oct 6 23:49:03 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 822783 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="YaMm694R"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3y868p1ttpz9t3C for ; Sat, 7 Oct 2017 11:00:42 +1100 (AEDT) Received: from localhost ([::1]:47567 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e0cXo-0006Wt-8B for incoming@patchwork.ozlabs.org; Fri, 06 Oct 2017 20:00:40 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40619) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e0cOV-00072T-Jk for qemu-devel@nongnu.org; Fri, 06 Oct 2017 19:51:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e0cOU-0004r7-HN for qemu-devel@nongnu.org; Fri, 06 Oct 2017 19:51:03 -0400 Received: from mail-qt0-x244.google.com ([2607:f8b0:400d:c0d::244]:56429) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1e0cOU-0004qf-CO; Fri, 06 Oct 2017 19:51:02 -0400 Received: by mail-qt0-x244.google.com with SMTP id 34so17235062qtb.13; Fri, 06 Oct 2017 16:51:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=/OTcOUTISd6uUSqk1km/zVSFqPQVLmTCnrhQ2HE73Z0=; b=YaMm694R1AMJY95ncsojic8SOqaOekl8ibuoe+CGN9Cfzzm6xUGaZrAYt4onZF7EZN KJuyq+HEcLiQYR2zDYxklvxgpsY0E5yZmrRfBdkWRNbhDc14Vd4B4m9QYh7LZx7I27av i9fTEfxLRjk2GHQloMBKtj/AA+uBQ9MkEHxoXSMZX9QloI+TdIcZJginaPseb0/R2NVe +IGfgnU2PqJQqNflf+W/avyNVbk7VHAwsm2gVpV/o5W7eqsoGYG0JaG+fBqxAgUhmY3i YLsyShqQ+EHEcOwUpLqJMwG6ZLKS46PoOYlXLntx5B4/g4csHA3HC3JPKranRwFJlX/1 Sj8A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=/OTcOUTISd6uUSqk1km/zVSFqPQVLmTCnrhQ2HE73Z0=; b=hKvspLpwsB/E/Spz3yKaPOTHoRIBMM4U/O7IQAsqsP4/hsLjB2en7pezdp5swq0PGk O87Kz6jHO175WDqxqg6MHqlNlJdwdaY60KFCtZJ8RzXzryjX00Cqpe7FntiCTvxydlv9 iVXUjtAYbwv5Ax1nVonKW0e2H8Nm53Ugc+Lel890o9BdLM6LOYLXK9oBIm9RyePa7zjF sViciZMwA9UyKfu33QpVhFyUpvcRTKHu2Ft7xqHRcaj1mPwv7a7X+Jy3B1QhwnGaylvF AXTfP/DsIwvcrPHUZ11LJ3OyPIOiBnW+vvT526atQX2k2QwQj4zLmtU8uOeibSb0Qc7Y scKQ== X-Gm-Message-State: AMCzsaWMm2es1RN0DzWfBnKUT0qUy+AbNsnn6axiSC9Abad+7JBMDv5j ZrkUu/WIOHsxplY1uIT6XUQ= X-Google-Smtp-Source: AOwi7QDESmfJ0G4ShG0y6Y99STx6FnHELKxp7IZ0Fn8GMDF4BpNOeSu76dhu2QGJG7hOt7oH9OADBw== X-Received: by 10.200.45.89 with SMTP id o25mr5468693qta.337.1507333861829; Fri, 06 Oct 2017 16:51:01 -0700 (PDT) Received: from yoga.lan ([181.93.89.178]) by smtp.gmail.com with ESMTPSA id g1sm1705226qta.95.2017.10.06.16.50.58 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 06 Oct 2017 16:51:01 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Markus Armbruster , Eric Blake Date: Fri, 6 Oct 2017 20:49:03 -0300 Message-Id: <20171006235023.11952-9-f4bug@amsat.org> X-Mailer: git-send-email 2.14.2 In-Reply-To: <20171006235023.11952-1-f4bug@amsat.org> References: <20171006235023.11952-1-f4bug@amsat.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c0d::244 Subject: [Qemu-devel] [PATCH 08/88] BT: use g_new() family of functions X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , qemu trival , qemu-devel@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Marc-André Lureau Signed-off-by: Marc-André Lureau Signed-off-by: Philippe Mathieu-Daudé [PMD: another use in hw/bt/l2cap.c] --- bt-host.c | 2 +- bt-vhci.c | 2 +- hw/bt/core.c | 4 ++-- hw/bt/hci.c | 4 ++-- hw/bt/l2cap.c | 6 +++--- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/bt-host.c b/bt-host.c index 2f8f631c25..ad9e45ea43 100644 --- a/bt-host.c +++ b/bt-host.c @@ -177,7 +177,7 @@ struct HCIInfo *bt_host_hci(const char *id) } # endif - s = g_malloc0(sizeof(struct bt_host_hci_s)); + s = g_new0(struct bt_host_hci_s, 1); s->fd = fd; s->hci.cmd_send = bt_host_cmd; s->hci.sco_send = bt_host_sco; diff --git a/bt-vhci.c b/bt-vhci.c index 9d277c32bf..a885e2b8b9 100644 --- a/bt-vhci.c +++ b/bt-vhci.c @@ -157,7 +157,7 @@ void bt_vhci_init(struct HCIInfo *info) exit(-1); } - s = g_malloc0(sizeof(struct bt_vhci_s)); + s = g_new0(struct bt_vhci_s, 1); s->fd = fd; s->info = info ?: qemu_next_hci(); s->info->opaque = s; diff --git a/hw/bt/core.c b/hw/bt/core.c index 615f0af073..281bb40501 100644 --- a/hw/bt/core.c +++ b/hw/bt/core.c @@ -55,7 +55,7 @@ static void bt_dummy_lmp_acl_resp(struct bt_link_s *link, /* Slaves that don't hold any additional per link state can use these */ static void bt_dummy_lmp_connection_request(struct bt_link_s *req) { - struct bt_link_s *link = g_malloc0(sizeof(struct bt_link_s)); + struct bt_link_s *link = g_new0(struct bt_link_s, 1); link->slave = req->slave; link->host = req->host; @@ -135,7 +135,7 @@ struct bt_scatternet_s *qemu_find_bt_vlan(int id) if (vlan->id == id) return &vlan->net; } - vlan = g_malloc0(sizeof(struct bt_vlan_s)); + vlan = g_new0(struct bt_vlan_s, 1); vlan->id = id; pvlan = &first_bt_vlan; while (*pvlan != NULL) diff --git a/hw/bt/hci.c b/hw/bt/hci.c index 476ebec0ab..08e65eb62e 100644 --- a/hw/bt/hci.c +++ b/hw/bt/hci.c @@ -742,7 +742,7 @@ static void bt_hci_connection_reject_event(struct bt_hci_s *hci, static void bt_hci_connection_accept(struct bt_hci_s *hci, struct bt_device_s *host) { - struct bt_hci_link_s *link = g_malloc0(sizeof(struct bt_hci_link_s)); + struct bt_hci_link_s *link = g_new0(struct bt_hci_link_s, 1); evt_conn_complete params; uint16_t handle; uint8_t status = HCI_SUCCESS; @@ -2158,7 +2158,7 @@ static void bt_hci_destroy(struct bt_device_s *dev) struct HCIInfo *bt_new_hci(struct bt_scatternet_s *net) { - struct bt_hci_s *s = g_malloc0(sizeof(struct bt_hci_s)); + struct bt_hci_s *s = g_new0(struct bt_hci_s, 1); s->lm.inquiry_done = timer_new_ns(QEMU_CLOCK_VIRTUAL, bt_hci_inquiry_done, s); s->lm.inquiry_next = timer_new_ns(QEMU_CLOCK_VIRTUAL, bt_hci_inquiry_next, s); diff --git a/hw/bt/l2cap.c b/hw/bt/l2cap.c index e342045140..94f5067d6e 100644 --- a/hw/bt/l2cap.c +++ b/hw/bt/l2cap.c @@ -1241,7 +1241,7 @@ static void l2cap_lmp_connection_request(struct bt_link_s *link) /* Always accept - we only get called if (dev->device->page_scan). */ - l2cap = g_malloc0(sizeof(struct slave_l2cap_instance_s)); + l2cap = g_new0(struct slave_l2cap_instance_s, 1); l2cap->link.slave = &dev->device; l2cap->link.host = link->host; l2cap_init(&l2cap->l2cap, &l2cap->link, 0); @@ -1262,7 +1262,7 @@ static void l2cap_lmp_connection_complete(struct bt_link_s *link) return; } - l2cap = g_malloc0(sizeof(struct l2cap_instance_s)); + l2cap = g_new0(struct l2cap_instance_s, 1); l2cap_init(l2cap, link, 1); link->acl_mode = acl_active; @@ -1358,7 +1358,7 @@ void bt_l2cap_psm_register(struct bt_l2cap_device_s *dev, int psm, int min_mtu, exit(-1); } - new_psm = g_malloc0(sizeof(*new_psm)); + new_psm = g_new0(struct bt_l2cap_psm_s, 1); new_psm->psm = psm; new_psm->min_mtu = min_mtu; new_psm->new_channel = new_channel; From patchwork Fri Oct 6 23:49:04 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 822780 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="vPdbVXAl"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3y866l1DMPz9s8J for ; Sat, 7 Oct 2017 10:58:55 +1100 (AEDT) Received: from localhost ([::1]:47554 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e0cW5-0004yP-8K for incoming@patchwork.ozlabs.org; Fri, 06 Oct 2017 19:58:53 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40675) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e0cOa-00074j-DG for qemu-devel@nongnu.org; Fri, 06 Oct 2017 19:51:09 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e0cOX-0004tE-C3 for qemu-devel@nongnu.org; Fri, 06 Oct 2017 19:51:08 -0400 Received: from mail-qt0-x243.google.com ([2607:f8b0:400d:c0d::243]:43024) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1e0cOX-0004su-7m; Fri, 06 Oct 2017 19:51:05 -0400 Received: by mail-qt0-x243.google.com with SMTP id a43so28407500qta.0; Fri, 06 Oct 2017 16:51:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=QFQO2pEGeljoVMreopkHiTyK9sShOOuO55Xl79EuYfs=; b=vPdbVXAlpUAiP2vA827EXNZTjJYpLgoyClHnxuXmAo6wsCcS5rcQpZ1y49UnlJvI2m ZE42ozAJ+QuwBYr33e99JpPQq/03YBxXJcmgQOD0fFrvsZRfmJ51sGS4Q0paOfEJHVms I6wHhA8cqyrcMCF/BZsUYFrPrlNcu4k4MqpcTVqHqe5R6dXttqS1Kic1Bjg3rsfbyLso JKeQGK5fLiVS1Q6uWnLKw34ZWHZL2wQPWZzH3u51LYM5e8ydNQ3dMouiYbwF5+uTKK8L t2bdgGrHe0RUrowhe2BPrepWl77hMWpmjtfjGFuDJJ3/nSvUj/gQMwEJ1qrue3ZO1Lsl UO9Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=QFQO2pEGeljoVMreopkHiTyK9sShOOuO55Xl79EuYfs=; b=hj4ASAZQp+WhOICoJKqcWmY8otbwkajLw/Ek5MQGmQcC7ljVzbkOYqWvAm0p5HQQWj hqBYKeaic3d7IYF2gTJcTcUjTfOMnS8CWdnFg5DyZ34l2zzOJ7qyJ0frWD58uA+P4bOv uPxyBBlZymvwPzpcyNYcpGFsB5M6qkqwVl1Usqe4Jkt9//XCXOTrnpG9d9HR28QlBMj4 ldzkQuH2H5PYiTVmlGI+57YK/6AGmW13PcZzi5BABobJ+GGkxGxGy0Z3YtnTzBXdJrI4 WhOo+Ng1ze0iGYSCU0rqdT3uigamDQ5pIFf3jlqkuu5UkOUs6q70V04pkSWptuQDD+6v dXPQ== X-Gm-Message-State: AMCzsaUghgelLAxmQ3rVU7+G5SRca1UIcA5HoTMePaaRGT5Hh3SofXRO xTBvmQorSuMtV9wAhOA8X1A= X-Google-Smtp-Source: AOwi7QCHU6SrjGR1gqvq5LuXila7CSIaBptadmXRMdDeWHuCqCE9a6H1tsjUr1UEnNZhE1CmYJ7vEg== X-Received: by 10.200.8.53 with SMTP id u50mr5631925qth.260.1507333864658; Fri, 06 Oct 2017 16:51:04 -0700 (PDT) Received: from yoga.lan ([181.93.89.178]) by smtp.gmail.com with ESMTPSA id g1sm1705226qta.95.2017.10.06.16.51.02 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 06 Oct 2017 16:51:04 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Markus Armbruster , Eric Blake , Gonglei Date: Fri, 6 Oct 2017 20:49:04 -0300 Message-Id: <20171006235023.11952-10-f4bug@amsat.org> X-Mailer: git-send-email 2.14.2 In-Reply-To: <20171006235023.11952-1-f4bug@amsat.org> References: <20171006235023.11952-1-f4bug@amsat.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c0d::243 Subject: [Qemu-devel] [PATCH 09/88] Bootdevice: use g_new() family of functions X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , qemu trival , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Marc-André Lureau Signed-off-by: Marc-André Lureau --- bootdevice.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bootdevice.c b/bootdevice.c index 1141009114..a2936503da 100644 --- a/bootdevice.c +++ b/bootdevice.c @@ -165,7 +165,7 @@ void add_boot_device_path(int32_t bootindex, DeviceState *dev, del_boot_device_path(dev, suffix); - node = g_malloc0(sizeof(FWBootEntry)); + node = g_new0(FWBootEntry, 1); node->bootindex = bootindex; node->suffix = g_strdup(suffix); node->dev = dev; From patchwork Fri Oct 6 23:49:05 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 822787 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="nPJ9PIJR"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3y86D76wD1z9t3R for ; Sat, 7 Oct 2017 11:03:35 +1100 (AEDT) Received: from localhost ([::1]:47587 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e0cac-0000fk-3N for incoming@patchwork.ozlabs.org; Fri, 06 Oct 2017 20:03:34 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40699) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e0cOb-00075s-Nr for qemu-devel@nongnu.org; Fri, 06 Oct 2017 19:51:10 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e0cOa-0004vQ-JC for qemu-devel@nongnu.org; Fri, 06 Oct 2017 19:51:09 -0400 Received: from mail-qt0-x242.google.com ([2607:f8b0:400d:c0d::242]:54803) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1e0cOa-0004vF-Ee; Fri, 06 Oct 2017 19:51:08 -0400 Received: by mail-qt0-x242.google.com with SMTP id i13so34322831qtc.11; Fri, 06 Oct 2017 16:51:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=ZOe/uBesE5oQrH2gITAOw1oHGOzwjO+th/DgyqiJanw=; b=nPJ9PIJRjudcPAY/oixx5n8jfOIcs94dl2pKGX/S1RwwCMOr3b92pcLkxY2KLGphOm yzPbElIazm2inKWGOsQgXrZoeCM6zsBlQiF3L7+d0MwxgnQSwfHxjUYg4WztyKyK1dxn b5/O7DpohLGRAxfY4W5/+Da/lkdvymcOrZck0GBDLCgMELnn53BcLas9aYRbikK721O6 NIKijiVi972SAnQ6B7Ih8DDvrePL5L2uFAmkyJXYZb2Sc37Dv+ZvfmqgOPKOyvA1W+Zw mE07vSTGwWJCRrICpzjqtjsWmRAyIgwc9rdY/CT4ZnvyrWnmyipRXRcIscYjVA0BlCMr pn+w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=ZOe/uBesE5oQrH2gITAOw1oHGOzwjO+th/DgyqiJanw=; b=nFwbnINg17XDV8BkLluDZk2Oj5YUw2d5U6lmbWizFqW70JsI9vHyaK0CM9kbQcAYWC 0Gt7AOC8KpRJoUWmEslZhFAhNlg22HpEeF7yqrzn5w1mEz1iT9142mV6YKIp+9cmkwt+ Kx8JKdFm70pm2v7RQ5fUnLwkgPm6v3aL+EEWsPjhLXlJ40oyH6JFvC0ENMK4Lm83fYLX s1zvvNRN6Z2jHYzX/qP7obzFg3VVLXy/VhEMoHjIpjmVzb3ChsKX1DD952ExhkBZyynv K3jkyEGxDHd8VRJJQZOathsw03Ixpw5+E5/LApB97Cob500R1pAl/BJFjBpMs/8mEw90 Luiw== X-Gm-Message-State: AMCzsaUxmoOimdki12O7MHjkgWYmnZW36NN5IBGFotxMxiod5hyN800x qH3qxls6kSkXdhxmOAclq7A= X-Google-Smtp-Source: AOwi7QCLxKFG+HWYG1MaNy4ipWJr3UyPOGTjinQU6iUdgpJil/TGQ8LxS/NexP4slR2JQjjtApirlg== X-Received: by 10.200.39.205 with SMTP id x13mr5236262qtx.287.1507333867948; Fri, 06 Oct 2017 16:51:07 -0700 (PDT) Received: from yoga.lan ([181.93.89.178]) by smtp.gmail.com with ESMTPSA id g1sm1705226qta.95.2017.10.06.16.51.04 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 06 Oct 2017 16:51:07 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Markus Armbruster , Eric Blake , "Michael S. Tsirkin" , Paolo Bonzini Date: Fri, 6 Oct 2017 20:49:05 -0300 Message-Id: <20171006235023.11952-11-f4bug@amsat.org> X-Mailer: git-send-email 2.14.2 In-Reply-To: <20171006235023.11952-1-f4bug@amsat.org> References: <20171006235023.11952-1-f4bug@amsat.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c0d::242 Subject: [Qemu-devel] [PATCH 10/88] Character devices: use g_new() family of functions X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , qemu trival , qemu-devel@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Marc-André Lureau Signed-off-by: Marc-André Lureau Signed-off-by: Philippe Mathieu-Daudé [PMD: squashed PC Chipsets: parallel + serial] --- hw/char/parallel.c | 2 +- hw/char/serial.c | 4 ++-- hw/char/sh_serial.c | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/hw/char/parallel.c b/hw/char/parallel.c index f79dc76543..da8566538e 100644 --- a/hw/char/parallel.c +++ b/hw/char/parallel.c @@ -614,7 +614,7 @@ bool parallel_mm_init(MemoryRegion *address_space, { ParallelState *s; - s = g_malloc0(sizeof(ParallelState)); + s = g_new0(ParallelState, 1); s->irq = irq; qemu_chr_fe_init(&s->chr, chr, &error_abort); s->it_shift = it_shift; diff --git a/hw/char/serial.c b/hw/char/serial.c index 376bd2f240..dcc25d649f 100644 --- a/hw/char/serial.c +++ b/hw/char/serial.c @@ -978,7 +978,7 @@ SerialState *serial_init(int base, qemu_irq irq, int baudbase, { SerialState *s; - s = g_malloc0(sizeof(SerialState)); + s = g_new0(SerialState, 1); s->irq = irq; s->baudbase = baudbase; @@ -1034,7 +1034,7 @@ SerialState *serial_mm_init(MemoryRegion *address_space, { SerialState *s; - s = g_malloc0(sizeof(SerialState)); + s = g_new0(SerialState, 1); s->it_shift = it_shift; s->irq = irq; diff --git a/hw/char/sh_serial.c b/hw/char/sh_serial.c index 835b5378a0..0d1a67d450 100644 --- a/hw/char/sh_serial.c +++ b/hw/char/sh_serial.c @@ -365,7 +365,7 @@ void sh_serial_init(MemoryRegion *sysmem, { sh_serial_state *s; - s = g_malloc0(sizeof(sh_serial_state)); + s = g_new0(sh_serial_state, 1); s->feat = feat; s->flags = SH_SERIAL_FLAG_TEND | SH_SERIAL_FLAG_TDE; From patchwork Fri Oct 6 23:49:06 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 822791 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="AxXer6TU"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3y86HH681Yz9t3R for ; Sat, 7 Oct 2017 11:06:19 +1100 (AEDT) Received: from localhost ([::1]:47605 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e0cdF-0002vv-VP for incoming@patchwork.ozlabs.org; Fri, 06 Oct 2017 20:06:18 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40752) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e0cOe-00078l-50 for qemu-devel@nongnu.org; Fri, 06 Oct 2017 19:51:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e0cOd-0004xZ-FF for qemu-devel@nongnu.org; Fri, 06 Oct 2017 19:51:12 -0400 Received: from mail-qt0-x241.google.com ([2607:f8b0:400d:c0d::241]:46778) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1e0cOd-0004xM-AX; Fri, 06 Oct 2017 19:51:11 -0400 Received: by mail-qt0-x241.google.com with SMTP id 6so25226992qtw.3; Fri, 06 Oct 2017 16:51:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Gr3+CCvBB9HyJAmqrgGCtgfE3qzCQoKb90L1xybpd1I=; b=AxXer6TU/HtYBaEcidtI4EpRNUJSySKy2xNwnO44ZIZM3NbFm5gt9RnuR8xlJxrLJn nFqzjEPnkBj4D3iornzTXpoRphyz9fXDp5UBkcQzqvapuFhQJXZLSqYgdzyxqhGfZn0L gpCkXpENMw2b0N/SkbpEUAvmLeJ3X5znnoQMvKxxLhQY9GLeemnM5qgCzRkRlN6smAIn vINiDo9qPJFrp0EqzvuXuOsqet867/P4CcUC7+UP0dw313a2leSYaeHdBD/xpj38uiAU E0+d3Bjd0amHkLVfCwD+dUx3gJGP/7zln1plNMBX/eU/EHlsY67R+aNwvH6Heul0iJIW qUKw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=Gr3+CCvBB9HyJAmqrgGCtgfE3qzCQoKb90L1xybpd1I=; b=msFYllPI33S7HpoGHBz7tashvVx8luST6D7yyQsqqV+mozRPtGkIzsKBsRZ7eqTr3Z QH5q6VCj5g/Kw41cCNudQdtdLo9Sa7wqYNposkFIBZ8fZUbzDJQ03OmgQZczpqRkvnuR EWPNPeExKxQufb37pmzXW3RQxqybCzCwfDEcUAQE1vpRFGiJipJn50SJDCsNQh0QwqPw XlaKP3+zEyS6u6tR6HlphIutZlbgiLH8I5VUBi7oQGzMTkAGZ41fF/nRic8hk/htYXGd buqKAJvXKMgFgGdH5Nqndeboz48ce8WhuhQDYaZLvqzJ1+3rUgK2rGL7lPP5s5ot0jTD kFrw== X-Gm-Message-State: AMCzsaUuu2n+XrgnhhbgYuTeVndVnB1mNSEGu+TAZJHJhUhWWtkOVqTh rJpNPM7gNAdyZF57YUg+djI84zSx X-Google-Smtp-Source: AOwi7QAuYf9Bd2wjOLzrHIcNzm+g8PHdCsO4WsC5z7a909pXh1Y/V2QUIT5pDcIuEMkPB3hTgeFQsA== X-Received: by 10.200.63.167 with SMTP id d36mr5650146qtk.7.1507333870758; Fri, 06 Oct 2017 16:51:10 -0700 (PDT) Received: from yoga.lan ([181.93.89.178]) by smtp.gmail.com with ESMTPSA id g1sm1705226qta.95.2017.10.06.16.51.08 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 06 Oct 2017 16:51:10 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Markus Armbruster , Eric Blake , Gonglei Date: Fri, 6 Oct 2017 20:49:06 -0300 Message-Id: <20171006235023.11952-12-f4bug@amsat.org> X-Mailer: git-send-email 2.14.2 In-Reply-To: <20171006235023.11952-1-f4bug@amsat.org> References: <20171006235023.11952-1-f4bug@amsat.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c0d::241 Subject: [Qemu-devel] [PATCH 11/88] Cryptodev Backends: use g_new() family of functions X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , qemu trival , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Marc-André Lureau Signed-off-by: Marc-André Lureau --- backends/cryptodev.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backends/cryptodev.c b/backends/cryptodev.c index 67edfa5328..44f693f58b 100644 --- a/backends/cryptodev.c +++ b/backends/cryptodev.c @@ -42,7 +42,7 @@ cryptodev_backend_new_client(const char *model, { CryptoDevBackendClient *cc; - cc = g_malloc0(sizeof(CryptoDevBackendClient)); + cc = g_new0(CryptoDevBackendClient, 1); cc->model = g_strdup(model); if (name) { cc->name = g_strdup(name); From patchwork Fri Oct 6 23:49:07 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 822776 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="dNTzOZIz"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3y863j5MVwz9s8J for ; Sat, 7 Oct 2017 10:56:17 +1100 (AEDT) Received: from localhost ([::1]:47545 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e0cTX-0002kb-QS for incoming@patchwork.ozlabs.org; Fri, 06 Oct 2017 19:56:15 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40814) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e0cOj-0007BQ-4q for qemu-devel@nongnu.org; Fri, 06 Oct 2017 19:51:17 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e0cOg-0004zB-Ng for qemu-devel@nongnu.org; Fri, 06 Oct 2017 19:51:17 -0400 Received: from mail-qt0-x244.google.com ([2607:f8b0:400d:c0d::244]:49200) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1e0cOg-0004yz-Jg; Fri, 06 Oct 2017 19:51:14 -0400 Received: by mail-qt0-x244.google.com with SMTP id o3so34343731qte.6; Fri, 06 Oct 2017 16:51:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=t6PylHwwP4tyIHa16G3nTSUTK3+PoDs11uzf54Udm7s=; b=dNTzOZIzbO1pxogV9yer1Obeh1t5rpHfYUZgM+a8OCijfYhWoBN/Ko3ONMVvXi0Bq3 E6D5mVdhgpUzk6ZIiRI4BHMzr6EDZ5Z0Y4jhNe/YbwTXh2PcCSY0QJxJtCDZt4osSlmv L9IrVGSTLI3M8FObQ3c0Y89iy+6ee5rxROfs9irRG26bjAjEOtqsKT2HrCKN8CDp0erT XA2ey2iqiCzbhF8ostMmuK1FwCnzpxEDO3pqfuirCZM/h7TXTFFC3Mh6qNGr2HAMRZrP gdfkQ0TT1jdqKMxy1O2ZB4R98R6VKfWQBjapeDd3ZTpn9l8M+XxPLJTzWoGftOQO7504 ePnw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=t6PylHwwP4tyIHa16G3nTSUTK3+PoDs11uzf54Udm7s=; b=cOqe2CnRqvf0weMDwU2aHgxxTEfV/4dM2oUa9HE/HuAPXo+60iXaanB6w7Bg0gi9pf PPOSyI5dJmcmETvQJeh5Lg/zX2v1soG6l0FVqR4tD4FVPthKQGAudFHIHuUwuz0X+Hzx 6meITuQe5YZl/i0jAaEvlKAa5NgdrS0dOEAjwhfK6aqz6VZANdQfzkkZiT8CSl+L4YQj LOS8Yt6cvtq2aX56k1dRKT22i9Qj2zj5HN308rQThN17Slxiv5V35qcxnqomCl7o2ARp pt/u/dThKbnhXrGE9ew4uioJNVypfntm6R+ufWE+uAkbLlGJ6cvc65RXK7q3Wpz6xR2Q Romw== X-Gm-Message-State: AMCzsaVGSe97PMo3PVezmKVYhKwf3Lc8g27sf/UrXVlqudVoYOX2al08 HmSe4N7IX0RRvTIJDdI6qk0= X-Google-Smtp-Source: AOwi7QBDO3HowqXhsmcgOO0hSJsJbz0AEFE6Xy3dmxTQs8mZEH10+yPWgLEqq4MQvyLWlzGGli2ggw== X-Received: by 10.200.44.118 with SMTP id e51mr5501675qta.171.1507333874107; Fri, 06 Oct 2017 16:51:14 -0700 (PDT) Received: from yoga.lan ([181.93.89.178]) by smtp.gmail.com with ESMTPSA id g1sm1705226qta.95.2017.10.06.16.51.10 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 06 Oct 2017 16:51:13 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Markus Armbruster , Eric Blake , Eduardo Habkost , Igor Mammedov Date: Fri, 6 Oct 2017 20:49:07 -0300 Message-Id: <20171006235023.11952-13-f4bug@amsat.org> X-Mailer: git-send-email 2.14.2 In-Reply-To: <20171006235023.11952-1-f4bug@amsat.org> References: <20171006235023.11952-1-f4bug@amsat.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c0d::244 Subject: [Qemu-devel] [PATCH 12/88] backends/hostmem: use g_new() family of functions X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , qemu trival , =?utf-8?q?Philippe_Mathieu-Dau?= =?utf-8?b?ZMOp?= , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Philippe Mathieu-Daudé --- backends/hostmem.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/backends/hostmem.c b/backends/hostmem.c index ee2c2d5bfd..6a12f920c2 100644 --- a/backends/hostmem.c +++ b/backends/hostmem.c @@ -78,7 +78,7 @@ host_memory_backend_get_host_nodes(Object *obj, Visitor *v, const char *name, return; } - *node = g_malloc0(sizeof(**node)); + *node = g_new0(uint16List, 1); (*node)->value = value; node = &(*node)->next; @@ -88,7 +88,7 @@ host_memory_backend_get_host_nodes(Object *obj, Visitor *v, const char *name, break; } - *node = g_malloc0(sizeof(**node)); + *node = g_new0(uint16List, 1); (*node)->value = value; node = &(*node)->next; } while (true); From patchwork Fri Oct 6 23:49:08 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 822784 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="QFjtF8oY"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3y86BK5mmbz9s8J for ; Sat, 7 Oct 2017 11:01:59 +1100 (AEDT) Received: from localhost ([::1]:47579 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e0cZ1-0007e0-K2 for incoming@patchwork.ozlabs.org; Fri, 06 Oct 2017 20:01:55 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40831) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e0cOk-0007DC-Rj for qemu-devel@nongnu.org; Fri, 06 Oct 2017 19:51:19 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e0cOk-00051v-4I for qemu-devel@nongnu.org; Fri, 06 Oct 2017 19:51:18 -0400 Received: from mail-qt0-x242.google.com ([2607:f8b0:400d:c0d::242]:51461) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1e0cOk-00051X-0N; Fri, 06 Oct 2017 19:51:18 -0400 Received: by mail-qt0-x242.google.com with SMTP id q4so34327951qtq.8; Fri, 06 Oct 2017 16:51:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=FdXnoS+y/hCwRoyew4V+7q+PEQBUX8fAjxIoGZsfD8Y=; b=QFjtF8oYQRetC+NQuduqiHAAHAHU48jwk1k6Zwmy4hTujdzEz7CSV6w629Cj8rTZ1Y fk2s0gDJoA51FbIFDwB4LmrytJcdfhkM/zuJKz7t6EuLiHOrzbxKWpvpE0ASyy0TqoxI hTXUlClzxYsyCV7f2Kok+B4/BNJYNP0LWB9dz8uDATv/eEcgkNVwxZY69+JlxZ9n3Por ZRq9ruWhSGDSNidYrF2oeIWWDlCv6wnkfdWOlrWpck8cpLyco67z2sk7y9VEGZr2oDy4 N25lJOf/06Ty8Cu+1Boj80HigDTcY9LHnQKm35jb5bHJqx2AFA0Rw99a2ttnqIEd++77 HATg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=FdXnoS+y/hCwRoyew4V+7q+PEQBUX8fAjxIoGZsfD8Y=; b=CmF0LZhB6l7jbUv0rm2GCrAx1Wd21Yz1R25r6BurM90oUWNLsNLxuz2ZUqJdU+LeoS c8uwJRfL3lR+9dxMNJf8snqr1Upkz+Arqr6uTvdFdJY6+krQHJLHkDyCDRVv8Ck+7aFT CEVoBj6MHWRzt+1+cOn9SzK1yA/W3PqsxfWEh1YONXyu8JpdrI4XZ2J29af0NAr4Itpg +mtP9AaLpIek7S5j/OWnqX3odITA9TMOYbehr4/g748txSBURDEpmbTGjUMhXrSePvi1 YTbM+SXRjNVjkFD4HyGjHkVByYumSnQnP62tTqx3jS8+OpJtFMIP2p7JGls6V43jrBYi gJUA== X-Gm-Message-State: AMCzsaVvlEGpDrXhJUwiWQIgivmgMvwjP+dh8tRLsUk+Q9kOqAXDQ1+1 cSz0/6flFCSXcjMnQNSQGGM= X-Google-Smtp-Source: AOwi7QCEdH1+GzBDAtD5s6PxF9jBHaN/+gutHYwbtrMT1Ur6FdQvdJ+UohDVHa+6OnGrXPeIVJXlwA== X-Received: by 10.200.27.163 with SMTP id z32mr1004959qtj.8.1507333877497; Fri, 06 Oct 2017 16:51:17 -0700 (PDT) Received: from yoga.lan ([181.93.89.178]) by smtp.gmail.com with ESMTPSA id g1sm1705226qta.95.2017.10.06.16.51.14 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 06 Oct 2017 16:51:16 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Markus Armbruster , Eric Blake , Fam Zheng , John Snow Date: Fri, 6 Oct 2017 20:49:08 -0300 Message-Id: <20171006235023.11952-14-f4bug@amsat.org> X-Mailer: git-send-email 2.14.2 In-Reply-To: <20171006235023.11952-1-f4bug@amsat.org> References: <20171006235023.11952-1-f4bug@amsat.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c0d::242 Subject: [Qemu-devel] [PATCH 13/88] Dirty Bitmaps: use g_new() family of functions X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , qemu-block@nongnu.org, qemu trival , qemu-devel@nongnu.org, =?utf-8?q?Philippe_?= =?utf-8?q?Mathieu-Daud=C3=A9?= , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Marc-André Lureau Signed-off-by: Marc-André Lureau Signed-off-by: Philippe Mathieu-Daudé [PMD: squashed tests/test-hbitmap.c changes] Reviewed-by: John Snow Acked-by: John Snow --- tests/test-hbitmap.c | 2 +- util/hbitmap.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/test-hbitmap.c b/tests/test-hbitmap.c index af41642346..fea3a64712 100644 --- a/tests/test-hbitmap.c +++ b/tests/test-hbitmap.c @@ -122,7 +122,7 @@ static void hbitmap_test_truncate_impl(TestHBitmapData *data, n = hbitmap_test_array_size(size); m = hbitmap_test_array_size(data->old_size); - data->bits = g_realloc(data->bits, sizeof(unsigned long) * n); + data->bits = g_renew(unsigned long, data->bits, n); if (n > m) { memset(&data->bits[m], 0x00, sizeof(unsigned long) * (n - m)); } diff --git a/util/hbitmap.c b/util/hbitmap.c index 2f9d0fdbd0..4eb0188836 100644 --- a/util/hbitmap.c +++ b/util/hbitmap.c @@ -668,7 +668,7 @@ void hbitmap_truncate(HBitmap *hb, uint64_t size) } old = hb->sizes[i]; hb->sizes[i] = size; - hb->levels[i] = g_realloc(hb->levels[i], size * sizeof(unsigned long)); + hb->levels[i] = g_renew(unsigned long, hb->levels[i], size); if (!shrink) { memset(&hb->levels[i][old], 0x00, (size - old) * sizeof(*hb->levels[i])); From patchwork Fri Oct 6 23:49:09 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 822795 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="jxak0Im1"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3y86LN2Wywz9t3R for ; Sat, 7 Oct 2017 11:09:00 +1100 (AEDT) Received: from localhost ([::1]:47616 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e0cfq-0005K0-B0 for incoming@patchwork.ozlabs.org; Fri, 06 Oct 2017 20:08:58 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40869) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e0cOo-0007Gr-2g for qemu-devel@nongnu.org; Fri, 06 Oct 2017 19:51:23 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e0cOn-00054V-6X for qemu-devel@nongnu.org; Fri, 06 Oct 2017 19:51:22 -0400 Received: from mail-qt0-x244.google.com ([2607:f8b0:400d:c0d::244]:53646) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1e0cOn-00054K-2V; Fri, 06 Oct 2017 19:51:21 -0400 Received: by mail-qt0-x244.google.com with SMTP id n61so6361497qte.10; Fri, 06 Oct 2017 16:51:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=JdpHKL0Vafr+p5ghpOud2FOvXeUjkLarsFvUMM/s7zY=; b=jxak0Im1LI3skYaYSFypi83dGWgh8+Er7rnlBw5opL4Oobk/nl9bWYbE8S1c/OFrwC bt2MYTQE1SVR0jZpbRFU/0tjNDpeScWBIcAbsk+/XRMXkeaRbzxLkvYuze0//Rk70S3Y WCcVjp/aSm0mhTdxTo5H6drVUTgM5oP3cKjbFi6BpYi7SVbrsD5ziZSr42iQfSlHl1EG RGfgCNUcmI2DfxB+EIQDHoL1LDM03I4JLtRZHXWS84jcgxRfGNs0Rlc4awIDTBzR6lE/ OPqgq5uYooaXxJtcWJrTFgwLiNDkeaCOVaDkLAJmnKgqA/qREbxh31ricZSvVb/SQIna CDwA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=JdpHKL0Vafr+p5ghpOud2FOvXeUjkLarsFvUMM/s7zY=; b=bo+7D/bXFLs4HghAUfHeLQGR2UHo6zUqxExk/KBT9Y5TcL5DkRmedGL/e3yHfG8K7w LvpWO6GyDwTBnewPOWhOefXhpJcIE/eEA2VuDD3rHpipngPEKpOAxKJGkC9NHJRY1ooF 9wZ54PC4wYkUH85RbY6N6LjnECacgmDHnv4mwZ7Xp9YSei+oOiTTKlOiKOxZFNssg537 bBwZsUQ1JmtKn5A3DuV+LMUnwNEpeHxZrQQKOzTHb7U85hKuE1Jk2a7omxDPmhQ8ktxa Ack69BnqkHxgQo8z8QNlTXG37BUDb51sy0gaRQpdYZLjeBnmotboEeOIA2aTDut+ITJu xgLA== X-Gm-Message-State: AMCzsaWmMucmMoNqHfH9yYeXU9KVTk3tO8WlvvQMZEaAsQ1IbqoJez+H VXgAH7GHo5+7OlXJkI1cyUI= X-Google-Smtp-Source: AOwi7QCR6z8WRB/tZRZig7i1RlX3H/ZMPMFM0HEI94accrVX85SbndSCPxr5EhwBNMaNZIwG6vWTHw== X-Received: by 10.237.37.76 with SMTP id w12mr174846qtc.201.1507333880574; Fri, 06 Oct 2017 16:51:20 -0700 (PDT) Received: from yoga.lan ([181.93.89.178]) by smtp.gmail.com with ESMTPSA id g1sm1705226qta.95.2017.10.06.16.51.17 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 06 Oct 2017 16:51:20 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Markus Armbruster , Eric Blake , Gerd Hoffmann Date: Fri, 6 Oct 2017 20:49:09 -0300 Message-Id: <20171006235023.11952-15-f4bug@amsat.org> X-Mailer: git-send-email 2.14.2 In-Reply-To: <20171006235023.11952-1-f4bug@amsat.org> References: <20171006235023.11952-1-f4bug@amsat.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c0d::244 Subject: [Qemu-devel] [PATCH 14/88] ui/vnc: use g_new() family of functions X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , qemu trival , qemu-devel@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Marc-André Lureau Signed-off-by: Marc-André Lureau Signed-off-by: Philippe Mathieu-Daudé [PMD: renamed 'Graphics' -> ui/vnc, added ui/vnc.c and ui/vnc-palette.c] --- ui/vnc-enc-tight.c | 2 +- ui/vnc-palette.c | 2 +- ui/vnc.c | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/ui/vnc-enc-tight.c b/ui/vnc-enc-tight.c index f38aceb4da..48ec584098 100644 --- a/ui/vnc-enc-tight.c +++ b/ui/vnc-enc-tight.c @@ -1475,7 +1475,7 @@ static int send_sub_rect(VncState *vs, int x, int y, int w, int h) #endif if (!color_count_palette) { - color_count_palette = g_malloc(sizeof(VncPalette)); + color_count_palette = g_new(VncPalette, 1); vnc_tight_cleanup_notifier.notify = vnc_tight_cleanup; qemu_thread_atexit_add(&vnc_tight_cleanup_notifier); } diff --git a/ui/vnc-palette.c b/ui/vnc-palette.c index dc7c0ba997..284e118715 100644 --- a/ui/vnc-palette.c +++ b/ui/vnc-palette.c @@ -56,7 +56,7 @@ VncPalette *palette_new(size_t max, int bpp) { VncPalette *palette; - palette = g_malloc0(sizeof(*palette)); + palette = g_new0(VncPalette, 1); palette_init(palette, max, bpp); return palette; } diff --git a/ui/vnc.c b/ui/vnc.c index 9f8d5a1b1f..b021fb398b 100644 --- a/ui/vnc.c +++ b/ui/vnc.c @@ -231,7 +231,7 @@ static VncServerInfo *vnc_server_info_get(VncDisplay *vd) return NULL; } - info = g_malloc0(sizeof(*info)); + info = g_new0(VncServerInfo, 1); vnc_init_basic_info_from_server_addr(vd->lsock[0], qapi_VncServerInfo_base(info), &err); info->has_auth = true; @@ -316,7 +316,7 @@ static VncClientInfo *qmp_query_vnc_client(const VncState *client) VncClientInfo *info; Error *err = NULL; - info = g_malloc0(sizeof(*info)); + info = g_new0(VncClientInfo, 1); vnc_init_basic_info_from_remote_addr(client->sioc, qapi_VncClientInfo_base(info), @@ -3047,7 +3047,7 @@ void vnc_display_init(const char *id) if (vnc_display_find(id) != NULL) { return; } - vd = g_malloc0(sizeof(*vd)); + vd = g_new0(VncDisplay, 1); vd->id = strdup(id); QTAILQ_INSERT_TAIL(&vnc_displays, vd, next); From patchwork Fri Oct 6 23:49:10 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 822788 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="jbiGHKHU"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3y86Fx3tJLz9t3R for ; Sat, 7 Oct 2017 11:05:09 +1100 (AEDT) Received: from localhost ([::1]:47593 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e0cc7-0001tu-HX for incoming@patchwork.ozlabs.org; Fri, 06 Oct 2017 20:05:07 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40906) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e0cOs-0007JU-EY for qemu-devel@nongnu.org; Fri, 06 Oct 2017 19:51:27 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e0cOq-00055e-BQ for qemu-devel@nongnu.org; Fri, 06 Oct 2017 19:51:26 -0400 Received: from mail-qt0-x242.google.com ([2607:f8b0:400d:c0d::242]:47273) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1e0cOq-00055Y-6z; Fri, 06 Oct 2017 19:51:24 -0400 Received: by mail-qt0-x242.google.com with SMTP id z50so29309475qtj.4; Fri, 06 Oct 2017 16:51:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=IveoW0s0OMqPvmw7zEM7C3xroZUlSaKNX2Nivmw41eg=; b=jbiGHKHU42vS9pRI7yUkVpNhFr+lF59NSCbYmyqv00vB2ZcNW5t9pHzykNrhUkkJhp ozEsnxaEcJGBMi2AnKpx9jGBbaMNs+NvCrTLtchSzzUZM7jkO8viTSaQHtNEhCbH8vQY a5qYtfD1oHG/vZZqRwQrNM4dh/nrMr1eCk77A6KrsEUHdURnlylLSMpHWMJE+DcxD78u TjOnrrDlMKUggII2sGqvJREXmVRWZVog4QiU9m6SedqL6PvJA7CTzxe70NUvHfYMSbON VNtLK8Dp0/TXWGKFpLRAxOIlaZBJeOwnS6Q2/MT1EEczDyzIdYWelWJevTahs3nwWrM4 eJoA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=IveoW0s0OMqPvmw7zEM7C3xroZUlSaKNX2Nivmw41eg=; b=GOMaDFCeMmJZJzsJN/n+AkC6/gLT9U1TAkU47jauHAq7ar2VozP3nmw9xUSoPGxbMD g8RCseelq5iOsRyCrT8o1MF2bZPrtM5I/EABnNtOi5858bxf1CrdulaB1SW1RIDW7eHG iOMR9yHUnXiPua0Ze7FNKBKeY4YNvo5AHzyYxDLM7t9+nlh/M19dVZJvwq1kTIol7bA7 8ElY3KY8+z9q9pWqf3A9T9G+pyhfnAPfs2U2JdS0T/yUtxzKaw3k38cjy2Tch0R83EZw O2wBVynIiuSV8VwbLQlPsdSEq2VKXmeWKN36YoBDhme+Lfp3cpBCeWMn6YrL4mlQx/vX roxQ== X-Gm-Message-State: AMCzsaXuvSYcWYkub9Cm48BBFf3tqOTjhm81udzMTvXhsYgte1b5uUO7 NhGUdY4+PTAnmUgKzqIE5s0= X-Google-Smtp-Source: AOwi7QA9zVtqtljr0jcOBjFbHpvd8OP8aBXuXEMNRFyazZC2TPMcLPK+O4gY5EfOwB+Qy0UuHBuxOA== X-Received: by 10.237.48.236 with SMTP id 99mr5556822qtf.316.1507333883679; Fri, 06 Oct 2017 16:51:23 -0700 (PDT) Received: from yoga.lan ([181.93.89.178]) by smtp.gmail.com with ESMTPSA id g1sm1705226qta.95.2017.10.06.16.51.20 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 06 Oct 2017 16:51:23 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Markus Armbruster , Eric Blake , Gerd Hoffmann Date: Fri, 6 Oct 2017 20:49:10 -0300 Message-Id: <20171006235023.11952-16-f4bug@amsat.org> X-Mailer: git-send-email 2.14.2 In-Reply-To: <20171006235023.11952-1-f4bug@amsat.org> References: <20171006235023.11952-1-f4bug@amsat.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c0d::242 Subject: [Qemu-devel] [PATCH 15/88] ui/spice: use g_new() family of functions X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , qemu trival , =?utf-8?q?Philippe_Mathieu-Dau?= =?utf-8?b?ZMOp?= , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Philippe Mathieu-Daudé --- ui/spice-core.c | 10 +++++----- ui/spice-display.c | 4 ++-- ui/spice-input.c | 4 ++-- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/ui/spice-core.c b/ui/spice-core.c index ea04dc69b5..e76a3f46eb 100644 --- a/ui/spice-core.c +++ b/ui/spice-core.c @@ -63,7 +63,7 @@ static SpiceTimer *timer_add(SpiceTimerFunc func, void *opaque) { SpiceTimer *timer; - timer = g_malloc0(sizeof(*timer)); + timer = g_new0(SpiceTimer, 1); timer->timer = timer_new_ms(QEMU_CLOCK_REALTIME, func, opaque); QTAILQ_INSERT_TAIL(&timers, timer, next); return timer; @@ -127,7 +127,7 @@ static SpiceWatch *watch_add(int fd, int event_mask, SpiceWatchFunc func, void * { SpiceWatch *watch; - watch = g_malloc0(sizeof(*watch)); + watch = g_new0(SpiceWatch, 1); watch->fd = fd; watch->func = func; watch->opaque = opaque; @@ -155,7 +155,7 @@ static void channel_list_add(SpiceChannelEventInfo *info) { ChannelList *item; - item = g_malloc0(sizeof(*item)); + item = g_new0(ChannelList, 1); item->info = info; QTAILQ_INSERT_TAIL(&channel_list, item, link); } @@ -380,7 +380,7 @@ static SpiceChannelList *qmp_query_spice_channels(void) assert(item->info->flags & SPICE_CHANNEL_EVENT_FLAG_ADDR_EXT); - chan = g_malloc0(sizeof(*chan)); + chan = g_new0(SpiceChannelList, 1); chan->value = g_malloc0(sizeof(*chan->value)); paddr = (struct sockaddr *)&item->info->paddr_ext; @@ -525,7 +525,7 @@ SpiceInfo *qmp_query_spice(Error **errp) unsigned int minor; unsigned int micro; - info = g_malloc0(sizeof(*info)); + info = g_new0(SpiceInfo, 1); if (!spice_server || !opts) { info->enabled = false; diff --git a/ui/spice-display.c b/ui/spice-display.c index 0963c7825f..5b9f6f0bb0 100644 --- a/ui/spice-display.c +++ b/ui/spice-display.c @@ -66,7 +66,7 @@ QXLCookie *qxl_cookie_new(int type, uint64_t io) { QXLCookie *cookie; - cookie = g_malloc0(sizeof(*cookie)); + cookie = g_new0(QXLCookie, 1); cookie->type = type; cookie->io = io; return cookie; @@ -142,7 +142,7 @@ static void qemu_spice_create_one_update(SimpleSpiceDisplay *ssd, rect->left, rect->right, rect->top, rect->bottom); - update = g_malloc0(sizeof(*update)); + update = g_new0(SimpleSpiceUpdate, 1); drawable = &update->drawable; image = &update->image; cmd = &update->ext.cmd; diff --git a/ui/spice-input.c b/ui/spice-input.c index 3d41aa1831..e47ca7a051 100644 --- a/ui/spice-input.c +++ b/ui/spice-input.c @@ -243,12 +243,12 @@ void qemu_spice_input_init(void) QemuSpiceKbd *kbd; QemuSpicePointer *pointer; - kbd = g_malloc0(sizeof(*kbd)); + kbd = g_new0(QemuSpiceKbd, 1); kbd->sin.base.sif = &kbd_interface.base; qemu_spice_add_interface(&kbd->sin.base); qemu_add_led_event_handler(kbd_leds, kbd); - pointer = g_malloc0(sizeof(*pointer)); + pointer = g_new0(QemuSpicePointer, 1); pointer->mouse.base.sif = &mouse_interface.base; pointer->tablet.base.sif = &tablet_interface.base; qemu_spice_add_interface(&pointer->mouse.base); From patchwork Fri Oct 6 23:49:11 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 822781 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="JwIhn6MW"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3y867N2GbRz9s8J for ; Sat, 7 Oct 2017 10:59:28 +1100 (AEDT) Received: from localhost ([::1]:47562 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e0cWc-0005Vz-BD for incoming@patchwork.ozlabs.org; Fri, 06 Oct 2017 19:59:26 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40985) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e0cOy-0007QL-Ne for qemu-devel@nongnu.org; Fri, 06 Oct 2017 19:51:35 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e0cOx-00058a-JJ for qemu-devel@nongnu.org; Fri, 06 Oct 2017 19:51:32 -0400 Received: from mail-qt0-x241.google.com ([2607:f8b0:400d:c0d::241]:45324) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1e0cOx-00058T-Eo; Fri, 06 Oct 2017 19:51:31 -0400 Received: by mail-qt0-x241.google.com with SMTP id k1so23349374qti.2; Fri, 06 Oct 2017 16:51:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=4b4CTy0mjMj84x5yyngO61akbi5W7kWydDy+5g+X4fk=; b=JwIhn6MWJcZDj8a7z1XYzhkyu0IfFkXkAUT8lbxS90aczRvEXgPuIGuZS12FZBw9Hm UWmfRi7iTrhX9gZ7jARiSYGVqDcn31aDpJS10CRsAoPnex0YS8iBNdV1Adxnc10YGZek DNxULFMamkSSeD+SA79o5awwFAITUugAicBz0UGFoGG+hAHAuO2qiHWR0AHztsWv9AII 7bpH7XUWLTr3nmKX60c2dw1K/YPvdLgSEQkaU/W9pjRfhk3gkOQtdYRvT8XJYTuRyV8N 1Yx1j/wFs9NEKEqpx8B23foPyJ1K7g+n08e0rwOdqoiwP/Igy55EW+LeagPkOabuu74B ndMA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=4b4CTy0mjMj84x5yyngO61akbi5W7kWydDy+5g+X4fk=; b=q7vjH4kbaQB4hQBhvgfBUpKFPIWkzNWtA+GhZ7ogARsH1fra8/5lM9QDxsxfIs/Ma/ zieiYJrYSbALnNWPaQ8VKfMsqnI5T6idcIX5ja/4zXZRFhl2NuQWbylRYJt2h9xCa81q igFRvkb5yu3IZn+/QrTrGZFE9Fwh19o+gxCDydvaQXbnXx8HyFafd9JGR6UtKuLkrwvh zzDubqUTQIgzm9vw8pfh7eZ7HwYev9u6gdcCY3LOXsrLfRw+QUtWB+c0kQMWeyRHmbhY hKGSE9RHTutWmPnH2j25k+Fxm9Gaa9n8A+GaYf4XVpnssYhtAUsZuL5dvLHsJWaSvZ3A bUUg== X-Gm-Message-State: AMCzsaWFr43VqCXOL6n7HmLW/g6/kSfepoKoQ66x1zqr2uiPIjP7uo7o sFWACKFA7u8rdIjJTOrMOds= X-Google-Smtp-Source: AOwi7QBoqeq0LC8MFo/EYTVSfMTE8SkS87waQvadkGLLmZ8U8OPLd2wHPqueo3NOGy9/q0BuOkc/Pg== X-Received: by 10.237.33.203 with SMTP id m11mr5548415qtc.123.1507333890896; Fri, 06 Oct 2017 16:51:30 -0700 (PDT) Received: from yoga.lan ([181.93.89.178]) by smtp.gmail.com with ESMTPSA id g1sm1705226qta.95.2017.10.06.16.51.24 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 06 Oct 2017 16:51:30 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Markus Armbruster , Eric Blake , Paolo Bonzini Date: Fri, 6 Oct 2017 20:49:11 -0300 Message-Id: <20171006235023.11952-17-f4bug@amsat.org> X-Mailer: git-send-email 2.14.2 In-Reply-To: <20171006235023.11952-1-f4bug@amsat.org> References: <20171006235023.11952-1-f4bug@amsat.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c0d::241 Subject: [Qemu-devel] [PATCH 16/88] Main loop: use g_new() family of functions X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , qemu trival , qemu-devel@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Marc-André Lureau Signed-off-by: Marc-André Lureau Signed-off-by: Philippe Mathieu-Daudé [PMD: more uses in vl.c (fixed const char * cast), squashed cpus-common and changes in util/qemu-timer] --- include/qemu/timer.h | 2 +- cpus-common.c | 4 ++-- util/main-loop.c | 2 +- util/qemu-timer.c | 2 +- vl.c | 12 ++++++------ 5 files changed, 11 insertions(+), 11 deletions(-) diff --git a/include/qemu/timer.h b/include/qemu/timer.h index 1b518bca30..dfc028259c 100644 --- a/include/qemu/timer.h +++ b/include/qemu/timer.h @@ -518,7 +518,7 @@ static inline QEMUTimer *timer_new_tl(QEMUTimerList *timer_list, QEMUTimerCB *cb, void *opaque) { - QEMUTimer *ts = g_malloc0(sizeof(QEMUTimer)); + QEMUTimer *ts = g_new0(QEMUTimer, 1); timer_init_tl(ts, timer_list, scale, cb, opaque); return ts; } diff --git a/cpus-common.c b/cpus-common.c index 59f751ecf9..e613cc33ef 100644 --- a/cpus-common.c +++ b/cpus-common.c @@ -158,7 +158,7 @@ void async_run_on_cpu(CPUState *cpu, run_on_cpu_func func, run_on_cpu_data data) { struct qemu_work_item *wi; - wi = g_malloc0(sizeof(struct qemu_work_item)); + wi = g_new0(struct qemu_work_item, 1); wi->func = func; wi->data = data; wi->free = true; @@ -301,7 +301,7 @@ void async_safe_run_on_cpu(CPUState *cpu, run_on_cpu_func func, { struct qemu_work_item *wi; - wi = g_malloc0(sizeof(struct qemu_work_item)); + wi = g_new0(struct qemu_work_item, 1); wi->func = func; wi->data = data; wi->free = true; diff --git a/util/main-loop.c b/util/main-loop.c index 7558eb5f53..ef784bcda0 100644 --- a/util/main-loop.c +++ b/util/main-loop.c @@ -279,7 +279,7 @@ static PollingEntry *first_polling_entry; int qemu_add_polling_cb(PollingFunc *func, void *opaque) { PollingEntry **ppe, *pe; - pe = g_malloc0(sizeof(PollingEntry)); + pe = g_new0(PollingEntry, 1); pe->func = func; pe->opaque = opaque; for(ppe = &first_polling_entry; *ppe != NULL; ppe = &(*ppe)->next); diff --git a/util/qemu-timer.c b/util/qemu-timer.c index 82d56507a2..2f4e21c482 100644 --- a/util/qemu-timer.c +++ b/util/qemu-timer.c @@ -102,7 +102,7 @@ QEMUTimerList *timerlist_new(QEMUClockType type, QEMUTimerList *timer_list; QEMUClock *clock = qemu_clock_ptr(type); - timer_list = g_malloc0(sizeof(QEMUTimerList)); + timer_list = g_new0(QEMUTimerList, 1); qemu_event_init(&timer_list->timers_done_ev, true); timer_list->clock = clock; timer_list->notify_cb = cb; diff --git a/vl.c b/vl.c index 3fed457921..9f82a375b3 100644 --- a/vl.c +++ b/vl.c @@ -1416,7 +1416,7 @@ static int add_semihosting_arg(void *opaque, if (strcmp(name, "arg") == 0) { s->argc++; /* one extra element as g_strjoinv() expects NULL-terminated array */ - s->argv = g_realloc(s->argv, (s->argc + 1) * sizeof(void *)); + s->argv = g_renew(const char *, s->argv, s->argc + 1); s->argv[s->argc - 1] = val; s->argv[s->argc] = NULL; } @@ -1589,7 +1589,7 @@ MachineInfoList *qmp_query_machines(Error **errp) MachineInfoList *entry; MachineInfo *info; - info = g_malloc0(sizeof(*info)); + info = g_new0(MachineInfo, 1); if (mc->is_default) { info->has_is_default = true; info->is_default = true; @@ -1604,7 +1604,7 @@ MachineInfoList *qmp_query_machines(Error **errp) info->cpu_max = !mc->max_cpus ? 1 : mc->max_cpus; info->hotpluggable_cpus = mc->has_hotpluggable_cpus; - entry = g_malloc0(sizeof(*entry)); + entry = g_new0(MachineInfoList, 1); entry->value = info; entry->next = mach_list; mach_list = entry; @@ -1657,7 +1657,7 @@ VMChangeStateEntry *qemu_add_vm_change_state_handler(VMChangeStateHandler *cb, { VMChangeStateEntry *e; - e = g_malloc0(sizeof (*e)); + e = g_new0(VMChangeStateEntry, 1); e->cb = cb; e->opaque = opaque; @@ -2546,7 +2546,7 @@ static void add_device_config(int type, const char *cmdline) { struct device_config *conf; - conf = g_malloc0(sizeof(*conf)); + conf = g_new0(struct device_config, 1); conf->type = type; conf->cmdline = cmdline; loc_save(&conf->loc); @@ -3047,7 +3047,7 @@ static int global_init_func(void *opaque, QemuOpts *opts, Error **errp) { GlobalProperty *g; - g = g_malloc0(sizeof(*g)); + g = g_new0(GlobalProperty, 1); g->driver = qemu_opt_get(opts, "driver"); g->property = qemu_opt_get(opts, "property"); g->value = qemu_opt_get(opts, "value"); From patchwork Fri Oct 6 23:49:12 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 822782 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="Di76LoR2"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3y8681149zz9s8J for ; Sat, 7 Oct 2017 11:00:01 +1100 (AEDT) Received: from localhost ([::1]:47564 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e0cX9-0005yg-7b for incoming@patchwork.ozlabs.org; Fri, 06 Oct 2017 19:59:59 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41021) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e0cP1-0007RC-Ul for qemu-devel@nongnu.org; Fri, 06 Oct 2017 19:51:36 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e0cP0-0005A4-C7 for qemu-devel@nongnu.org; Fri, 06 Oct 2017 19:51:36 -0400 Received: from mail-qk0-x244.google.com ([2607:f8b0:400d:c09::244]:34128) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1e0cP0-00059t-7I; Fri, 06 Oct 2017 19:51:34 -0400 Received: by mail-qk0-x244.google.com with SMTP id b124so10270753qke.1; Fri, 06 Oct 2017 16:51:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=QVC3eP0uaa6JRVEUr+10A6WFP1HbkFbL6pE/vQqyJMY=; b=Di76LoR2mMsUSG0GyihqyJ6K4gYrNHJpIebaaGvFvQC9bG4mqspsG3F5MT3rFP581k f3snin8GnbHfv9ahUTtLdoQd/JFRZnK/52QEUxWHkcea5V0S6SidZKPC7pO5K3BePGwV AE6GuIua5GXX8p0pfa1QXMdckdyQyAq0y4AIV8UJg32YG/dwlRKq271mRWPUlAqii9x7 B6u0KJ77mpRP9BEtD/BtLUrtGXhSpmO+Pk/khQUjrzBgVCJDJkbHgYM+9fillPKI+ob7 7sa6nYZCRbNGkVI4T3NIo384YS+jnGbp/+5NPcz9w+35pya+UpD9Nq4UHpW+ZqknW2Ld Wd7A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=QVC3eP0uaa6JRVEUr+10A6WFP1HbkFbL6pE/vQqyJMY=; b=KIrRrwv1nAa4qov/XBzhaLOm28XOoEt0nrzx4rmn/jZ2nGVb0Pw+SZqBmifRZ2wmYa F7x3lxWdKzIfrttKa9+N6haIx3Nruq2KOKhqzCLi2F46nauyoLKeQbtFNHL1GOrCXopt Hx8b90pPWXZtbt+HJ1vn+lLqn/EwC/z1azPS9PiPBsUVjlXuWb82L7uNbnhUNgW2UAk5 0Z1OqXQgkXphXfz8R7K0p7lbslTPhSo3pP/vwfwTuP6Z/jbmJKzEvPh6hEB4IoCJbjc5 0ebqdHAd+USIerayZN4q/nX4jJgcRyPqL/eXX6zgSt0/wcPuNTatvbSour/2j1gjzbLA kpUw== X-Gm-Message-State: AMCzsaXHmyZHoxygiiZRJ4+IxDuJgwb2WTyXZYjWdjErCTbir0H/F8Yr DdfsX6+WFL0SG54OKP7OQUY= X-Google-Smtp-Source: AOwi7QBvNnrb5YoM3sbXWFeZo628QPEIiQXSgqI3bL/mwcSsykwVwMFBDIt7C0RuWPqMVjMgJ9iCgA== X-Received: by 10.55.3.133 with SMTP id 127mr791062qkd.42.1507333893705; Fri, 06 Oct 2017 16:51:33 -0700 (PDT) Received: from yoga.lan ([181.93.89.178]) by smtp.gmail.com with ESMTPSA id g1sm1705226qta.95.2017.10.06.16.51.31 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 06 Oct 2017 16:51:33 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Markus Armbruster , Eric Blake , Paolo Bonzini Date: Fri, 6 Oct 2017 20:49:12 -0300 Message-Id: <20171006235023.11952-18-f4bug@amsat.org> X-Mailer: git-send-email 2.14.2 In-Reply-To: <20171006235023.11952-1-f4bug@amsat.org> References: <20171006235023.11952-1-f4bug@amsat.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c09::244 Subject: [Qemu-devel] [PATCH 17/88] Memory API: use g_new() family of functions X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , qemu trival , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Marc-André Lureau Signed-off-by: Marc-André Lureau --- memory.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/memory.c b/memory.c index 5e6351a6c1..40d30640eb 100644 --- a/memory.c +++ b/memory.c @@ -2762,7 +2762,7 @@ void memory_region_invalidate_mmio_ptr(MemoryRegion *mr, hwaddr offset, } if (!invalidate_data) { - invalidate_data = g_malloc0(sizeof(MMIOPtrInvalidate)); + invalidate_data = g_new0(MMIOPtrInvalidate, 1); invalidate_data->allocated = 1; } From patchwork Fri Oct 6 23:49:13 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 822785 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="K+jukSII"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3y86C82YMPz9t3R for ; Sat, 7 Oct 2017 11:02:44 +1100 (AEDT) Received: from localhost ([::1]:47583 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e0cZm-0008Q5-DD for incoming@patchwork.ozlabs.org; Fri, 06 Oct 2017 20:02:42 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41059) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e0cP4-0007TL-8l for qemu-devel@nongnu.org; Fri, 06 Oct 2017 19:51:39 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e0cP3-0005BZ-Hr for qemu-devel@nongnu.org; Fri, 06 Oct 2017 19:51:38 -0400 Received: from mail-qk0-x241.google.com ([2607:f8b0:400d:c09::241]:37975) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1e0cP3-0005BQ-Df; Fri, 06 Oct 2017 19:51:37 -0400 Received: by mail-qk0-x241.google.com with SMTP id 17so5917540qkq.5; Fri, 06 Oct 2017 16:51:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=ghZP7L4yP7uTN13RiHneifNe/t4pi72rDTbu8R7L+tk=; b=K+jukSIIqb36dgQPsgC5uze6ooJbH9/Y4tT3xaV2AkqWgzTtFSbHnejwzL8SmHHmpo ADWg+M7uBAy9MHuhe5CbFE6dkCHzPoj8vj5POtgfmxbRMkC19TIglrE5L2L53fpJXo6i 5llrd8a7SCSUUfZP0cyBASg+LnmJ0yJ0FHupZYbblA5ZSt+YdJyXoa6AHBB62Lnd/B4s GkekQk4SjRgKnQwDif7C7dQOuhpx4sxPgrrql3pnojLGtjFQUIm6mhtwrek1xyjrNvFI eQuCQ1c1w4E2R+aOLMsHrgAkP0imKmBHHqAFYXuG4SQQiaT8zPPRrKRXKBLXyHxO+xqm 8ypQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=ghZP7L4yP7uTN13RiHneifNe/t4pi72rDTbu8R7L+tk=; b=SaASX1NmYt2+++NB8mh8f92UjAVgGfW8sHsFqD9JJz1EjML3Wsz+FOlN3eHSasaT47 CwLXIo0IgHhMXAubqC7XVP4Qd1PKW1vz6U/defsUvnqBAqwhx+ziJnEkm+wDd/jpLMpV xhv0NPI1osC5Vt6kSeqJbhpnUc4rpU2+kSkXg1dNLGOngHZ8qE5x7PGFva/tYrhHrbXL Air5USSlgBNlnETiLh1x7v7mSjzJQNoZkx8Almk7hRyVG8pkOp2syjzM1Isy/zPEaytQ 5wZf1MreDZy+FE+UjZ4xfn0sHLl5VUtfsx3UY840XGz+ZSrVuZNH7xyRlgRe3ACW4iwu uH0A== X-Gm-Message-State: AMCzsaVvrTru3DjvTcBPTLKFw3lOR00LIdqZuZmpQcecgw66+VmzBsKW pUMZ3UCAiXXFj50qfo43k7o= X-Google-Smtp-Source: AOwi7QCgY/0DVC4SVsgF7jvrFuGcrl8yXWbOjtsI41qm28a5MOdcjfty03Nr4ABbrJHUP6l183ngOA== X-Received: by 10.55.207.11 with SMTP id e11mr701216qkj.89.1507333896890; Fri, 06 Oct 2017 16:51:36 -0700 (PDT) Received: from yoga.lan ([181.93.89.178]) by smtp.gmail.com with ESMTPSA id g1sm1705226qta.95.2017.10.06.16.51.33 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 06 Oct 2017 16:51:36 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Markus Armbruster , Eric Blake , Paolo Bonzini , Michael Tokarev , Alex Williamson Date: Fri, 6 Oct 2017 20:49:13 -0300 Message-Id: <20171006235023.11952-19-f4bug@amsat.org> X-Mailer: git-send-email 2.14.2 In-Reply-To: <20171006235023.11952-1-f4bug@amsat.org> References: <20171006235023.11952-1-f4bug@amsat.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c09::241 Subject: [Qemu-devel] [PATCH 18/88] memory: use g_new() family of functions X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , qemu trival , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Marc-André Lureau Signed-off-by: Marc-André Lureau --- does this file belong to the Memory API subsystem in MAINTAINERS? memory_mapping.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/memory_mapping.c b/memory_mapping.c index a5d38552a6..9c78b41363 100644 --- a/memory_mapping.c +++ b/memory_mapping.c @@ -43,7 +43,7 @@ static void create_new_memory_mapping(MemoryMappingList *list, { MemoryMapping *memory_mapping; - memory_mapping = g_malloc(sizeof(MemoryMapping)); + memory_mapping = g_new(MemoryMapping, 1); memory_mapping->phys_addr = phys_addr; memory_mapping->virt_addr = virt_addr; memory_mapping->length = length; From patchwork Fri Oct 6 23:49:14 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 822786 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="vAromYtI"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3y86CN6Z1mz9t3m for ; Sat, 7 Oct 2017 11:02:56 +1100 (AEDT) Received: from localhost ([::1]:47584 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e0cZy-0000Cl-S1 for incoming@patchwork.ozlabs.org; Fri, 06 Oct 2017 20:02:54 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41147) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e0cPA-0007Zs-3B for qemu-devel@nongnu.org; Fri, 06 Oct 2017 19:51:45 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e0cP7-0005Ez-2R for qemu-devel@nongnu.org; Fri, 06 Oct 2017 19:51:44 -0400 Received: from mail-qt0-x241.google.com ([2607:f8b0:400d:c0d::241]:50908) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1e0cP6-0005Ee-U1; Fri, 06 Oct 2017 19:51:40 -0400 Received: by mail-qt0-x241.google.com with SMTP id f15so34348508qtf.7; Fri, 06 Oct 2017 16:51:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=ou5DYi2TigEtJhbKCSg64Q9IEsfjgCcfCqLZSaXAnpo=; b=vAromYtI3jDnprhua2sa/QZVahbRxSIOcSTLcLUfDI7sXq7B5AX7erIDoHwhjR2w25 cjgjOVHl0nJAOUUTo2kKshMIVMP86EqZHRRUYgnuEH9t7aQQHIM1h0YormHseIcO3nRG RvTaZPwoYPDcgBbgB1f8pnjH3XZVWXVz6J9z3bA8C/H//ClnMgEMkLqT+yjTTaPCWD4a 0r1f59M448q8ayMZf9+qGO1yKjxkW9jm9w1xbVbaTnvWmoPzcYgvehFuJKczRjzbTXFB T6idFuaSagcfsv1svYgDNNnDrPWAkLDOt/UVqtBgYzHViTupCNc3zLQ812+gfiCH07Az 3QQQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=ou5DYi2TigEtJhbKCSg64Q9IEsfjgCcfCqLZSaXAnpo=; b=GAWWG7l4w5BzoQzQt4Byv3e51yMeNh2LZG1/IMmLs9K7QmvHHJPbfujlAnMFoQwKUF dKyzkBF5CPkUTzzwKS+c5n8LO4DwH+LqGRVSe7Oj/htK214kO92IIGrBnJQ0Rs+QWPo1 3IW5xRwjVDCCsWgxSB5JP9dp79TZX7U0XYJQ5zn1WQc/5eybT7NtR7chS5tpY9QOEt7N oJbQWFWNSZz17P50Cy/8OBYZGu//6puFwreGuHqxjnBArkiqAMznhEdrkhJ3eJD3Rh3b nZCzLzzpCsPWiNfL7CnV3s9+x39JjbfaJdvsRig1Gbbzp+pDmX3s0J5ChbH1sD6ney1n iH2g== X-Gm-Message-State: AMCzsaUjZmqK66u/seT5rga2gsRLArUB4GH0YzQ5mF0ZST0lWZAJUkFE 9DBfJBVVdIa3RwDOrhZafik1tj4Q X-Google-Smtp-Source: AOwi7QBhVJFTfQjmbhtAjMx5x/gYQoWY4eRtcMxq7oaIrakKwg75nq9+kTqreFySW21geDWBTVWv4Q== X-Received: by 10.200.52.56 with SMTP id u53mr5494951qtb.16.1507333900415; Fri, 06 Oct 2017 16:51:40 -0700 (PDT) Received: from yoga.lan ([181.93.89.178]) by smtp.gmail.com with ESMTPSA id g1sm1705226qta.95.2017.10.06.16.51.37 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 06 Oct 2017 16:51:39 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Markus Armbruster , Eric Blake , Paolo Bonzini , Peter Crosthwaite , Richard Henderson Date: Fri, 6 Oct 2017 20:49:14 -0300 Message-Id: <20171006235023.11952-20-f4bug@amsat.org> X-Mailer: git-send-email 2.14.2 In-Reply-To: <20171006235023.11952-1-f4bug@amsat.org> References: <20171006235023.11952-1-f4bug@amsat.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c0d::241 Subject: [Qemu-devel] [PATCH 19/88] exec: use g_new() family of functions X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , qemu trival , =?utf-8?q?Philippe_Mathieu-Dau?= =?utf-8?b?ZMOp?= , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Philippe Mathieu-Daudé --- exec.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/exec.c b/exec.c index 7a80460725..e060c6fea7 100644 --- a/exec.c +++ b/exec.c @@ -836,7 +836,7 @@ int cpu_watchpoint_insert(CPUState *cpu, vaddr addr, vaddr len, VADDR_PRIx ", len=%" VADDR_PRIu, addr, len); return -EINVAL; } - wp = g_malloc(sizeof(*wp)); + wp = g_new(CPUWatchpoint, 1); wp->vaddr = addr; wp->len = len; @@ -922,7 +922,7 @@ int cpu_breakpoint_insert(CPUState *cpu, vaddr pc, int flags, { CPUBreakpoint *bp; - bp = g_malloc(sizeof(*bp)); + bp = g_new(CPUBreakpoint, 1); bp->pc = pc; bp->flags = flags; @@ -1975,7 +1975,7 @@ RAMBlock *qemu_ram_alloc_from_fd(ram_addr_t size, MemoryRegion *mr, return NULL; } - new_block = g_malloc0(sizeof(*new_block)); + new_block = g_new0(RAMBlock, 1); new_block->mr = mr; new_block->used_length = size; new_block->max_length = size; @@ -2036,7 +2036,7 @@ RAMBlock *qemu_ram_alloc_internal(ram_addr_t size, ram_addr_t max_size, size = HOST_PAGE_ALIGN(size); max_size = HOST_PAGE_ALIGN(max_size); - new_block = g_malloc0(sizeof(*new_block)); + new_block = g_new0(RAMBlock, 1); new_block->mr = mr; new_block->resized = resized; new_block->used_length = size; From patchwork Fri Oct 6 23:49:15 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 822792 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="Ns7CmFA2"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3y86KR3j0sz9t3R for ; Sat, 7 Oct 2017 11:08:11 +1100 (AEDT) Received: from localhost ([::1]:47613 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e0cf3-0004dn-Gs for incoming@patchwork.ozlabs.org; Fri, 06 Oct 2017 20:08:09 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41158) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e0cPB-0007at-3x for qemu-devel@nongnu.org; Fri, 06 Oct 2017 19:51:46 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e0cPA-0005IM-AF for qemu-devel@nongnu.org; Fri, 06 Oct 2017 19:51:45 -0400 Received: from mail-qt0-x244.google.com ([2607:f8b0:400d:c0d::244]:45324) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1e0cPA-0005Hh-6N; Fri, 06 Oct 2017 19:51:44 -0400 Received: by mail-qt0-x244.google.com with SMTP id k1so23349898qti.2; Fri, 06 Oct 2017 16:51:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=NgvAa6l3iSRe7nWQKXdR6AHzYz65ulegWQHIqncCGYI=; b=Ns7CmFA2ZcdVdvfMmu/bwvd3czvRmTEX35TRM/cgBFz0+Lh1tQsOatHTJSveyWH0G0 bpmPk9sG8vah5NfCNeAtcVqOl9ZCUERHPeYjXRtTZZ6xJUzhckWyGtp3OstNttAqQYt0 M7aWmimAd4BazmykzRkwNvFu5TaiUzxHeLcnTztYqpCKg2cnthqlICu4kVUip+SyEGLV 36rN9ff4xZ4optZeRYj4cwLsoq1kWLUbNn8tcLnZG6MBvck26xOa/dktmBP/qog7pgDL oCrJDI0/YlzPA4FBRstPzLQ1h0KFfB+0Y/M4VwNf7Xe2V7IN8HvVk4jW0qelJ1W4N2hL olmA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=NgvAa6l3iSRe7nWQKXdR6AHzYz65ulegWQHIqncCGYI=; b=WnRMBrczDnq51/tui71+/RNsbwWWHhha8XRZWiELG4d9o6PtucbUi8pIJXmw8e7RWe Ue01iUia//Gnq4IvZ253qO9f6+x5VCMea2GndLsZqbAwyMgDrbu4XdNbRZV37La9n8m5 IVKHuGrAikSy0e4rKCv7U3Vq27Liym+w3RjQg+4TNt//K+kTXUzhP+Ku+y/WXzjgO9a6 aDlWQ7B5OYPolbvu1Wty/xXyS++hdbHDgYNw9rUhb5J06h5m+p9JxC92bbExKR6kqCFZ DVMgYCVAAnyy5o/w0EwDI6ZP2oKs7h/oav6BmVPgnW2hKJke6cbwpO/peoYcA9NYaEFU w87w== X-Gm-Message-State: AMCzsaX+b84iIpm9jh54uZJz4t/ZHAScGBpVCOxH8XYQ5n7rHpos7pAu yQ9nAE5DkE1f6W1R0fbg8tU= X-Google-Smtp-Source: AOwi7QCAwrfvOUTPyvezx7kF7u/r7h45kzbcFOCHftAxNihNMKHqTSs1h6XfUpKl+I8UkGS7tKTFgQ== X-Received: by 10.237.60.101 with SMTP id u34mr5150473qte.153.1507333903630; Fri, 06 Oct 2017 16:51:43 -0700 (PDT) Received: from yoga.lan ([181.93.89.178]) by smtp.gmail.com with ESMTPSA id g1sm1705226qta.95.2017.10.06.16.51.40 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 06 Oct 2017 16:51:43 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Markus Armbruster , Eric Blake , Juan Quintela , "Dr. David Alan Gilbert" Date: Fri, 6 Oct 2017 20:49:15 -0300 Message-Id: <20171006235023.11952-21-f4bug@amsat.org> X-Mailer: git-send-email 2.14.2 In-Reply-To: <20171006235023.11952-1-f4bug@amsat.org> References: <20171006235023.11952-1-f4bug@amsat.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c0d::244 Subject: [Qemu-devel] [PATCH 20/88] Migration: use g_new() family of functions X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , qemu trival , qemu-devel@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Marc-André Lureau Signed-off-by: Marc-André Lureau Signed-off-by: Philippe Mathieu-Daudé [PMD: indented, added migration/migration.c and migration/page_cache.c] Reviewed-by: Juan Quintela --- migration/migration.c | 2 +- migration/page_cache.c | 2 +- migration/postcopy-ram.c | 2 +- migration/ram.c | 3 +-- 4 files changed, 4 insertions(+), 5 deletions(-) diff --git a/migration/migration.c b/migration/migration.c index 98429dc843..4899182b32 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -485,7 +485,7 @@ MigrationParameters *qmp_query_migrate_parameters(Error **errp) MigrationState *s = migrate_get_current(); /* TODO use QAPI_CLONE() instead of duplicating it inline */ - params = g_malloc0(sizeof(*params)); + params = g_new0(MigrationParameters, 1); params->has_compress_level = true; params->compress_level = s->parameters.compress_level; params->has_compress_threads = true; diff --git a/migration/page_cache.c b/migration/page_cache.c index ba984c4858..30169a1dd3 100644 --- a/migration/page_cache.c +++ b/migration/page_cache.c @@ -57,7 +57,7 @@ PageCache *cache_init(int64_t num_pages, unsigned int page_size) } /* We prefer not to abort if there is no memory */ - cache = g_try_malloc(sizeof(*cache)); + cache = g_try_new(PageCache, 1); if (!cache) { DPRINTF("Failed to allocate cache\n"); return NULL; diff --git a/migration/postcopy-ram.c b/migration/postcopy-ram.c index 0de68e8b25..d51684ce30 100644 --- a/migration/postcopy-ram.c +++ b/migration/postcopy-ram.c @@ -811,7 +811,7 @@ void *postcopy_get_tmp_page(MigrationIncomingState *mis) PostcopyDiscardState *postcopy_discard_send_init(MigrationState *ms, const char *name) { - PostcopyDiscardState *res = g_malloc0(sizeof(PostcopyDiscardState)); + PostcopyDiscardState *res = g_new0(PostcopyDiscardState, 1); if (res) { res->ramblock_name = name; diff --git a/migration/ram.c b/migration/ram.c index b83f8977c5..3f5407ee43 100644 --- a/migration/ram.c +++ b/migration/ram.c @@ -1376,8 +1376,7 @@ int ram_save_queue_pages(const char *rbname, ram_addr_t start, ram_addr_t len) goto err; } - struct RAMSrcPageRequest *new_entry = - g_malloc0(sizeof(struct RAMSrcPageRequest)); + struct RAMSrcPageRequest *new_entry = g_new0(struct RAMSrcPageRequest, 1); new_entry->rb = ramblock; new_entry->offset = start; new_entry->len = len; From patchwork Fri Oct 6 23:49:16 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 822796 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="V2NZfTuS"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3y86Nn6KpKz9t3R for ; Sat, 7 Oct 2017 11:11:05 +1100 (AEDT) Received: from localhost ([::1]:47627 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e0chr-00079t-Rw for incoming@patchwork.ozlabs.org; Fri, 06 Oct 2017 20:11:03 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41218) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e0cPE-0007h6-Ao for qemu-devel@nongnu.org; Fri, 06 Oct 2017 19:51:49 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e0cPD-0005Kh-2A for qemu-devel@nongnu.org; Fri, 06 Oct 2017 19:51:48 -0400 Received: from mail-qt0-x242.google.com ([2607:f8b0:400d:c0d::242]:49203) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1e0cPC-0005KP-Ua; Fri, 06 Oct 2017 19:51:46 -0400 Received: by mail-qt0-x242.google.com with SMTP id o3so34344958qte.6; Fri, 06 Oct 2017 16:51:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=TSOIb6UWglCUSbOLZ6JOHx7L9Tkf9d3xpqZyVUtFJEU=; b=V2NZfTuS7DgggavRXy9usI8jU3rN7O2Q9GPdN2WBsGOermcCI0ZAMcHapngQZCQ5fq ofvDjZ5c/UJnuMTP6Xy9I9Yo/miW9EG5CtrftfNUIaE7yNwIaLsK7WFZ/Iwy8KBm4gM2 5wXRzu0j9OfAaWhYltou7C+w1kYSOu4YywYlrmK25sdAU1OgENSJP759HipXIcCjIJwW gQ6J8IvCnyOGPawqi0wzkZL1zz4D4yv1oCqsbwcCcUxFMamITWyTFNOO9Gm0/LQTyqfe 18FHRH1hioUppaY3xSXTIq6LmEcTnVwGV0Sw8xe+KuTdUk87YNJE5/yktVwBFiOR38UW 10qg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=TSOIb6UWglCUSbOLZ6JOHx7L9Tkf9d3xpqZyVUtFJEU=; b=V00KP/XMuyA7ddNiigTP17voX5kCJiLwPteLOuwMcYTSSB03u13Vw7M3vwlyhShoAs u6NYoMUwFJ8VpuhC4ZLP5EVbZPGXu9W51RlXtudBdk1mB02EEyYOeYx9drC4oVBlo1Zv su2tKRW5cYmbtS6RnkOH1FiS/bn1NCSad2zBCVN5ACcLzQTH0KL4WVbQDEGwMW6rk3on z/xmDwu2KUMFNSeYFNJddtwW/4umutUz9x+fcb/YR8aKz8gXC4Shw9MLkBguRM6m75ND uVR2QPey9FgOsUYt7iK3fYnm8IVobTN8AS7oqMADq9ktunVtjfHEpcBzy/hCWvPLuYan K2gg== X-Gm-Message-State: AMCzsaV0Zzd2AuDoqy80dRiiz7o+i7H9NOK0TRzht4A32a0SvVXbTuwQ lNl8ouJiIU/kpQw/FOtJdwo= X-Google-Smtp-Source: AOwi7QBf6P0tD8uu9RNTw7GVPxB+TgHAcKcRCHrlPbBss9ui/XX3F5koQ7+SirrpG45XAAxk+oNEAA== X-Received: by 10.200.22.231 with SMTP id y36mr5539624qtk.31.1507333906419; Fri, 06 Oct 2017 16:51:46 -0700 (PDT) Received: from yoga.lan ([181.93.89.178]) by smtp.gmail.com with ESMTPSA id g1sm1705226qta.95.2017.10.06.16.51.43 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 06 Oct 2017 16:51:45 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Markus Armbruster , Eric Blake , Paolo Bonzini Date: Fri, 6 Oct 2017 20:49:16 -0300 Message-Id: <20171006235023.11952-22-f4bug@amsat.org> X-Mailer: git-send-email 2.14.2 In-Reply-To: <20171006235023.11952-1-f4bug@amsat.org> References: <20171006235023.11952-1-f4bug@amsat.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c0d::242 Subject: [Qemu-devel] [PATCH 21/88] NBD: use g_new() family of functions X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , qemu trival , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Marc-André Lureau Signed-off-by: Marc-André Lureau Reviewed-by: Eric Blake --- nbd/server.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nbd/server.c b/nbd/server.c index 993ade30bb..b74cc6ab7e 100644 --- a/nbd/server.c +++ b/nbd/server.c @@ -1047,7 +1047,7 @@ NBDExport *nbd_export_new(BlockDriverState *bs, off_t dev_offset, off_t size, { AioContext *ctx; BlockBackend *blk; - NBDExport *exp = g_malloc0(sizeof(NBDExport)); + NBDExport *exp = g_new0(NBDExport, 1); uint64_t perm; int ret; @@ -1539,7 +1539,7 @@ void nbd_client_new(NBDExport *exp, NBDClient *client; Coroutine *co; - client = g_malloc0(sizeof(NBDClient)); + client = g_new0(NBDClient, 1); client->refcount = 1; client->exp = exp; client->tlscreds = tlscreds; From patchwork Fri Oct 6 23:49:17 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 822789 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="AlmuPjOF"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3y86Gq6q87z9t3R for ; Sat, 7 Oct 2017 11:05:55 +1100 (AEDT) Received: from localhost ([::1]:47602 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e0ccs-0002Zc-2P for incoming@patchwork.ozlabs.org; Fri, 06 Oct 2017 20:05:54 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41296) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e0cPJ-0007ok-7O for qemu-devel@nongnu.org; Fri, 06 Oct 2017 19:51:54 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e0cPG-0005MS-5H for qemu-devel@nongnu.org; Fri, 06 Oct 2017 19:51:53 -0400 Received: from mail-qt0-x243.google.com ([2607:f8b0:400d:c0d::243]:53648) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1e0cPG-0005MB-0a; Fri, 06 Oct 2017 19:51:50 -0400 Received: by mail-qt0-x243.google.com with SMTP id n61so6362592qte.10; Fri, 06 Oct 2017 16:51:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=usQ5MEkmPgyhunH0omk3MhdAxO9MqzFxhxZlT6E4f0o=; b=AlmuPjOF5vtsybGCXsQi2pgoYObVr8Rzp4sh3RozY370HkpnMcL7tByj7J+JmIh/EZ BAS3rDn5mb03lSblZnCvPi3Kd2Dr5OUh8qqc2SSSuA/7N4VzG1/CQ7GjmAY25+37ASnF GLm2H1aDnxX/09yiz/z0bTuHSmsR+28NEsmHVhvVCO2mTEup7tm9HwIApaln6DObq9mY LvESjNjTi2HL6vWzNXXfGZ9bN/0K1T6BbwOSFVfXr45JPKX2dswSSs4fFf+nQmCj9q0u k/n+dSQqlWfydUq+8hR4Pt8/KmR+Q+uMEDuHtm73SpU4g2BmbgnrdB1HzN8orMZEG2MN bGLg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=usQ5MEkmPgyhunH0omk3MhdAxO9MqzFxhxZlT6E4f0o=; b=AKGvc6oFgWNkgjNcCrAnW+NDcdbRUecz4S727ktyDott8Yv7Z1a+/MiiGyztivhizc Ocmc/HgFJZ+2b0cT6LKKEbxiFS/5eWq/8Ul/I5sKeeKbMevdeUYcKw2xNgp2BVzxlfAc xEq2kRxYtNYIc1tdCvfTIpcF4ZBhp0KGfDt737EIxuJk6yg3kKO9U/mFbR/aAXgY+4Da R6yjt+7ON/Iyh7lSQKpeEjgu8Pi32nMfnxePiOyfKTMm07H86iRore3B0Z58F2XP9FhW uq7goicah3Bk8Q6AsFkiHhvf5EwoQvmALRp/z4eVTDNDmNGJyfegVWeXPxjaTHZna6mp xLsA== X-Gm-Message-State: AMCzsaUcJMCjsRXsD0IP7JuUm11Mg1SMf/kTWEt99Vqe1XWtduhCzRE/ KZ/raR016lgNv1HGnlC0hqxRJbRx X-Google-Smtp-Source: AOwi7QDD1I0wSaZByTram0MX2zxRzBFY9DfGb3/tlu+L2Kq+W/ngfcXrNVe/7f5G4FYOGfz7iYHR0Q== X-Received: by 10.200.37.8 with SMTP id 8mr5394698qtm.77.1507333909487; Fri, 06 Oct 2017 16:51:49 -0700 (PDT) Received: from yoga.lan ([181.93.89.178]) by smtp.gmail.com with ESMTPSA id g1sm1705226qta.95.2017.10.06.16.51.46 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 06 Oct 2017 16:51:48 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Markus Armbruster , Eric Blake , Michael Walle Date: Fri, 6 Oct 2017 20:49:17 -0300 Message-Id: <20171006235023.11952-23-f4bug@amsat.org> X-Mailer: git-send-email 2.14.2 In-Reply-To: <20171006235023.11952-1-f4bug@amsat.org> References: <20171006235023.11952-1-f4bug@amsat.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c0d::243 Subject: [Qemu-devel] [PATCH 22/88] LM32: use g_new() family of functions X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , qemu trival , qemu-devel@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Marc-André Lureau Signed-off-by: Marc-André Lureau Signed-off-by: Philippe Mathieu-Daudé [PMD: squashed milkymist] --- hw/lm32/lm32_hwsetup.h | 2 +- hw/lm32/lm32_boards.c | 4 ++-- hw/lm32/milkymist.c | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/hw/lm32/lm32_hwsetup.h b/hw/lm32/lm32_hwsetup.h index a01f6bc5df..38ade3db0e 100644 --- a/hw/lm32/lm32_hwsetup.h +++ b/hw/lm32/lm32_hwsetup.h @@ -58,7 +58,7 @@ static inline HWSetup *hwsetup_init(void) { HWSetup *hw; - hw = g_malloc(sizeof(HWSetup)); + hw = g_new(HWSetup, 1); hw->data = g_malloc0(TARGET_PAGE_SIZE); hw->ptr = hw->data; diff --git a/hw/lm32/lm32_boards.c b/hw/lm32/lm32_boards.c index b0bb3ef58a..a9c74e90d4 100644 --- a/hw/lm32/lm32_boards.c +++ b/hw/lm32/lm32_boards.c @@ -99,7 +99,7 @@ static void lm32_evr_init(MachineState *machine) int timer0_irq = 1; int timer1_irq = 3; - reset_info = g_malloc0(sizeof(ResetInfo)); + reset_info = g_new0(ResetInfo, 1); if (cpu_model == NULL) { cpu_model = "lm32-full"; @@ -196,7 +196,7 @@ static void lm32_uclinux_init(MachineState *machine) hwaddr initrd_base = 0x08400000; size_t initrd_max = 0x01000000; - reset_info = g_malloc0(sizeof(ResetInfo)); + reset_info = g_new0(ResetInfo, 1); if (cpu_model == NULL) { cpu_model = "lm32-full"; diff --git a/hw/lm32/milkymist.c b/hw/lm32/milkymist.c index 4db4d2d533..0335f0b322 100644 --- a/hw/lm32/milkymist.c +++ b/hw/lm32/milkymist.c @@ -106,7 +106,7 @@ milkymist_init(MachineState *machine) hwaddr cmdline_base = sdram_base + 0x1000000; size_t initrd_max = sdram_size - 0x1002000; - reset_info = g_malloc0(sizeof(ResetInfo)); + reset_info = g_new0(ResetInfo, 1); if (cpu_model == NULL) { cpu_model = "lm32-full"; From patchwork Fri Oct 6 23:49:18 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 822793 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="kzgRpWxT"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3y86Kw0nJnz9t3R for ; Sat, 7 Oct 2017 11:08:36 +1100 (AEDT) Received: from localhost ([::1]:47614 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e0cfS-0004xy-3J for incoming@patchwork.ozlabs.org; Fri, 06 Oct 2017 20:08:34 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41318) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e0cPK-0007rV-En for qemu-devel@nongnu.org; Fri, 06 Oct 2017 19:51:55 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e0cPJ-0005OO-Hn for qemu-devel@nongnu.org; Fri, 06 Oct 2017 19:51:54 -0400 Received: from mail-qt0-x244.google.com ([2607:f8b0:400d:c0d::244]:44688) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1e0cPJ-0005Nw-DQ; Fri, 06 Oct 2017 19:51:53 -0400 Received: by mail-qt0-x244.google.com with SMTP id v28so25500449qtv.1; Fri, 06 Oct 2017 16:51:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=7ChP/X3F7l2FIOjI9t12T0W22s/6umZOBD0cRFaavIk=; b=kzgRpWxTimwklnJxSEw6ST+/z0rzFNDw1IuryW4Xw9C6bNK9wSsaF+dWoxv9yh56SD +/H+u16CGlV7BDUuqYq3cRczcwNVdg6nw2fu0ZHfArL8rMqd+YCtzh9siaNBkX9rKxAI D8piijA3mQhH0KO5D5rPegJiQNKbLUZdZovWo4Ypc3wZCXiVK0KWTwODCDOxgT0bhYT3 R+4EeVuCwVEttVRa6Wtc4kwcg6IDLJyqvNeGi3AOsUVeG15oCWGrVamnnv3CSvgzPZ0q lejn5x/KKCC3o3+9YEZynWxTqzjE9mpAkd5zJGP5yujPxtsgy3hcrWZSCGCArjrXnMmo jO0A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=7ChP/X3F7l2FIOjI9t12T0W22s/6umZOBD0cRFaavIk=; b=HIS3/nMfCtuZ1Lxt6t+1iFi9wQbJEr30Bco1G+kK6kHBsZFkdOJpVRL/OUmTWKQrmh M/LWmQA89tcMphsfQXCQPr0GS1Rm3rv0eXLGzVHLASxOv7fBeXhIGsPCnuIyE0Gbt4l/ 16i3xQEHYm9UrNOQ4MnrVx3E3lmm90QMTRNga5TYsHMCEey1XheZuy9P/2+9sYK1Sgy2 +boeD/YlbAimvGkWFaeUnXcn8uKOrBrBHmpRzEzQND17XNAgr52nHpbZfH2839LCl0G3 JW3zVdBPEwoF/dKhO1qeSJsyaupsPaa3Q+EJveXeEjUHK1/tebdkCWJJjPkCt4g/VmSP iycQ== X-Gm-Message-State: AMCzsaVZhtiike/J5u3ly9SZ4jQkx6+9TK8P6KoziRFB6tRSht5WbhBK yCyzaSon1i2YgeMOqljkjTM= X-Google-Smtp-Source: AOwi7QB6CGTFEnMIQ5qNZv0T3XF0SIIwUFyMg+mYJstm15z2sYiU1Ho1L30SGnrpbDgZgDpu6Sz6Dg== X-Received: by 10.237.36.145 with SMTP id t17mr5204456qtc.162.1507333912865; Fri, 06 Oct 2017 16:51:52 -0700 (PDT) Received: from yoga.lan ([181.93.89.178]) by smtp.gmail.com with ESMTPSA id g1sm1705226qta.95.2017.10.06.16.51.49 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 06 Oct 2017 16:51:52 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Markus Armbruster , Eric Blake , Thomas Huth Date: Fri, 6 Oct 2017 20:49:18 -0300 Message-Id: <20171006235023.11952-24-f4bug@amsat.org> X-Mailer: git-send-email 2.14.2 In-Reply-To: <20171006235023.11952-1-f4bug@amsat.org> References: <20171006235023.11952-1-f4bug@amsat.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c0d::244 Subject: [Qemu-devel] [PATCH 23/88] M68K: use g_new() family of functions X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , qemu trival , qemu-devel@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Marc-André Lureau Signed-off-by: Marc-André Lureau Signed-off-by: Philippe Mathieu-Daudé [PMD: squashed commits] Reviewed-by: Thomas Huth --- hw/m68k/mcf5206.c | 4 ++-- hw/m68k/mcf5208.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/hw/m68k/mcf5206.c b/hw/m68k/mcf5206.c index b81901fdfd..df45e99547 100644 --- a/hw/m68k/mcf5206.c +++ b/hw/m68k/mcf5206.c @@ -137,7 +137,7 @@ static m5206_timer_state *m5206_timer_init(qemu_irq irq) m5206_timer_state *s; QEMUBH *bh; - s = (m5206_timer_state *)g_malloc0(sizeof(m5206_timer_state)); + s = g_new0(m5206_timer_state, 1); bh = qemu_bh_new(m5206_timer_trigger, s); s->timer = ptimer_init(bh, PTIMER_POLICY_DEFAULT); s->irq = irq; @@ -533,7 +533,7 @@ qemu_irq *mcf5206_init(MemoryRegion *sysmem, uint32_t base, M68kCPU *cpu) m5206_mbar_state *s; qemu_irq *pic; - s = (m5206_mbar_state *)g_malloc0(sizeof(m5206_mbar_state)); + s = g_new0(m5206_mbar_state, 1); memory_region_init_io(&s->iomem, NULL, &m5206_mbar_ops, s, "mbar", 0x00001000); diff --git a/hw/m68k/mcf5208.c b/hw/m68k/mcf5208.c index b9dde75106..9b93af5fbd 100644 --- a/hw/m68k/mcf5208.c +++ b/hw/m68k/mcf5208.c @@ -183,7 +183,7 @@ static void mcf5208_sys_init(MemoryRegion *address_space, qemu_irq *pic) memory_region_add_subregion(address_space, 0xfc0a8000, iomem); /* Timers. */ for (i = 0; i < 2; i++) { - s = (m5208_timer_state *)g_malloc0(sizeof(m5208_timer_state)); + s = g_new0(m5208_timer_state, 1); bh = qemu_bh_new(m5208_timer_trigger, s); s->timer = ptimer_init(bh, PTIMER_POLICY_DEFAULT); memory_region_init_io(&s->iomem, NULL, &m5208_timer_ops, s, From patchwork Fri Oct 6 23:49:19 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 822798 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="uOKH/QZJ"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3y86PD3zMyz9t3R for ; Sat, 7 Oct 2017 11:11:28 +1100 (AEDT) Received: from localhost ([::1]:47630 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e0ciE-0007T9-I6 for incoming@patchwork.ozlabs.org; Fri, 06 Oct 2017 20:11:26 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41372) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e0cPN-0007we-Rf for qemu-devel@nongnu.org; Fri, 06 Oct 2017 19:51:58 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e0cPM-0005Rq-SY for qemu-devel@nongnu.org; Fri, 06 Oct 2017 19:51:57 -0400 Received: from mail-qt0-x243.google.com ([2607:f8b0:400d:c0d::243]:46781) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1e0cPM-0005R9-N4; Fri, 06 Oct 2017 19:51:56 -0400 Received: by mail-qt0-x243.google.com with SMTP id 6so25228654qtw.3; Fri, 06 Oct 2017 16:51:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=IlupekmdMehNOyZOIzX0vzWTT9G633om1/4fAaAqlmM=; b=uOKH/QZJq/J6RSKgm8Lqe0yt+HzaOHbdTSBvt7wNPyIXuNemh1Yx5jEtWnlWxY/L94 Eb+2jeMuDxLEQxw02vIm7l9x8xSETxWXO7FSxnSediYg4j2GMyWP7YYQ26kFalPILqzh q2U5wfpos/S301p5q6n6h+c5fro+fiR6DqILwqrBEUnAyS0+YywoTwqZOJDyoHMh01Hg 5xPB5CZHDn/rMt7Lwg9/qlqhh3lsA7lSKD9zVb4Af1P0A2vc2S0VRUMC/d9Lg9qh/UpS EbWeoJjdrO1wOApLWWS0AcTZKNh4CVdW+xAIj02SAJcbZMCe+zxJSgkVHT8O90Rr1IHC NyOA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=IlupekmdMehNOyZOIzX0vzWTT9G633om1/4fAaAqlmM=; b=AgBHuNN3zuldn+NSrkLWWNtwOuyumJRp6OPeEBwJIatP3p1BnBolKyxjCLTIZc48Ln PR003uptL/HagHyq3TaGTkCjMFBgIGxAQhPcF82FnonAnmR8im0FaRz1ycTnweIGpO7m gp12F+eNQer3KQ90omIV7Suq3Eg4Maa5uZNDxZYsz3nu9jWxHF+2lY7S0LibOJs5sYvl 8QfEfbVNOs+cDCii05nvUFplkn4vbnhbmp/EwLvmMGE6xs/dXVgjx0k9vJfbU509s/Jg xjqZXv42zR2fHtw2kro1f6M8OlHm6P3wytZ8hnmIerOFA+SMowy3om77PJ1AkxnQ2kkJ VyFA== X-Gm-Message-State: AMCzsaW1KSaMkKf5dl8CDL1Mvktv3dn3zQWpIAU7lDqEiJ3XEoXG06sC hIIWNK8YO+4APqtr4uqvLmZVMKPmRUE= X-Google-Smtp-Source: AOwi7QAvMRVKrOttmg6j0znLi98J2BlYZY4Qf/NWjzk0LMsDNvGcOvd6dE73Xbxu411mdjhkck7f3w== X-Received: by 10.200.33.235 with SMTP id 40mr5325636qtz.185.1507333916173; Fri, 06 Oct 2017 16:51:56 -0700 (PDT) Received: from yoga.lan ([181.93.89.178]) by smtp.gmail.com with ESMTPSA id g1sm1705226qta.95.2017.10.06.16.51.53 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 06 Oct 2017 16:51:55 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Markus Armbruster , Eric Blake , Aurelien Jarno , Yongbok Kim Date: Fri, 6 Oct 2017 20:49:19 -0300 Message-Id: <20171006235023.11952-25-f4bug@amsat.org> X-Mailer: git-send-email 2.14.2 In-Reply-To: <20171006235023.11952-1-f4bug@amsat.org> References: <20171006235023.11952-1-f4bug@amsat.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c0d::243 Subject: [Qemu-devel] [PATCH 24/88] MIPS: use g_new() family of functions X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , qemu trival , qemu-devel@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Marc-André Lureau Signed-off-by: Marc-André Lureau Signed-off-by: Philippe Mathieu-Daudé [PMD: squashed malta + mipssim + r4k] --- hw/mips/mips_malta.c | 2 +- hw/mips/mips_mipssim.c | 2 +- hw/mips/mips_r4k.c | 2 +- target/mips/translate_init.c | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/hw/mips/mips_malta.c b/hw/mips/mips_malta.c index 2adb9bcf89..0eda20e120 100644 --- a/hw/mips/mips_malta.c +++ b/hw/mips/mips_malta.c @@ -555,7 +555,7 @@ static MaltaFPGAState *malta_fpga_init(MemoryRegion *address_space, MaltaFPGAState *s; Chardev *chr; - s = (MaltaFPGAState *)g_malloc0(sizeof(MaltaFPGAState)); + s = g_new0(MaltaFPGAState, 1); memory_region_init_io(&s->iomem, NULL, &malta_fpga_ops, s, "malta-fpga", 0x100000); diff --git a/hw/mips/mips_mipssim.c b/hw/mips/mips_mipssim.c index a092072e2a..b2696faba1 100644 --- a/hw/mips/mips_mipssim.c +++ b/hw/mips/mips_mipssim.c @@ -166,7 +166,7 @@ mips_mipssim_init(MachineState *machine) cpu = MIPS_CPU(cpu_generic_init(TYPE_MIPS_CPU, cpu_model)); env = &cpu->env; - reset_info = g_malloc0(sizeof(ResetData)); + reset_info = g_new0(ResetData, 1); reset_info->cpu = cpu; reset_info->vector = env->active_tc.PC; qemu_register_reset(main_cpu_reset, reset_info); diff --git a/hw/mips/mips_r4k.c b/hw/mips/mips_r4k.c index 1272d4ef9d..233455d6e7 100644 --- a/hw/mips/mips_r4k.c +++ b/hw/mips/mips_r4k.c @@ -196,7 +196,7 @@ void mips_r4k_init(MachineState *machine) cpu = MIPS_CPU(cpu_generic_init(TYPE_MIPS_CPU, cpu_model)); env = &cpu->env; - reset_info = g_malloc0(sizeof(ResetData)); + reset_info = g_new0(ResetData, 1); reset_info->cpu = cpu; reset_info->vector = env->active_tc.PC; qemu_register_reset(main_cpu_reset, reset_info); diff --git a/target/mips/translate_init.c b/target/mips/translate_init.c index 8bbded46c4..9778776677 100644 --- a/target/mips/translate_init.c +++ b/target/mips/translate_init.c @@ -806,7 +806,7 @@ static void mmu_init (CPUMIPSState *env, const mips_def_t *def) { MIPSCPU *cpu = mips_env_get_cpu(env); - env->tlb = g_malloc0(sizeof(CPUMIPSTLBContext)); + env->tlb = g_new0(CPUMIPSTLBContext, 1); switch (def->mmu_type) { case MMU_TYPE_NONE: @@ -839,7 +839,7 @@ static void fpu_init (CPUMIPSState *env, const mips_def_t *def) static void mvp_init (CPUMIPSState *env, const mips_def_t *def) { - env->mvp = g_malloc0(sizeof(CPUMIPSMVPContext)); + env->mvp = g_new0(CPUMIPSMVPContext, 1); /* MVPConf1 implemented, TLB sharable, no gating storage support, programmable cache partitioning implemented, number of allocatable From patchwork Fri Oct 6 23:49:20 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 822790 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="qOopt5fe"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3y86H51kGrz9t3m for ; Sat, 7 Oct 2017 11:06:09 +1100 (AEDT) Received: from localhost ([::1]:47603 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e0cd5-0002ms-8Z for incoming@patchwork.ozlabs.org; Fri, 06 Oct 2017 20:06:07 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41417) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e0cPT-00081H-7M for qemu-devel@nongnu.org; Fri, 06 Oct 2017 19:52:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e0cPQ-0005VL-4Q for qemu-devel@nongnu.org; Fri, 06 Oct 2017 19:52:03 -0400 Received: from mail-qt0-x244.google.com ([2607:f8b0:400d:c0d::244]:56433) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1e0cPP-0005Uz-Vr; Fri, 06 Oct 2017 19:52:00 -0400 Received: by mail-qt0-x244.google.com with SMTP id 34so17237217qtb.13; Fri, 06 Oct 2017 16:51:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=xIkpRsC3b3p6qItOzQoh1KWmSKmw09Nf7M6G00siPI8=; b=qOopt5febR6cfxzeB3z6r+0hwtAKmrVlHEmWy4s0dfrj76znGjh7x9+6qSSwpFG3Eg fGW0wm4lcmGY6wL9oEzm27NbrTIWf1JBMjNZ2It6wkZXHgA36uRauc4n9W5XTZppy0d+ Vb5Z1qh/GncWckYmV1Pp5+jhwwWBz573FBsUgPzxlwjYQCL8S60h3YXSzT3I7FNMdDyR 2JWkd85Xk3+uLB1XUIcy46P4jgjwa1gggDYjStQcz2ByZw1qoZ3RUlOzPZKBBxb+meW0 IYlqW4F31BOUeWekppn7H2s/Z03fw9aP6QZCCwHKxP7PVwvt974IpjiIXgNFJECNxNO1 eAQw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=xIkpRsC3b3p6qItOzQoh1KWmSKmw09Nf7M6G00siPI8=; b=s9A//neN3xSvqip4b72Nj6j/CCPmcTsFE75NEac3rSXcizrE4R9T80GtLIABOMZAax 7u9dhwyldUevc7nj0y62DAmQ1hWNW1Z7hepa/Dp+d+W0FjNMyoUm+uVnwcYONI1eh0yD AK70l+zdgBGR7qWu7WBU+kQe7F7VZGRML2ldRfhSB6OOewUXcksNN4E3qtQr6Va+M/vh H2X+UrXsmP9Hje/5wEcjdDfLTHczZQrI1vahf3R4vSnMHd/6KuJZTavNp1Hmp/dBPOGj vzpCq3DgSa+iAERiW0u7KcrmPD96ktZE0Hfgw7ay4hrB7K2/4ImSSvNN4esosBd83lne z+Sg== X-Gm-Message-State: AMCzsaXrIZWyhYcRRwtZICJFrF4zUlzBmNHaIVE0DRcntMjHXC5gI1H+ xnsieoS1fe+eJSNf7SeuOBU= X-Google-Smtp-Source: AOwi7QBJJ3HvzwKXT+LSBpjW5WBUWMYvpw8bATzhHmM3z+NkDITZy0ATP3yLkthZxxs9Vi08HPbSIw== X-Received: by 10.200.39.205 with SMTP id x13mr5238190qtx.287.1507333919461; Fri, 06 Oct 2017 16:51:59 -0700 (PDT) Received: from yoga.lan ([181.93.89.178]) by smtp.gmail.com with ESMTPSA id g1sm1705226qta.95.2017.10.06.16.51.56 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 06 Oct 2017 16:51:58 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Markus Armbruster , Eric Blake , Jia Liu , Stafford Horne Date: Fri, 6 Oct 2017 20:49:20 -0300 Message-Id: <20171006235023.11952-26-f4bug@amsat.org> X-Mailer: git-send-email 2.14.2 In-Reply-To: <20171006235023.11952-1-f4bug@amsat.org> References: <20171006235023.11952-1-f4bug@amsat.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c0d::244 Subject: [Qemu-devel] [PATCH 25/88] OpenRISC: use g_new() family of functions X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , qemu trival , qemu-devel@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Marc-André Lureau Signed-off-by: Marc-André Lureau Signed-off-by: Philippe Mathieu-Daudé [PMD: squashed openrisc_sim.c] Acked-by: Stafford Horne --- hw/openrisc/openrisc_sim.c | 2 +- target/openrisc/mmu.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/openrisc/openrisc_sim.c b/hw/openrisc/openrisc_sim.c index 86bf2849c4..1eb381549c 100644 --- a/hw/openrisc/openrisc_sim.c +++ b/hw/openrisc/openrisc_sim.c @@ -114,7 +114,7 @@ static void openrisc_sim_init(MachineState *machine) main_cpu_reset(cpu); } - ram = g_malloc(sizeof(*ram)); + ram = g_new(MemoryRegion, 1); memory_region_init_ram(ram, NULL, "openrisc.ram", ram_size, &error_fatal); memory_region_add_subregion(get_system_memory(), 0, ram); diff --git a/target/openrisc/mmu.c b/target/openrisc/mmu.c index ce2a29dd1a..4789a35b67 100644 --- a/target/openrisc/mmu.c +++ b/target/openrisc/mmu.c @@ -247,7 +247,7 @@ hwaddr openrisc_cpu_get_phys_page_debug(CPUState *cs, vaddr addr) void cpu_openrisc_mmu_init(OpenRISCCPU *cpu) { - cpu->env.tlb = g_malloc0(sizeof(CPUOpenRISCTLBContext)); + cpu->env.tlb = g_new0(CPUOpenRISCTLBContext, 1); cpu->env.tlb->cpu_openrisc_map_address_code = &cpu_openrisc_get_phys_nommu; cpu->env.tlb->cpu_openrisc_map_address_data = &cpu_openrisc_get_phys_nommu; From patchwork Fri Oct 6 23:49:21 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 822794 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="gWIALCC5"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3y86L80dNHz9t3t for ; Sat, 7 Oct 2017 11:08:48 +1100 (AEDT) Received: from localhost ([::1]:47615 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e0cfe-00059h-4s for incoming@patchwork.ozlabs.org; Fri, 06 Oct 2017 20:08:46 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41451) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e0cPV-00083F-DF for qemu-devel@nongnu.org; Fri, 06 Oct 2017 19:52:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e0cPU-0005aE-5h for qemu-devel@nongnu.org; Fri, 06 Oct 2017 19:52:05 -0400 Received: from mail-qt0-x243.google.com ([2607:f8b0:400d:c0d::243]:56002) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1e0cPU-0005a7-0g; Fri, 06 Oct 2017 19:52:04 -0400 Received: by mail-qt0-x243.google.com with SMTP id x54so34275627qth.12; Fri, 06 Oct 2017 16:52:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=zfbpJ4ayrIcxqNafJhnmF66HmGbvKJkRDV+xKWxI+YU=; b=gWIALCC5+UCjG38R6wSfE1mEsBlu5tkxxBUjIZ7iEKmt3B9mwg/M3o0WW4Vy/g6pIc 4RfCyb+c+6iLqdh/RfqoWr7MAS1AT756Jz5t0TxRJeyBpf8ojsRJKUCJbssXVF7cPlGC 4yGRdBfA/TchjAOoCVunajQcCgwjnQdFDy2HntoejVtbdF9BkYyuwO738B5ipL7gcSkE Rp3R9hidRJsg8oecdqcge6SX+Tf5L6kQN9yYzdc8HNMhqmwDG48q24LfcQGXACSJtTFU QH33WoJ69seUYCd63j4Ak3G7Wb/fy9yK7bKnSCrOwLERW/7fKWIbe9cKzqHvS0Xvjf19 OTaw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=zfbpJ4ayrIcxqNafJhnmF66HmGbvKJkRDV+xKWxI+YU=; b=D1cGhqHLkZcCH1+yveq2jhH56lfphqqXz71JPHbMk2g/1e0BBktc/oRs0ZeBYp3Ikx 2ggF4Qe0sg+Bh42biahD4pCffiupUfI806g8iAQHQXpeTaRMi93qVUap2EngnLqDbmlu bGoNOtjAAU17KDt7UR3ok9rU/Up3kRPKDpmpMAkE85xUjAeUUiriKK7uCjhtWihpB28V rLDocIfLg8JHnG7fZZ1r+tTviQEi9yekZ6ZoJ1EcjKZ6chdfvm5vOs9HadQnbdxLOqK0 CfyH6SL+56DI55IDJjxB2KbqvUdk3Ixy57xkFbsKkYuYXMNkNroItVHfEdVBepuDp7lE vbTQ== X-Gm-Message-State: AMCzsaUhrynwHbkxW22RKacMP0IEd5chcnlTvBHJ39cAVhWGRdaPXOXR 6KbnsLa7cF6IQy1ngy/yKrs= X-Google-Smtp-Source: AOwi7QD1Syqy2xWvMGxxNvLdDS5QS5CLfD6byDyXWJx4pMG1QOxclV505NLQ579adRPEOabSxixyVg== X-Received: by 10.237.36.125 with SMTP id s58mr5557076qtc.24.1507333923366; Fri, 06 Oct 2017 16:52:03 -0700 (PDT) Received: from yoga.lan ([181.93.89.178]) by smtp.gmail.com with ESMTPSA id g1sm1705226qta.95.2017.10.06.16.51.59 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 06 Oct 2017 16:52:02 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Markus Armbruster , Eric Blake , Cornelia Huck , Christian Borntraeger , Alexander Graf , Richard Henderson Date: Fri, 6 Oct 2017 20:49:21 -0300 Message-Id: <20171006235023.11952-27-f4bug@amsat.org> X-Mailer: git-send-email 2.14.2 In-Reply-To: <20171006235023.11952-1-f4bug@amsat.org> References: <20171006235023.11952-1-f4bug@amsat.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c0d::243 Subject: [Qemu-devel] [PATCH 26/88] S390: use g_new() family of functions X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , qemu trival , qemu-devel@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , qemu-s390x@nongnu.org, =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Marc-André Lureau Signed-off-by: Marc-André Lureau Signed-off-by: Philippe Mathieu-Daudé [PMD: more changes in hw/s390x/css.c, added target/s390x/cpu_models.c] Acked-by: Cornelia Huck --- hw/s390x/css.c | 10 +++++----- hw/s390x/s390-pci-bus.c | 4 ++-- target/s390x/cpu_models.c | 12 ++++++------ target/s390x/diag.c | 2 +- 4 files changed, 14 insertions(+), 14 deletions(-) diff --git a/hw/s390x/css.c b/hw/s390x/css.c index 35683d7954..b6d4fcaf06 100644 --- a/hw/s390x/css.c +++ b/hw/s390x/css.c @@ -488,7 +488,7 @@ int css_create_css_image(uint8_t cssid, bool default_image) if (channel_subsys.css[cssid]) { return -EBUSY; } - channel_subsys.css[cssid] = g_malloc0(sizeof(CssImage)); + channel_subsys.css[cssid] = g_new0(CssImage, 1); if (default_image) { channel_subsys.default_cssid = cssid; } @@ -1778,7 +1778,7 @@ void css_undo_stcrw(CRW *crw) { CrwContainer *crw_cont; - crw_cont = g_try_malloc0(sizeof(CrwContainer)); + crw_cont = g_try_new0(CrwContainer, 1); if (!crw_cont) { channel_subsys.crws_lost = true; return; @@ -2185,7 +2185,7 @@ void css_subch_assign(uint8_t cssid, uint8_t ssid, uint16_t schid, css = channel_subsys.css[cssid]; if (!css->sch_set[ssid]) { - css->sch_set[ssid] = g_malloc0(sizeof(SubchSet)); + css->sch_set[ssid] = g_new0(SubchSet, 1); } s_set = css->sch_set[ssid]; @@ -2206,7 +2206,7 @@ void css_queue_crw(uint8_t rsc, uint8_t erc, int solicited, trace_css_crw(rsc, erc, rsid, chain ? "(chained)" : ""); /* TODO: Maybe use a static crw pool? */ - crw_cont = g_try_malloc0(sizeof(CrwContainer)); + crw_cont = g_try_new0(CrwContainer, 1); if (!crw_cont) { channel_subsys.crws_lost = true; return; @@ -2498,7 +2498,7 @@ SubchDev *css_create_sch(CssDevId bus_id, bool is_virtual, bool squash_mcss, } } - sch = g_malloc0(sizeof(*sch)); + sch = g_new0(SubchDev, 1); sch->cssid = bus_id.cssid; sch->ssid = bus_id.ssid; sch->devno = bus_id.devid; diff --git a/hw/s390x/s390-pci-bus.c b/hw/s390x/s390-pci-bus.c index 96116b7d1e..e7a58e81f7 100644 --- a/hw/s390x/s390-pci-bus.c +++ b/hw/s390x/s390-pci-bus.c @@ -240,7 +240,7 @@ static void s390_pci_generate_event(uint8_t cc, uint16_t pec, uint32_t fh, SeiContainer *sei_cont; S390pciState *s = s390_get_phb(); - sei_cont = g_malloc0(sizeof(SeiContainer)); + sei_cont = g_new0(SeiContainer, 1); sei_cont->fh = fh; sei_cont->fid = fid; sei_cont->cc = cc; @@ -416,7 +416,7 @@ static S390PCIIOMMU *s390_pci_get_iommu(S390pciState *s, PCIBus *bus, S390PCIIOMMU *iommu; if (!table) { - table = g_malloc0(sizeof(S390PCIIOMMUTable)); + table = g_new0(S390PCIIOMMUTable, 1); table->key = key; g_hash_table_insert(s->iommu_table, &table->key, table); } diff --git a/target/s390x/cpu_models.c b/target/s390x/cpu_models.c index 07ef8a3b6e..8c2d8851ae 100644 --- a/target/s390x/cpu_models.c +++ b/target/s390x/cpu_models.c @@ -392,7 +392,7 @@ static void create_cpu_model_list(ObjectClass *klass, void *opaque) /* strip off the -s390-cpu */ g_strrstr(name, "-" TYPE_S390_CPU)[0] = 0; - info = g_malloc0(sizeof(*info)); + info = g_new0(CpuDefinitionInfo, 1); info->name = name; info->has_migration_safe = true; info->migration_safe = scc->is_migration_safe; @@ -412,7 +412,7 @@ static void create_cpu_model_list(ObjectClass *klass, void *opaque) object_unref(obj); } - entry = g_malloc0(sizeof(*entry)); + entry = g_new0(CpuDefinitionInfoList, 1); entry->value = info; entry->next = *cpu_list; *cpu_list = entry; @@ -574,7 +574,7 @@ CpuModelExpansionInfo *arch_query_cpu_model_expansion(CpuModelExpansionType type } /* convert it back to a static representation */ - expansion_info = g_malloc0(sizeof(*expansion_info)); + expansion_info = g_new0(CpuModelExpansionInfo, 1); expansion_info->model = g_malloc0(sizeof(*expansion_info->model)); cpu_info_from_model(expansion_info->model, &s390_model, delta_changes); return expansion_info; @@ -585,7 +585,7 @@ static void list_add_feat(const char *name, void *opaque) strList **last = (strList **) opaque; strList *entry; - entry = g_malloc0(sizeof(*entry)); + entry = g_new0(strList, 1); entry->value = g_strdup(name); entry->next = *last; *last = entry; @@ -609,7 +609,7 @@ CpuModelCompareInfo *arch_query_cpu_model_comparison(CpuModelInfo *infoa, if (*errp) { return NULL; } - compare_info = g_malloc0(sizeof(*compare_info)); + compare_info = g_new0(CpuModelCompareInfo, 1); /* check the cpu generation and ga level */ if (modela.def->gen == modelb.def->gen) { @@ -713,7 +713,7 @@ CpuModelBaselineInfo *arch_query_cpu_model_baseline(CpuModelInfo *infoa, bitmap_and(model.features, model.features, model.def->full_feat, S390_FEAT_MAX); - baseline_info = g_malloc0(sizeof(*baseline_info)); + baseline_info = g_new0(CpuModelBaselineInfo, 1); baseline_info->model = g_malloc0(sizeof(*baseline_info->model)); cpu_info_from_model(baseline_info->model, &model, true); return baseline_info; diff --git a/target/s390x/diag.c b/target/s390x/diag.c index 82a623948d..dbbb9e886f 100644 --- a/target/s390x/diag.c +++ b/target/s390x/diag.c @@ -144,7 +144,7 @@ void handle_diag_308(CPUS390XState *env, uint64_t r1, uint64_t r3) program_interrupt(env, PGM_ADDRESSING, ILEN_AUTO); return; } - iplb = g_malloc0(sizeof(IplParameterBlock)); + iplb = g_new0(IplParameterBlock, 1); cpu_physical_memory_read(addr, iplb, sizeof(iplb->len)); if (!iplb_valid_len(iplb)) { env->regs[r1 + 1] = DIAG_308_RC_INVALID; From patchwork Fri Oct 6 23:49:22 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 822797 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="Wu2QJhbs"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3y86P56Vrwz9t3R for ; Sat, 7 Oct 2017 11:11:21 +1100 (AEDT) Received: from localhost ([::1]:47629 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e0ci8-0007NM-0G for incoming@patchwork.ozlabs.org; Fri, 06 Oct 2017 20:11:20 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41478) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e0cPY-00086U-C1 for qemu-devel@nongnu.org; Fri, 06 Oct 2017 19:52:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e0cPX-0005db-FA for qemu-devel@nongnu.org; Fri, 06 Oct 2017 19:52:08 -0400 Received: from mail-qt0-x242.google.com ([2607:f8b0:400d:c0d::242]:52760) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1e0cPX-0005dM-Ag; Fri, 06 Oct 2017 19:52:07 -0400 Received: by mail-qt0-x242.google.com with SMTP id o52so34323323qtc.9; Fri, 06 Oct 2017 16:52:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=wpv8EGIq3j7qi+6pArxULtJw2EKh1Du6IsovEPutuLs=; b=Wu2QJhbs8nhdYfcroDVS+z3fr4VgOy9Shr8Wfbe306M7G2WftJqjenM6tYWrTVvkBs EAFDcpZxCy7nNxnL8s6/rjIWLxODRKyWSll8fxZlsQznFW4IMct/bz1lryZWcgkaZGxw 81fk1zK3HQGDk4VhjmsibA2ItQH9/63e2cRxE3fQQOgNPCq0xVJL9q4lInGleCauEIYl Lr8Hq7Z14DxCUfx/VvCOZ8HW+Xbbyjf+n4A+O3X/A+0So3GZVzpYs1TSsMFPBdHuCNau 6voM8NuWA4PZQrsjLQFQWfwaQkX0kMAbfYUhsxbAoMICJeoQ75f4FQnu58OyRB+dyVFM tZ3g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=wpv8EGIq3j7qi+6pArxULtJw2EKh1Du6IsovEPutuLs=; b=Wy4vhEK0H5YpwAr9Dg9HruJ9AB8mzxxyQEGte8JnoJFsD+pSuJQ0blEcPQIh1grQLq ftY3cOgNjU6Oh93T5VdOGNYtoaDAk7tGIYJJ0RkQC8Pwu/qfmReuArY+yH+oTaRI96sX e1qAb5BR1B1xUFbROB48F1VP8H1yG7C9W/vDL7NETEyUl92B03eRYEX8dUD5jnvTdlVh ig4W3OrV2/hFS5tDgNm/79Wgn5/mWsWer+cfdQ6MBooRT5K2l0uud2q9Vj+bWadYIM3D 10pYI2dTyJfemwCAbJiHevwilO7Dp7Dk8A9vB9LmsqLCF6+ohti7Tt7xTDjmQqzEIuFX pKfA== X-Gm-Message-State: AMCzsaVQC2IqAHgvmnsWk1VJXdaP0k2HS4NJzRuXuFM3iuUojGnlVnW/ v+KCQnO5KX9SE/Vx4KKPVoo= X-Google-Smtp-Source: AOwi7QCfG62t0e2P7AjL9jCsYL3DovkTIFpR1ZiDFN07ba3AP/yMaFRd6YCaAY8iANjvY19KgsUuFQ== X-Received: by 10.200.23.36 with SMTP id w33mr5651652qtj.50.1507333926782; Fri, 06 Oct 2017 16:52:06 -0700 (PDT) Received: from yoga.lan ([181.93.89.178]) by smtp.gmail.com with ESMTPSA id g1sm1705226qta.95.2017.10.06.16.52.03 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 06 Oct 2017 16:52:06 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Markus Armbruster , Eric Blake , Magnus Damm , Aurelien Jarno Date: Fri, 6 Oct 2017 20:49:22 -0300 Message-Id: <20171006235023.11952-28-f4bug@amsat.org> X-Mailer: git-send-email 2.14.2 In-Reply-To: <20171006235023.11952-1-f4bug@amsat.org> References: <20171006235023.11952-1-f4bug@amsat.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c0d::242 Subject: [Qemu-devel] [PATCH 27/88] SH4: use g_new() family of functions X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , qemu trival , qemu-devel@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Marc-André Lureau Signed-off-by: Marc-André Lureau Signed-off-by: Philippe Mathieu-Daudé [PMD: squashed R2D] --- hw/sh4/r2d.c | 4 ++-- hw/sh4/sh7750.c | 2 +- hw/timer/sh_timer.c | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/hw/sh4/r2d.c b/hw/sh4/r2d.c index 16b9ed2db2..92d1fb99d7 100644 --- a/hw/sh4/r2d.c +++ b/hw/sh4/r2d.c @@ -186,7 +186,7 @@ static qemu_irq *r2d_fpga_init(MemoryRegion *sysmem, { r2d_fpga_t *s; - s = g_malloc0(sizeof(r2d_fpga_t)); + s = g_new0(r2d_fpga_t, 1); s->irl = irl; @@ -249,7 +249,7 @@ static void r2d_init(MachineState *machine) cpu = SUPERH_CPU(cpu_generic_init(TYPE_SUPERH_CPU, cpu_model)); env = &cpu->env; - reset_info = g_malloc0(sizeof(ResetData)); + reset_info = g_new0(ResetData, 1); reset_info->cpu = cpu; reset_info->vector = env->pc; qemu_register_reset(main_cpu_reset, reset_info); diff --git a/hw/sh4/sh7750.c b/hw/sh4/sh7750.c index 166e4bd947..49c49c110b 100644 --- a/hw/sh4/sh7750.c +++ b/hw/sh4/sh7750.c @@ -728,7 +728,7 @@ SH7750State *sh7750_init(SuperHCPU *cpu, MemoryRegion *sysmem) { SH7750State *s; - s = g_malloc0(sizeof(SH7750State)); + s = g_new0(SH7750State, 1); s->cpu = cpu; s->periph_freq = 60000000; /* 60MHz */ memory_region_init_io(&s->iomem, NULL, &sh7750_mem_ops, s, diff --git a/hw/timer/sh_timer.c b/hw/timer/sh_timer.c index 9afb2d048c..46f3eb9647 100644 --- a/hw/timer/sh_timer.c +++ b/hw/timer/sh_timer.c @@ -192,7 +192,7 @@ static void *sh_timer_init(uint32_t freq, int feat, qemu_irq irq) sh_timer_state *s; QEMUBH *bh; - s = (sh_timer_state *)g_malloc0(sizeof(sh_timer_state)); + s = g_new0(sh_timer_state, 1); s->freq = freq; s->feat = feat; s->tcor = 0xffffffff; @@ -313,7 +313,7 @@ void tmu012_init(MemoryRegion *sysmem, hwaddr base, tmu012_state *s; int timer_feat = (feat & TMU012_FEAT_EXTCLK) ? TIMER_FEAT_EXTCLK : 0; - s = (tmu012_state *)g_malloc0(sizeof(tmu012_state)); + s = g_new0(tmu012_state, 1); s->feat = feat; s->timer[0] = sh_timer_init(freq, timer_feat, ch0_irq); s->timer[1] = sh_timer_init(freq, timer_feat, ch1_irq); From patchwork Fri Oct 6 23:49:23 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 822800 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="J6KIVncI"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3y86SB24p6z9t3R for ; Sat, 7 Oct 2017 11:14:02 +1100 (AEDT) Received: from localhost ([::1]:47645 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e0cki-0001FB-8v for incoming@patchwork.ozlabs.org; Fri, 06 Oct 2017 20:14:00 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41510) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e0cPe-0008AM-7y for qemu-devel@nongnu.org; Fri, 06 Oct 2017 19:52:15 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e0cPb-0005i4-6h for qemu-devel@nongnu.org; Fri, 06 Oct 2017 19:52:14 -0400 Received: from mail-qt0-x241.google.com ([2607:f8b0:400d:c0d::241]:51467) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1e0cPb-0005hg-2C; Fri, 06 Oct 2017 19:52:11 -0400 Received: by mail-qt0-x241.google.com with SMTP id q4so34329897qtq.8; Fri, 06 Oct 2017 16:52:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Diko5qXOLF4sVroZHpITLZhVtWKNf7zhiL/atUuRpcM=; b=J6KIVncI35prZDDEwyDTplK2lFech/TMfuubUeDEzSpnJfMqEbuv9S1cJecUK5lcWi vn2ipmSUbnZoCKo+c3t9ux7+u30PhiUB5SFo7BHMiQwQpd+ZV8/A/A/FP+L0uL7IanMh UhZ1xxfrbjoK41EzNiE0IxM+z8Rrmw26rr6WJggfWTR1Z5iaBNx2DKr0sjLJTLV7WVw3 QZOcJypWMI1kCwbiC+higqs7fu+Q1fuP/sJggYAB2RKv7eoStK5rfr26uNdWOivIEYzN RQaQrD1FS246S65wnrv+wLhs0243rR7nMpxKmDRbYwW2J+WdgG/He23mH+d/uZNZjqiz qyaw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=Diko5qXOLF4sVroZHpITLZhVtWKNf7zhiL/atUuRpcM=; b=Zx2Fk5oiFBe/5R40UkIPVrhnydAhs+9PrC6EBC1+Hi5ty76M4YTIuXzMb/BUpupvPc HsX7Ta3e8I/TYziyx944y4a0a5f7D7mdAFRR/hwrl3tdz8jzzmUtIVHgfFWy9rBhg4jA iaBoDd/uv2QfOddPkamttQd4irBy9L2yzKGq/ea2W9pzFE1ei5wNLPOxt49sIFWfV1JF veCJHO9efv61yPWDj59T1YBbEpWvxfXny6BFvqxVo9I4zxieXC8qoQFFZpI3X0G7y+rC kpgfoT5YCc+ydcU3w0Eww+g22T9QpaBiCmT1TeAg7Q4ZjbNCAVPqjDXrEi89g52q3GFZ oLcw== X-Gm-Message-State: AMCzsaV7gtLr61XpbRrsPjZQcb3fGelWPAhYlN94PsKXCUcm9TBagj6C epXjvj3PFPS7qGZYlLIOTsE= X-Google-Smtp-Source: AOwi7QCuTZ7NwFuV3ZlKbUh6+A1+vz6E+DWlQxsc9JB5eW/Zm7krg7wCB5fpWHuSnW2/+1kd4nkr/w== X-Received: by 10.200.25.137 with SMTP id u9mr5696740qtj.81.1507333930544; Fri, 06 Oct 2017 16:52:10 -0700 (PDT) Received: from yoga.lan ([181.93.89.178]) by smtp.gmail.com with ESMTPSA id g1sm1705226qta.95.2017.10.06.16.52.06 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 06 Oct 2017 16:52:10 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Markus Armbruster , Eric Blake , Laurent Vivier , Mark Cave-Ayland , Artyom Tarasenko , Chris Wulff , Marek Vasut Date: Fri, 6 Oct 2017 20:49:23 -0300 Message-Id: <20171006235023.11952-29-f4bug@amsat.org> X-Mailer: git-send-email 2.14.2 In-Reply-To: <20171006235023.11952-1-f4bug@amsat.org> References: <20171006235023.11952-1-f4bug@amsat.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c0d::241 Subject: [Qemu-devel] [PATCH 28/88] disas: use g_new() family of functions X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , qemu trival , qemu-devel@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Marc-André Lureau Signed-off-by: Marc-André Lureau Signed-off-by: Philippe Mathieu-Daudé [PMD: fixed const cast, squashed M68K + NiosII + SPARC, renamed subject "disas"] --- disas/m68k.c | 3 +-- disas/nios2.c | 3 +-- disas/sparc.c | 3 +-- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/disas/m68k.c b/disas/m68k.c index 61b689ef3e..31cf6ea5f9 100644 --- a/disas/m68k.c +++ b/disas/m68k.c @@ -1886,8 +1886,7 @@ print_insn_m68k (bfd_vma memaddr, disassemble_info *info) /* Then create a sorted table of pointers that point into the unsorted table. */ - opc_pointer[0] = malloc (sizeof (struct m68k_opcode *) - * m68k_numopcodes); + opc_pointer[0] = g_new(const struct m68k_opcode *, m68k_numopcodes); opcodes[0] = opc_pointer[0]; for (i = 1; i < 16; i++) diff --git a/disas/nios2.c b/disas/nios2.c index b342936d21..9e6e1e6a1f 100644 --- a/disas/nios2.c +++ b/disas/nios2.c @@ -2625,8 +2625,7 @@ nios2_init_opcode_hash (nios2_disassembler_state *state) if (bucket) { - new_hash = - (nios2_opcode_hash *) malloc (sizeof (nios2_opcode_hash)); + new_hash = g_new(nios2_opcode_hash, 1); if (new_hash == NULL) { fprintf (stderr, diff --git a/disas/sparc.c b/disas/sparc.c index f120f4e86d..6d0adab8a7 100644 --- a/disas/sparc.c +++ b/disas/sparc.c @@ -2684,8 +2684,7 @@ print_insn_sparc (bfd_vma memaddr, disassemble_info *info) current_arch_mask = compute_arch_mask (info->mach); if (!opcodes_initialized) - sorted_opcodes = - malloc (sparc_num_opcodes * sizeof (sparc_opcode *)); + sorted_opcodes = g_new(const sparc_opcode *, sparc_num_opcodes); /* Reset the sorted table so we can resort it. */ for (i = 0; i < sparc_num_opcodes; ++i) sorted_opcodes[i] = &sparc_opcodes[i]; From patchwork Fri Oct 6 23:49:24 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 822799 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="Ex5efKQ9"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3y86R50K18z9t3R for ; Sat, 7 Oct 2017 11:13:05 +1100 (AEDT) Received: from localhost ([::1]:47639 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e0cjn-0000PG-2x for incoming@patchwork.ozlabs.org; Fri, 06 Oct 2017 20:13:03 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41532) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e0cPf-0008BH-AB for qemu-devel@nongnu.org; Fri, 06 Oct 2017 19:52:16 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e0cPe-0005lh-Fs for qemu-devel@nongnu.org; Fri, 06 Oct 2017 19:52:15 -0400 Received: from mail-qt0-x243.google.com ([2607:f8b0:400d:c0d::243]:49206) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1e0cPe-0005ku-Bq; Fri, 06 Oct 2017 19:52:14 -0400 Received: by mail-qt0-x243.google.com with SMTP id o3so34345993qte.6; Fri, 06 Oct 2017 16:52:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=AJvTXN+YRve7u3eta4Gx0S6cLKojq4z3L9TSPeZB220=; b=Ex5efKQ9eRAl2DMKYFNUxWN4y0ROkwChSR4ZAM+Fezk6alXT+khCJTw1WJlog3q2EN 3tUCklz0mzNU8zK6ztSDoRDrdIbE0/ut5dehM8veXdKr/+Y4QDcO101007L7g/bE67jr 3EsuZ7mgRtIyL8i4320HWzAVO60rMGORIVbwqHq0Aivx8TbP7sy4pc0QJ7Zt1MvvbwqZ 6iDylKEgoFfqfJaVa9tsrgBVOJbAq2vhGcrztGNlovTfhIvCGi4IiNdeY9w5cFDA/QhC V1VjtarZ2ISxTxxAmnGpYpQfHCiK1+A45P0oO7clYVJievsaUoggkrSxxzyswHvKMcvZ GjzA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=AJvTXN+YRve7u3eta4Gx0S6cLKojq4z3L9TSPeZB220=; b=o+5D9aH0UrOo8QE2TjBuCTsiNeLjPB7la5ezH4wofeKB3H4pNaJxtBZ2KWnfHo4xXP pHTwdkrZ5GtsLBP5Us3hwpuMvcGm+k+iww629jyGjdsY9boU2d+jiM4PGhhDbpzI66Np i97ag1/uwPSxVIgwNIq/VWeyD/YlJwUnz1+kuh9e+Sv2/j/Qen89+cp4JPXnDL0pD56A L6qePL1chzYiQ2KtCsRTezXZt3YDA0E99WedOdb+1MWwNwQ0HfmZhIJkigJtjXEW2XZb 1gbxI13Ul2wOgplU134pcaWDj2QS/b4Myy9Fr1I1k67wXGGjMBlxTRzyagC5Q+6VVPFU dZwQ== X-Gm-Message-State: AMCzsaWpoKzlNy90n54JYu7TX3NuVsJKVk8IRWmuvziwuwnOe17axdWM 0ot+ghzo+jvihUhBm2xSHPA= X-Google-Smtp-Source: AOwi7QAheWUmuO5bz2zFGZviwc2UeZhh72gkcmtBPAYnyNDhfmtFIcf5OtTZFRostt81Yi1BYvZkfw== X-Received: by 10.200.45.89 with SMTP id o25mr5471537qta.337.1507333933815; Fri, 06 Oct 2017 16:52:13 -0700 (PDT) Received: from yoga.lan ([181.93.89.178]) by smtp.gmail.com with ESMTPSA id g1sm1705226qta.95.2017.10.06.16.52.10 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 06 Oct 2017 16:52:13 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Markus Armbruster , Eric Blake , Mark Cave-Ayland , Artyom Tarasenko Date: Fri, 6 Oct 2017 20:49:24 -0300 Message-Id: <20171006235023.11952-30-f4bug@amsat.org> X-Mailer: git-send-email 2.14.2 In-Reply-To: <20171006235023.11952-1-f4bug@amsat.org> References: <20171006235023.11952-1-f4bug@amsat.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c0d::243 Subject: [Qemu-devel] [PATCH 29/88] SPARC: use g_new() family of functions X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , qemu trival , qemu-devel@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Marc-André Lureau Signed-off-by: Marc-André Lureau Signed-off-by: Philippe Mathieu-Daudé [PMD: split of disas/sparc.c change] --- hw/sparc/leon3.c | 2 +- hw/sparc64/sparc64.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/hw/sparc/leon3.c b/hw/sparc/leon3.c index ec2816bf94..05e7adefb8 100644 --- a/hw/sparc/leon3.c +++ b/hw/sparc/leon3.c @@ -132,7 +132,7 @@ static void leon3_generic_hw_init(MachineState *machine) cpu_sparc_set_id(env, 0); /* Reset data */ - reset_info = g_malloc0(sizeof(ResetData)); + reset_info = g_new0(ResetData, 1); reset_info->cpu = cpu; reset_info->sp = 0x40000000 + ram_size; qemu_register_reset(main_cpu_reset, reset_info); diff --git a/hw/sparc64/sparc64.c b/hw/sparc64/sparc64.c index 097d529ff1..6f2197fc13 100644 --- a/hw/sparc64/sparc64.c +++ b/hw/sparc64/sparc64.c @@ -160,7 +160,7 @@ static CPUTimer *cpu_timer_create(const char *name, SPARCCPU *cpu, QEMUBHFunc *cb, uint32_t frequency, uint64_t disabled_mask, uint64_t npt_mask) { - CPUTimer *timer = g_malloc0(sizeof(CPUTimer)); + CPUTimer *timer = g_new0(CPUTimer, 1); timer->name = name; timer->frequency = frequency; @@ -368,7 +368,7 @@ SPARCCPU *sparc64_cpu_devinit(const char *cpu_model, hstick_frequency, TICK_INT_DIS, TICK_NPT_MASK); - reset_info = g_malloc0(sizeof(ResetData)); + reset_info = g_new0(ResetData, 1); reset_info->cpu = cpu; reset_info->prom_addr = prom_addr; qemu_register_reset(main_cpu_reset, reset_info); From patchwork Fri Oct 6 23:49:25 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 822802 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="JYLtn33p"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3y86Sv3P6xz9t3t for ; Sat, 7 Oct 2017 11:14:39 +1100 (AEDT) Received: from localhost ([::1]:47650 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e0clJ-0001mX-Ex for incoming@patchwork.ozlabs.org; Fri, 06 Oct 2017 20:14:37 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41572) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e0cPj-0008Dt-Ga for qemu-devel@nongnu.org; Fri, 06 Oct 2017 19:52:20 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e0cPi-0005nX-8N for qemu-devel@nongnu.org; Fri, 06 Oct 2017 19:52:19 -0400 Received: from mail-qt0-x244.google.com ([2607:f8b0:400d:c0d::244]:46782) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1e0cPi-0005nE-2w; Fri, 06 Oct 2017 19:52:18 -0400 Received: by mail-qt0-x244.google.com with SMTP id 6so25229433qtw.3; Fri, 06 Oct 2017 16:52:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=3pReIJ0yowHE70t9Y0HHBB+Pqm3BLEjrcslGdOP3trA=; b=JYLtn33pUa+juR0o/PWMjqGguI6mavdffsdtfhx1w2mM3XjrxhqTY66ctxrRahPi7Q lKQKEDb7I2IPe+6eYTTgfBMSgYWdlDAwAgfFf0/Q2mXDfgAfOahR+geHgr2t8m9ScgBB YaSN5f8LxF6BFfUJUkmTf0sVFfhs+/ZDstuIpkcIHTJE5cpJKKMopDf08UHb1ElOd1Us s2KKFf3B+h0leZLBikPYPSpfvXFfqdu1xNvsVq0+UOzSituOeR0/wgVCrJS4UXHUsIki mhrX5ojaVOxgQDMk3ZNX9wF4SVm3R6q8r7ETUJOPLdcAMvlgN/spv8RjgsKAPwZEhsX8 MpBQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=3pReIJ0yowHE70t9Y0HHBB+Pqm3BLEjrcslGdOP3trA=; b=JBOvoVph6d4SPode6CQs0MMM5LZIrC7tXQ+xEuzfrDqJU1/ja8mTdSYGJNc0Q/xdic smKCMEVgQpT/CbHc4QJIc4rFOi7GQqd4zkmmhPjTzlNLM2hnumgZK3TZLK3pTxkzbI49 kWpubZTo/FXCVF673EZD8Kf+jy0lGNkdkSymO+ESc3iw087htZRpTdiX2JFwhgHpG7mL Uda4524rZtw7fkcInIN1jXZ8DYXPjtxMOLgfsSMTk5WsTIi3Z9H1x5Jlu+D0roIayBjO m0ad7Y5bg4SIXJGcbecKQ51VPLkAd0do2XkSyouOIRMsbBbIDolm6Y2l4jt8COUfaNlB qrhw== X-Gm-Message-State: AMCzsaWzReEXOLsN22V97f2Qwxv1bs0t4fdrZRk7EeMERQ1HyLdQ4u9U 9e+E4+m+BDz4SFwlN+AmdwU= X-Google-Smtp-Source: AOwi7QDv6zAFRIBtwv06cveNRLVEoIFUOZO0xRJ+6pF74G3/41aI8fIHKLaDWcXqJB4IRZxtI4nuQg== X-Received: by 10.200.39.122 with SMTP id h55mr5582018qth.238.1507333937063; Fri, 06 Oct 2017 16:52:17 -0700 (PDT) Received: from yoga.lan ([181.93.89.178]) by smtp.gmail.com with ESMTPSA id g1sm1705226qta.95.2017.10.06.16.52.14 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 06 Oct 2017 16:52:16 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Markus Armbruster , Eric Blake , Michael Roth Date: Fri, 6 Oct 2017 20:49:25 -0300 Message-Id: <20171006235023.11952-31-f4bug@amsat.org> X-Mailer: git-send-email 2.14.2 In-Reply-To: <20171006235023.11952-1-f4bug@amsat.org> References: <20171006235023.11952-1-f4bug@amsat.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c0d::244 Subject: [Qemu-devel] [PATCH 30/88] QEMU Guest Agent: use g_new() family of functions X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , qemu trival , qemu-devel@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Marc-André Lureau Signed-off-by: Marc-André Lureau Signed-off-by: Philippe Mathieu-Daudé [PMD: added qga/commands-posix.c and qga/commands-win32.c] --- qga/commands-posix.c | 20 ++++++++++---------- qga/commands-win32.c | 12 ++++++------ qga/commands.c | 2 +- 3 files changed, 17 insertions(+), 17 deletions(-) diff --git a/qga/commands-posix.c b/qga/commands-posix.c index ab0c63d931..3a4deb6ae0 100644 --- a/qga/commands-posix.c +++ b/qga/commands-posix.c @@ -906,16 +906,16 @@ static void build_guest_fsinfo_for_real_device(char const *syspath, } } - pciaddr = g_malloc0(sizeof(*pciaddr)); + pciaddr = g_new0(GuestPCIAddress, 1); pciaddr->domain = pci[0]; pciaddr->bus = pci[1]; pciaddr->slot = pci[2]; pciaddr->function = pci[3]; - disk = g_malloc0(sizeof(*disk)); + disk = g_new0(GuestDiskAddress, 1); disk->pci_controller = pciaddr; - list = g_malloc0(sizeof(*list)); + list = g_new0(GuestDiskAddressList, 1); list->value = disk; if (strcmp(driver, "ata_piix") == 0) { @@ -1380,7 +1380,7 @@ qmp_guest_fstrim(bool has_minimum, int64_t minimum, Error **errp) return NULL; } - response = g_malloc0(sizeof(*response)); + response = g_new0(GuestFilesystemTrimResponse, 1); QTAILQ_FOREACH(mount, &mounts, next) { result = g_malloc0(sizeof(*result)); @@ -1897,12 +1897,12 @@ GuestLogicalProcessorList *qmp_guest_get_vcpus(Error **errp) GuestLogicalProcessor *vcpu; GuestLogicalProcessorList *entry; - vcpu = g_malloc0(sizeof *vcpu); + vcpu = g_new0(GuestLogicalProcessor, 1); vcpu->logical_id = current++; vcpu->has_can_offline = true; /* lolspeak ftw */ transfer_vcpu(vcpu, true, &local_err); - entry = g_malloc0(sizeof *entry); + entry = g_new0(GuestLogicalProcessorList, 1); entry->value = vcpu; *link = entry; @@ -2267,13 +2267,13 @@ GuestMemoryBlockList *qmp_guest_get_memory_blocks(Error **errp) continue; } - mem_blk = g_malloc0(sizeof *mem_blk); + mem_blk = g_new0(GuestMemoryBlock, 1); /* The d_name is "memoryXXX", phys_index is block id, same as XXX */ mem_blk->phys_index = strtoul(&de->d_name[6], NULL, 10); mem_blk->has_can_offline = true; /* lolspeak ftw */ transfer_memory_block(mem_blk, true, NULL, &local_err); - entry = g_malloc0(sizeof *entry); + entry = g_new0(GuestMemoryBlockList, 1); entry->value = mem_blk; *link = entry; @@ -2308,13 +2308,13 @@ qmp_guest_set_memory_blocks(GuestMemoryBlockList *mem_blks, Error **errp) GuestMemoryBlockResponseList *entry; GuestMemoryBlock *current_mem_blk = mem_blks->value; - result = g_malloc0(sizeof(*result)); + result = g_new0(GuestMemoryBlockResponse, 1); result->phys_index = current_mem_blk->phys_index; transfer_memory_block(current_mem_blk, false, result, &local_err); if (local_err) { /* should never happen */ goto err; } - entry = g_malloc0(sizeof *entry); + entry = g_new0(GuestMemoryBlockResponseList, 1); entry->value = result; *link = entry; diff --git a/qga/commands-win32.c b/qga/commands-win32.c index 619dbd2bc2..908f110b8b 100644 --- a/qga/commands-win32.c +++ b/qga/commands-win32.c @@ -617,7 +617,7 @@ static GuestDiskAddressList *build_guest_disk_info(char *guid, Error **errp) goto out_close; } - disk = g_malloc0(sizeof(*disk)); + disk = g_new0(GuestDiskAddress, 1); disk->bus_type = find_bus_type(bus); if (bus == BusTypeScsi || bus == BusTypeAta || bus == BusTypeRAID #if (_WIN32_WINNT >= 0x0600) @@ -641,7 +641,7 @@ static GuestDiskAddressList *build_guest_disk_info(char *guid, Error **errp) disk->pci_controller = NULL; } - list = g_malloc0(sizeof(*list)); + list = g_new0(GuestDiskAddressList, 1); list->value = disk; list->next = NULL; out_close: @@ -694,7 +694,7 @@ static GuestFilesystemInfo *build_guest_fsinfo(char *guid, Error **errp) } fs_name[sizeof(fs_name) - 1] = 0; - fs = g_malloc(sizeof(*fs)); + fs = g_new(GuestFilesystemInfo, 1); fs->name = g_strdup(guid); if (len == 0) { fs->mountpoint = g_strdup("System Reserved"); @@ -877,7 +877,7 @@ qmp_guest_fstrim(bool has_minimum, int64_t minimum, Error **errp) continue; } - uc_path = g_malloc(sizeof(WCHAR) * char_count); + uc_path = g_new(WCHAR, char_count); if (!GetVolumePathNamesForVolumeNameW(guid, uc_path, char_count, &char_count) || !*uc_path) { /* strange, but this condition could be faced even with size == 2 */ @@ -1348,12 +1348,12 @@ GuestLogicalProcessorList *qmp_guest_get_vcpus(Error **errp) GuestLogicalProcessor *vcpu; GuestLogicalProcessorList *entry; - vcpu = g_malloc0(sizeof *vcpu); + vcpu = g_new0(GuestLogicalProcessor, 1); vcpu->logical_id = current++; vcpu->online = true; vcpu->has_can_offline = true; - entry = g_malloc0(sizeof *entry); + entry = g_new0(GuestLogicalProcessorList, 1); entry->value = vcpu; *link = entry; diff --git a/qga/commands.c b/qga/commands.c index ff89e805cf..d4c78ac935 100644 --- a/qga/commands.c +++ b/qga/commands.c @@ -239,7 +239,7 @@ static char **guest_exec_get_args(const strList *entry, bool log) str = g_malloc(str_size); *str = 0; - args = g_malloc(count * sizeof(char *)); + args = g_new(char *, count); for (it = entry; it != NULL; it = it->next) { args[i++] = it->value; pstrcat(str, str_size, it->value); From patchwork Fri Oct 6 23:49:26 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 822805 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="Wgptvq13"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3y86Ws6hdBz9t3t for ; Sat, 7 Oct 2017 11:17:13 +1100 (AEDT) Received: from localhost ([::1]:47671 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e0cnn-00044J-Uk for incoming@patchwork.ozlabs.org; Fri, 06 Oct 2017 20:17:12 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41609) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e0cPo-0008IJ-4a for qemu-devel@nongnu.org; Fri, 06 Oct 2017 19:52:25 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e0cPl-0005pl-1f for qemu-devel@nongnu.org; Fri, 06 Oct 2017 19:52:24 -0400 Received: from mail-qk0-x242.google.com ([2607:f8b0:400d:c09::242]:33089) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1e0cPk-0005pY-Sh; Fri, 06 Oct 2017 19:52:20 -0400 Received: by mail-qk0-x242.google.com with SMTP id z12so9699423qkb.0; Fri, 06 Oct 2017 16:52:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=SratUe3w9q0+0lXX2FxlOcFtdtVwgrAbdCNWZ/OQwXY=; b=Wgptvq13msx2ZRmfbNFSI/q+8tYflPRB9oeSdIQ1ngKne7dGT125cC0AQqVLnr9ypx +SINvlUGz6d1ta4Os4yHN/JaW2n0B8OuLVOkQJy6xAR8WWBTwAcni6S3PS0xz6hkkORm 4+MqIFimClrDsRRGNaG0esaYifTTUpIUm/Ws6x1wTdXu9zZzRWEECKhCfwa56C73u/yt 5dIi+J6c6rEWv2FMDe1EV3quSG8E1nCzfohI0JP6ML8xPEpW5R8SjXu8HcsRz4tVJD5D vnfhZqrO7V3Azj+y6G3HTwJ9fM30Ba5xmzVgBQB0xMY4xrA/pe918KqlEX40BOr373+P JcqA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=SratUe3w9q0+0lXX2FxlOcFtdtVwgrAbdCNWZ/OQwXY=; b=pmC/t9cDDWQgA3PsOiJRQpRvXnFO5YWzmlSd2VmIJGyGbN7ZmihiPewKyUHKV6knVD +ohkUFdrDQXHoJnxVjJ+W17YDrBd42KSxsy9MH+zBEvNGM5ac/Kacm1J1hBZZS6A0kic jpiVt705tcVSZYDKDALxLcnLDhH52IkIsXhD7xnC5Z6w9xPKQw4MDdTLnUbxeHdC0tR1 jDMyOXRzh4B7i73PcaX6mi8QoCmq6Jz7C1O5TLQp9QbtjdFkHU4E8VmPhawOR6qvzZEV R9N9Yiz00vbpCawsd/6YxI2gmKxy9uvA/TeBsYGVPFxmRlLRTxrURlBLo7M7QBKKb9ut dIjw== X-Gm-Message-State: AMCzsaW+1WHkS/F7thQTpqJ4gN/ZUZFngZAxxHI9k4KS7njpuzaog16/ Z4Xgt6xHmglTgUzEtzIvrfXV4Tp7gvU= X-Google-Smtp-Source: AOwi7QC1JHBjbc1iz149lfWfIP7JrqkBTwOCJ24WmBo0BKsC2SoizzEjjxe9TaprOf2D8yaJP/006A== X-Received: by 10.55.16.87 with SMTP id a84mr766136qkh.170.1507333940301; Fri, 06 Oct 2017 16:52:20 -0700 (PDT) Received: from yoga.lan ([181.93.89.178]) by smtp.gmail.com with ESMTPSA id g1sm1705226qta.95.2017.10.06.16.52.17 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 06 Oct 2017 16:52:19 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Markus Armbruster , Eric Blake , "Dr. David Alan Gilbert" Date: Fri, 6 Oct 2017 20:49:26 -0300 Message-Id: <20171006235023.11952-32-f4bug@amsat.org> X-Mailer: git-send-email 2.14.2 In-Reply-To: <20171006235023.11952-1-f4bug@amsat.org> References: <20171006235023.11952-1-f4bug@amsat.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c09::242 Subject: [Qemu-devel] [PATCH 31/88] QMP: use g_new() family of functions X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , qemu trival , qemu-devel@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Marc-André Lureau Signed-off-by: Marc-André Lureau Signed-off-by: Philippe Mathieu-Daudé [PMD: more changes] --- monitor.c | 14 +++++++------- qmp.c | 14 +++++++------- tests/test-qmp-commands.c | 14 +++++++------- 3 files changed, 21 insertions(+), 21 deletions(-) diff --git a/monitor.c b/monitor.c index fe0d1bdbb4..ea6a485f11 100644 --- a/monitor.c +++ b/monitor.c @@ -906,7 +906,7 @@ static void query_commands_cb(QmpCommand *cmd, void *opaque) return; } - info = g_malloc0(sizeof(*info)); + info = g_new0(CommandInfoList, 1); info->value = g_malloc0(sizeof(*info->value)); info->value->name = g_strdup(cmd->name); info->next = *list; @@ -1799,7 +1799,7 @@ static void hmp_wavcapture(Monitor *mon, const QDict *qdict) int nchannels = qdict_get_try_int(qdict, "nchannels", -1); CaptureState *s; - s = g_malloc0 (sizeof (*s)); + s = g_new0(CaptureState, 1); freq = has_freq ? freq : 44100; bits = has_bits ? bits : 16; @@ -1947,7 +1947,7 @@ void qmp_getfd(const char *fdname, Error **errp) return; } - monfd = g_malloc0(sizeof(mon_fd_t)); + monfd = g_new0(mon_fd_t, 1); monfd->name = g_strdup(fdname); monfd->fd = fd; @@ -2110,7 +2110,7 @@ FdsetInfoList *qmp_query_fdsets(Error **errp) QLIST_FOREACH(mon_fdset_fd, &mon_fdset->fds, next) { FdsetFdInfoList *fdsetfd_info; - fdsetfd_info = g_malloc0(sizeof(*fdsetfd_info)); + fdsetfd_info = g_new0(FdsetFdInfoList, 1); fdsetfd_info->value = g_malloc0(sizeof(*fdsetfd_info->value)); fdsetfd_info->value->fd = mon_fdset_fd->fd; if (mon_fdset_fd->opaque) { @@ -2199,7 +2199,7 @@ AddfdInfo *monitor_fdset_add_fd(int fd, bool has_fdset_id, int64_t fdset_id, } } - mon_fdset_fd = g_malloc0(sizeof(*mon_fdset_fd)); + mon_fdset_fd = g_new0(MonFdsetFd, 1); mon_fdset_fd->fd = fd; mon_fdset_fd->removed = false; if (has_opaque) { @@ -2207,7 +2207,7 @@ AddfdInfo *monitor_fdset_add_fd(int fd, bool has_fdset_id, int64_t fdset_id, } QLIST_INSERT_HEAD(&mon_fdset->fds, mon_fdset_fd, next); - fdinfo = g_malloc0(sizeof(*fdinfo)); + fdinfo = g_new0(AddfdInfo, 1); fdinfo->fdset_id = mon_fdset->id; fdinfo->fd = mon_fdset_fd->fd; @@ -4102,7 +4102,7 @@ void monitor_init(Chardev *chr, int flags) is_first_init = 0; } - mon = g_malloc(sizeof(*mon)); + mon = g_new(Monitor, 1); monitor_data_init(mon); qemu_chr_fe_init(&mon->chr, chr, &error_abort); diff --git a/qmp.c b/qmp.c index e8c303116a..e965020e37 100644 --- a/qmp.c +++ b/qmp.c @@ -232,7 +232,7 @@ ObjectPropertyInfoList *qmp_qom_list(const char *path, Error **errp) while ((prop = object_property_iter_next(&iter))) { ObjectPropertyInfoList *entry = g_malloc0(sizeof(*entry)); - entry->value = g_malloc0(sizeof(ObjectPropertyInfo)); + entry->value = g_new0(ObjectPropertyInfo, 1); entry->next = props; props = entry; @@ -432,7 +432,7 @@ static void qom_list_types_tramp(ObjectClass *klass, void *data) ObjectTypeInfo *info; ObjectClass *parent = object_class_get_parent(klass); - info = g_malloc0(sizeof(*info)); + info = g_new0(ObjectTypeInfo, 1); info->name = g_strdup(object_class_get_name(klass)); info->has_abstract = info->abstract = object_class_is_abstract(klass); if (parent) { @@ -440,7 +440,7 @@ static void qom_list_types_tramp(ObjectClass *klass, void *data) info->parent = g_strdup(object_class_get_name(parent)); } - e = g_malloc0(sizeof(*e)); + e = g_new0(ObjectTypeInfoList, 1); e->value = info; e->next = *pret; *pret = e; @@ -490,7 +490,7 @@ static DevicePropertyInfo *make_device_property_info(ObjectClass *klass, return NULL; /* no way to set it, don't show */ } - info = g_malloc0(sizeof(*info)); + info = g_new0(DevicePropertyInfo, 1); info->name = g_strdup(prop->name); info->type = default_type ? g_strdup(default_type) : g_strdup(prop->info->name); @@ -502,7 +502,7 @@ static DevicePropertyInfo *make_device_property_info(ObjectClass *klass, } while (klass != object_class_by_name(TYPE_DEVICE)); /* Not a qdev property, use the default type */ - info = g_malloc0(sizeof(*info)); + info = g_new0(DevicePropertyInfo, 1); info->name = g_strdup(name); info->type = g_strdup(default_type); info->has_description = !!description; @@ -568,7 +568,7 @@ DevicePropertyInfoList *qmp_device_list_properties(const char *typename, continue; } - entry = g_malloc0(sizeof(*entry)); + entry = g_new0(DevicePropertyInfoList, 1); entry->value = info; entry->next = prop_list; prop_list = entry; @@ -712,7 +712,7 @@ ACPIOSTInfoList *qmp_query_acpi_ospm_status(Error **errp) MemoryInfo *qmp_query_memory_size_summary(Error **errp) { - MemoryInfo *mem_info = g_malloc0(sizeof(MemoryInfo)); + MemoryInfo *mem_info = g_new0(MemoryInfo, 1); mem_info->base_memory = ram_size; diff --git a/tests/test-qmp-commands.c b/tests/test-qmp-commands.c index 904c89d4d4..e715c45a23 100644 --- a/tests/test-qmp-commands.c +++ b/tests/test-qmp-commands.c @@ -28,8 +28,8 @@ UserDefTwo *qmp_user_def_cmd2(UserDefOne *ud1a, Error **errp) { UserDefTwo *ret; - UserDefOne *ud1c = g_malloc0(sizeof(UserDefOne)); - UserDefOne *ud1d = g_malloc0(sizeof(UserDefOne)); + UserDefOne *ud1c = g_new0(UserDefOne, 1); + UserDefOne *ud1d = g_new0(UserDefOne, 1); ud1c->string = strdup(ud1a->string); ud1c->integer = ud1a->integer; @@ -209,23 +209,23 @@ static void test_dealloc_types(void) UserDefOne *ud1test, *ud1a, *ud1b; UserDefOneList *ud1list; - ud1test = g_malloc0(sizeof(UserDefOne)); + ud1test = g_new0(UserDefOne, 1); ud1test->integer = 42; ud1test->string = g_strdup("hi there 42"); qapi_free_UserDefOne(ud1test); - ud1a = g_malloc0(sizeof(UserDefOne)); + ud1a = g_new0(UserDefOne, 1); ud1a->integer = 43; ud1a->string = g_strdup("hi there 43"); - ud1b = g_malloc0(sizeof(UserDefOne)); + ud1b = g_new0(UserDefOne, 1); ud1b->integer = 44; ud1b->string = g_strdup("hi there 44"); - ud1list = g_malloc0(sizeof(UserDefOneList)); + ud1list = g_new0(UserDefOneList, 1); ud1list->value = ud1a; - ud1list->next = g_malloc0(sizeof(UserDefOneList)); + ud1list->next = g_new0(UserDefOneList, 1); ud1list->next->value = ud1b; qapi_free_UserDefOneList(ud1list); From patchwork Fri Oct 6 23:49:27 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 822806 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="G7YGO/we"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3y86Xh3GGyz9sNV for ; Sat, 7 Oct 2017 11:17:56 +1100 (AEDT) Received: from localhost ([::1]:47674 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e0coU-0004h1-Eo for incoming@patchwork.ozlabs.org; Fri, 06 Oct 2017 20:17:54 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41621) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e0cPp-0008JC-2e for qemu-devel@nongnu.org; Fri, 06 Oct 2017 19:52:26 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e0cPo-0005r9-1n for qemu-devel@nongnu.org; Fri, 06 Oct 2017 19:52:25 -0400 Received: from mail-qk0-x243.google.com ([2607:f8b0:400d:c09::243]:37981) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1e0cPn-0005r1-TO; Fri, 06 Oct 2017 19:52:23 -0400 Received: by mail-qk0-x243.google.com with SMTP id 17so5918263qkq.5; Fri, 06 Oct 2017 16:52:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=3qUa7/KSXIzXArKF8GKr+VoGLv9fgCRzdz+hLRUy2J0=; b=G7YGO/weNeg7ZTSg/WqjgBzr623UvTLuWn/7s7Jzg4pLP115u9xn6zGPFwTpo40aKA z/EdE3BjK4dCnFxbPqNTr9d1IA+Et21qJqtKIuzYKNRaGM0JbXbn6100bbC/kFBFvDjG LEYCvmcFtVCOCmeXEYmKX36KMxem/vYsm80IznaYHs9DUacyEpA/f+3b3BXbk9eb+XQn WCwjvqvjN+CN4aAOGcLbCo7rlFVGjh9al9x67o0YFZZ9IQjOfwguDh2lHy7RfZPeakcC 8io2LMxFJvFdpHTQ0dVWtCbucZ9Rl0nLthCxpAamnHR7C2VppwXCSXnCp+RFAOpF/87r zSCQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=3qUa7/KSXIzXArKF8GKr+VoGLv9fgCRzdz+hLRUy2J0=; b=H1M5GSyiWpduM+XPptpDyY7buW8IlkrZ9H807yWmWYWttDwiwzlEBhrl8/XSq2uToi nw8CwmG32Zq/0fP5g6pXClmW0l8soMYCGQ26VUCvAFf8T6A40j5MbdPo6GHNfOqj3sfy TvQN+r81IbkVrdN1BP0YgZ7NZ2GP9jKxKQ8ODSTh0OjI474mpAE6VQISnhRseaVMTiX0 WF0p6BNNTN0PqDqPO37ZD8fqXEoCX/uDg1nWEb9+53nFiZpoMqqcaq1FdqJS32NAWGVt jpJ2nitH249iUJHVRx6dDKANkOs7kjV27lhPj4hcc8GGm57NwzxQDHnZEMYavwM0bbYQ 8agw== X-Gm-Message-State: AMCzsaWWWI2c6ELcsRIsUf9vRiRTUtJji3dO1mhEyG18FZ1sGjVNlqZz x4DXT4Tyl2vTx+YOhp4LfpQ= X-Google-Smtp-Source: AOwi7QDNinc70URGUgowrWXzmqgGbRHjDQYKuN31LGEKiCXR+9/h2MwptUliVTuRQCJN3hVOV2Ek3w== X-Received: by 10.55.100.67 with SMTP id y64mr731336qkb.252.1507333943328; Fri, 06 Oct 2017 16:52:23 -0700 (PDT) Received: from yoga.lan ([181.93.89.178]) by smtp.gmail.com with ESMTPSA id g1sm1705226qta.95.2017.10.06.16.52.20 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 06 Oct 2017 16:52:22 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Markus Armbruster , Eric Blake Date: Fri, 6 Oct 2017 20:49:27 -0300 Message-Id: <20171006235023.11952-33-f4bug@amsat.org> X-Mailer: git-send-email 2.14.2 In-Reply-To: <20171006235023.11952-1-f4bug@amsat.org> References: <20171006235023.11952-1-f4bug@amsat.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c09::243 Subject: [Qemu-devel] [PATCH 32/88] QObject: use g_new() family of functions X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , qemu trival , qemu-devel@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Marc-André Lureau Signed-off-by: Marc-André Lureau Signed-off-by: Philippe Mathieu-Daudé [PMD: added qbool.c, qdict.c, qlist.c, qstring.c and tests/] --- qobject/json-parser.c | 2 +- qobject/qbool.c | 2 +- qobject/qdict.c | 4 ++-- qobject/qlist.c | 4 ++-- qobject/qstring.c | 2 +- tests/test-qobject-output-visitor.c | 4 ++-- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/qobject/json-parser.c b/qobject/json-parser.c index 724ca240e4..37dda9bc3f 100644 --- a/qobject/json-parser.c +++ b/qobject/json-parser.c @@ -247,7 +247,7 @@ static JSONParserContext *parser_context_new(GQueue *tokens) return NULL; } - ctxt = g_malloc0(sizeof(JSONParserContext)); + ctxt = g_new0(JSONParserContext, 1); ctxt->buf = tokens; return ctxt; diff --git a/qobject/qbool.c b/qobject/qbool.c index 0606bbd2a3..5ad7f6d98f 100644 --- a/qobject/qbool.c +++ b/qobject/qbool.c @@ -25,7 +25,7 @@ QBool *qbool_from_bool(bool value) { QBool *qb; - qb = g_malloc(sizeof(*qb)); + qb = g_new(QBool, 1); qobject_init(QOBJECT(qb), QTYPE_QBOOL); qb->value = value; diff --git a/qobject/qdict.c b/qobject/qdict.c index 576018e531..857e71c7a1 100644 --- a/qobject/qdict.c +++ b/qobject/qdict.c @@ -30,7 +30,7 @@ QDict *qdict_new(void) { QDict *qdict; - qdict = g_malloc0(sizeof(*qdict)); + qdict = g_new0(QDict, 1); qobject_init(QOBJECT(qdict), QTYPE_QDICT); return qdict; @@ -70,7 +70,7 @@ static QDictEntry *alloc_entry(const char *key, QObject *value) { QDictEntry *entry; - entry = g_malloc0(sizeof(*entry)); + entry = g_new0(QDictEntry, 1); entry->key = g_strdup(key); entry->value = value; diff --git a/qobject/qlist.c b/qobject/qlist.c index 86b60cb88c..8afc594d0d 100644 --- a/qobject/qlist.c +++ b/qobject/qlist.c @@ -25,7 +25,7 @@ QList *qlist_new(void) { QList *qlist; - qlist = g_malloc(sizeof(*qlist)); + qlist = g_new(QList, 1); qobject_init(QOBJECT(qlist), QTYPE_QLIST); QTAILQ_INIT(&qlist->head); @@ -58,7 +58,7 @@ void qlist_append_obj(QList *qlist, QObject *value) { QListEntry *entry; - entry = g_malloc(sizeof(*entry)); + entry = g_new(QListEntry, 1); entry->value = value; QTAILQ_INSERT_TAIL(&qlist->head, entry, next); diff --git a/qobject/qstring.c b/qobject/qstring.c index 5da7b5f37c..806c0306a2 100644 --- a/qobject/qstring.c +++ b/qobject/qstring.c @@ -42,7 +42,7 @@ QString *qstring_from_substr(const char *str, int start, int end) { QString *qstring; - qstring = g_malloc(sizeof(*qstring)); + qstring = g_new(QString, 1); qobject_init(QOBJECT(qstring), QTYPE_QSTRING); qstring->length = end - start + 1; diff --git a/tests/test-qobject-output-visitor.c b/tests/test-qobject-output-visitor.c index d375100a52..d0a66a5dca 100644 --- a/tests/test-qobject-output-visitor.c +++ b/tests/test-qobject-output-visitor.c @@ -182,7 +182,7 @@ static void test_visitor_out_struct_nested(TestOutputVisitorData *data, const char *strings[] = { "forty two", "forty three", "forty four", "forty five" }; - ud2 = g_malloc0(sizeof(*ud2)); + ud2 = g_new0(UserDefTwo, 1); ud2->string0 = g_strdup(strings[0]); ud2->dict1 = g_malloc0(sizeof(*ud2->dict1)); @@ -372,7 +372,7 @@ static void test_visitor_out_union_flat(TestOutputVisitorData *data, { QDict *qdict; - UserDefFlatUnion *tmp = g_malloc0(sizeof(UserDefFlatUnion)); + UserDefFlatUnion *tmp = g_new0(UserDefFlatUnion, 1); tmp->enum1 = ENUM_ONE_VALUE1; tmp->string = g_strdup("str"); tmp->integer = 41; From patchwork Fri Oct 6 23:49:28 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 822810 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="FT2YQ7du"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3y86b60Twxz9t4P for ; Sat, 7 Oct 2017 11:20:01 +1100 (AEDT) Received: from localhost ([::1]:47681 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e0cqV-0006PR-TM for incoming@patchwork.ozlabs.org; Fri, 06 Oct 2017 20:19:59 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41662) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e0cPr-0008M1-Mj for qemu-devel@nongnu.org; Fri, 06 Oct 2017 19:52:28 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e0cPr-0005st-2x for qemu-devel@nongnu.org; Fri, 06 Oct 2017 19:52:27 -0400 Received: from mail-qk0-x241.google.com ([2607:f8b0:400d:c09::241]:35185) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1e0cPq-0005sZ-Uq; Fri, 06 Oct 2017 19:52:27 -0400 Received: by mail-qk0-x241.google.com with SMTP id w63so11296826qkd.2; Fri, 06 Oct 2017 16:52:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=qSsYwGBDhOG0EOPT15FYleiqNzHu/SJyAYtKkbVTKEY=; b=FT2YQ7dulQWIibEXnC6NZYi/0/JRzaFkqVrhI+frltOm9YZOMvlnL0YmcaSLg2D0vE JOaRaVzM4sIv0gIvkmnKI3SFDZstw06Z5jlq69zhtxMcVAeQEL3aW2ujNwu+R1B9NaGM +N3oC7ATs5icHIrg6/gEYwklb6hZTXoezrKxzIGJmLu2n2suCcv3UROuA01amUAomVvp z7KOuGo8OVpyOUFYqj5DrMIP3TLlXyLToWy6yEd6RPojs+cbfJO8UejXWFLE+IYobwRk /69IkcBXWrxWMoE0MjMm4a8teJa135kditXPZ0OJbfSOPOLf1jJSe5X/ik/wM6DI+uZ/ VbjQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=qSsYwGBDhOG0EOPT15FYleiqNzHu/SJyAYtKkbVTKEY=; b=UxoLGZoJnxmOnpWroFHzBBzzmDUIJbD3d2HyjJ0gerBVjT9ruZz171NZgsoH7rNK8g 9kkgq1VvpY1g6y2DiC7ofvWSORNp3YdDJW4YJjjXE1lw9ZrR0zz9J86CwPC8MfIKlX1l LhSOGxUeHjqNxmvQVEWm+o3b9ekuDgBtvwWyXgas0Dj/8d+kpYXJxJMkif81+Fac1FnQ hVFdoiVfSXravKhi0tRyX1EMUZJBKLtuNtFacwaI2a4ZPgP9q5wIu8bcGtNh5MUaQxk9 dMH+EvWSxO5iuSbslw0o4/0PHR95RlH9g6Z4MUMinuSeoPFD0BGCVmsbFQ5S5saGOReq C1ig== X-Gm-Message-State: AMCzsaUanwrPLEnm3h10/mYv124vx4eDYcqXbvko8GE01I4ir/MNZat7 W03R0qMNfx3onHwcwgegQvQ= X-Google-Smtp-Source: AOwi7QDiVGhtKET1F85WjPm5ETPZgqpj/uPGe2lN33hjJS/iLdu75a96YeVDEGblYaiu8lqErQaRxw== X-Received: by 10.55.197.20 with SMTP id p20mr679920qki.229.1507333946414; Fri, 06 Oct 2017 16:52:26 -0700 (PDT) Received: from yoga.lan ([181.93.89.178]) by smtp.gmail.com with ESMTPSA id g1sm1705226qta.95.2017.10.06.16.52.23 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 06 Oct 2017 16:52:25 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Markus Armbruster , Eric Blake , =?utf-8?q?Andreas_F=C3=A4rber?= Date: Fri, 6 Oct 2017 20:49:28 -0300 Message-Id: <20171006235023.11952-34-f4bug@amsat.org> X-Mailer: git-send-email 2.14.2 In-Reply-To: <20171006235023.11952-1-f4bug@amsat.org> References: <20171006235023.11952-1-f4bug@amsat.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c09::241 Subject: [Qemu-devel] [PATCH 33/88] qom: use g_new() family of functions X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , qemu trival , =?utf-8?q?Philippe_Mathieu-Dau?= =?utf-8?b?ZMOp?= , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Philippe Mathieu-Daudé --- qom/object.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/qom/object.c b/qom/object.c index 6a7bd9257b..3273f9c1f0 100644 --- a/qom/object.c +++ b/qom/object.c @@ -940,7 +940,7 @@ object_property_add(Object *obj, const char *name, const char *type, return NULL; } - prop = g_malloc0(sizeof(*prop)); + prop = g_new0(ObjectProperty, 1); prop->name = g_strdup(name); prop->type = g_strdup(type); @@ -973,7 +973,7 @@ object_class_property_add(ObjectClass *klass, return NULL; } - prop = g_malloc0(sizeof(*prop)); + prop = g_new0(ObjectProperty, 1); prop->name = g_strdup(name); prop->type = g_strdup(type); @@ -2281,7 +2281,7 @@ void object_property_add_alias(Object *obj, const char *name, prop_type = g_strdup(target_prop->type); } - prop = g_malloc(sizeof(*prop)); + prop = g_new(AliasProperty, 1); prop->target_obj = target_obj; prop->target_name = g_strdup(target_name); From patchwork Fri Oct 6 23:49:29 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 822811 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="e9Tzfqdu"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3y86cK532Cz9t4P for ; Sat, 7 Oct 2017 11:21:05 +1100 (AEDT) Received: from localhost ([::1]:47689 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e0crU-0007VS-NF for incoming@patchwork.ozlabs.org; Fri, 06 Oct 2017 20:21:00 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41706) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e0cPx-0008Rf-69 for qemu-devel@nongnu.org; Fri, 06 Oct 2017 19:52:35 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e0cPu-0005uN-4O for qemu-devel@nongnu.org; Fri, 06 Oct 2017 19:52:33 -0400 Received: from mail-qt0-x243.google.com ([2607:f8b0:400d:c0d::243]:51468) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1e0cPu-0005uE-0E; Fri, 06 Oct 2017 19:52:30 -0400 Received: by mail-qt0-x243.google.com with SMTP id q4so34330598qtq.8; Fri, 06 Oct 2017 16:52:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=sEAV8iV9XD7HgeDf6osItPPW50MKgd+mg69ytT74yhA=; b=e9TzfqdutZffBA7z95ynulVum53IqpYN0d4pseKvcT3v8+PKONTxko5iuCl39jWn7d I7xRww4ZN3bRjt95bWlwqSkHPkCjXg2TbWEC9X+n5XYHsheS3bmRRxg64lm6aY/MBRdE vrNCnKqMbcYK4N2Rl0CW6KIBWd6vXKgQQPBABHhsRP52gqdtD5sQbNeFrEEc4+JCz0gm +BIVlfnL+7ZzPHDaGXFqsoDxW+koroBscj/3p7hXDSbnnCS461L75kCrsYWekt+aCJx4 Hd2NI/k4sQnsp/lHdysHbcGMm2drsctQx1irQBRluLLhnLvvD2v4HxjwkzP8XrlHBTUD OFOQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=sEAV8iV9XD7HgeDf6osItPPW50MKgd+mg69ytT74yhA=; b=V/jNApSI/o9eQVHx161X0nETRZBItj12prGxuO+5NCYr1lpdZH+e2d9AJsC7D7M/NW 6Pa/tTNJZKpKqHkC+AoHe3PtjY5gzHiwEXdoIl9ekr6HPhvMfb+QozVWRwIBtD929bGJ XPEEJxVV4oPDzudfXVprRCyf2nnlTAdwYsEHOHJ/dpXs5LWWfmk6LH8aAkZipb3pOmKa jS6r7YePWIoIKuzQRJAP/tFE7eWs4Q0GYyEqZNwymID8oTg7YhfbmAKIiyjeLlHfhIn0 VNb4AAfNKptBrs1777ZdnPOxX+25Q3IZcTyIHnDj/cU25XT91iUCMfqC3QobMbKB5i+y lijw== X-Gm-Message-State: AMCzsaWUD5rANpFz+rzi7sj8Cff2TsizNeTMPxgbSRTk5MB2w8blWoG8 W+6GSLO+KHrkHwaUOJ6rWaY= X-Google-Smtp-Source: AOwi7QAdVI+FdZoSwM1LMcEj0hp415IRnlakh35/uqNOA1zdEyZtovYUgve3sU1qGl6tP8ugb0rq8w== X-Received: by 10.237.36.125 with SMTP id s58mr5558081qtc.24.1507333949465; Fri, 06 Oct 2017 16:52:29 -0700 (PDT) Received: from yoga.lan ([181.93.89.178]) by smtp.gmail.com with ESMTPSA id g1sm1705226qta.95.2017.10.06.16.52.26 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 06 Oct 2017 16:52:28 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Markus Armbruster , Eric Blake , Michael Roth Date: Fri, 6 Oct 2017 20:49:29 -0300 Message-Id: <20171006235023.11952-35-f4bug@amsat.org> X-Mailer: git-send-email 2.14.2 In-Reply-To: <20171006235023.11952-1-f4bug@amsat.org> References: <20171006235023.11952-1-f4bug@amsat.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c0d::243 Subject: [Qemu-devel] [PATCH 34/88] qapi: use g_new() family of functions X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , qemu trival , =?utf-8?q?Philippe_Mathieu-Dau?= =?utf-8?b?ZMOp?= , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Philippe Mathieu-Daudé --- qapi/opts-visitor.c | 2 +- qapi/qapi-clone-visitor.c | 2 +- qapi/qapi-dealloc-visitor.c | 2 +- qapi/qobject-output-visitor.c | 2 +- qapi/string-input-visitor.c | 2 +- qapi/string-output-visitor.c | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/qapi/opts-visitor.c b/qapi/opts-visitor.c index 324b197495..34ac49f3c2 100644 --- a/qapi/opts-visitor.c +++ b/qapi/opts-visitor.c @@ -539,7 +539,7 @@ opts_visitor_new(const QemuOpts *opts) OptsVisitor *ov; assert(opts); - ov = g_malloc0(sizeof *ov); + ov = g_new0(OptsVisitor, 1); ov->visitor.type = VISITOR_INPUT; diff --git a/qapi/qapi-clone-visitor.c b/qapi/qapi-clone-visitor.c index d8b62792bc..3d216e5906 100644 --- a/qapi/qapi-clone-visitor.c +++ b/qapi/qapi-clone-visitor.c @@ -145,7 +145,7 @@ static Visitor *qapi_clone_visitor_new(void) { QapiCloneVisitor *v; - v = g_malloc0(sizeof(*v)); + v = g_new0(QapiCloneVisitor, 1); v->visitor.type = VISITOR_CLONE; v->visitor.start_struct = qapi_clone_start_struct; diff --git a/qapi/qapi-dealloc-visitor.c b/qapi/qapi-dealloc-visitor.c index ed70a0158b..ad0d0eb7e4 100644 --- a/qapi/qapi-dealloc-visitor.c +++ b/qapi/qapi-dealloc-visitor.c @@ -120,7 +120,7 @@ Visitor *qapi_dealloc_visitor_new(void) { QapiDeallocVisitor *v; - v = g_malloc0(sizeof(*v)); + v = g_new0(QapiDeallocVisitor, 1); v->visitor.type = VISITOR_DEALLOC; v->visitor.start_struct = qapi_dealloc_start_struct; diff --git a/qapi/qobject-output-visitor.c b/qapi/qobject-output-visitor.c index d325163e55..7228986c0c 100644 --- a/qapi/qobject-output-visitor.c +++ b/qapi/qobject-output-visitor.c @@ -229,7 +229,7 @@ Visitor *qobject_output_visitor_new(QObject **result) { QObjectOutputVisitor *v; - v = g_malloc0(sizeof(*v)); + v = g_new0(QObjectOutputVisitor, 1); v->visitor.type = VISITOR_OUTPUT; v->visitor.start_struct = qobject_output_start_struct; diff --git a/qapi/string-input-visitor.c b/qapi/string-input-visitor.c index 67a0a4a58b..3a2fe58478 100644 --- a/qapi/string-input-visitor.c +++ b/qapi/string-input-visitor.c @@ -356,7 +356,7 @@ Visitor *string_input_visitor_new(const char *str) StringInputVisitor *v; assert(str); - v = g_malloc0(sizeof(*v)); + v = g_new0(StringInputVisitor, 1); v->visitor.type = VISITOR_INPUT; v->visitor.type_int64 = parse_type_int64; diff --git a/qapi/string-output-visitor.c b/qapi/string-output-visitor.c index 7ab64468d9..a7bbbae109 100644 --- a/qapi/string-output-visitor.c +++ b/qapi/string-output-visitor.c @@ -341,7 +341,7 @@ Visitor *string_output_visitor_new(bool human, char **result) { StringOutputVisitor *v; - v = g_malloc0(sizeof(*v)); + v = g_new0(StringOutputVisitor, 1); v->string = g_string_new(NULL); v->human = human; From patchwork Fri Oct 6 23:49:30 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 822801 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="fskHiP1W"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3y86SP4JS3z9t3R for ; Sat, 7 Oct 2017 11:14:13 +1100 (AEDT) Received: from localhost ([::1]:47647 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e0ckt-0001Oh-HM for incoming@patchwork.ozlabs.org; Fri, 06 Oct 2017 20:14:11 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41716) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e0cPz-0008Ry-Md for qemu-devel@nongnu.org; Fri, 06 Oct 2017 19:52:36 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e0cPx-0005vK-7R for qemu-devel@nongnu.org; Fri, 06 Oct 2017 19:52:34 -0400 Received: from mail-qt0-x242.google.com ([2607:f8b0:400d:c0d::242]:52762) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1e0cPx-0005vC-2i; Fri, 06 Oct 2017 19:52:33 -0400 Received: by mail-qt0-x242.google.com with SMTP id o52so34324241qtc.9; Fri, 06 Oct 2017 16:52:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=bw7665vpljTXEkTpy+0QhVuCAEzaJ+jXXbYxz5ZxUMo=; b=fskHiP1WnzTe2UAIltLkhg+glt3D63bhriP0K31lJ0dn9FNud7+LMIXaoTE/bo2VC2 JQEv1/z7zZDu9kA0EuIxNd1czJSLEScaDqKNLdeWf2YJc2YNIQKAAWHWlezYmqAM7sd/ cU9cp8fGMWlmnz6MDH2y1vZI48MfjbiCNmFJS9r0Nplvy9xkmijLCEQabPmc3grbc/Jx Zv971bKfs1pCeYozWgD3AQpwE6Vv9R9MVCDFnW3wCfOscbWuwTqpmB+YPwRYAnbY9dPi HiVH5eybFdpPjupU7aPtPbNQNfqjEjzRxVOMjtEHGyx9clg8IB33oddUSLn8YTjaOr53 3pLw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=bw7665vpljTXEkTpy+0QhVuCAEzaJ+jXXbYxz5ZxUMo=; b=RaVaFmoXhLOCmmIpSzdhjuMfTrruzMx1XCoLxXeRe4m+ND77xCVMqkOkoWz14GC9yh w6QIDQOpWgisOHKde4qD/Akat//VyIgmtQX0IgjfX6zYOyL6aUtzCZ2BUScM7aCzu3rc Rqna8VnP835/lTx7P76XFghxkLl2ZBMF77XE7jBfPwi09btFXc9bsNk7cw3016TaNJbK kq4Zbl8aVPgN43+CUzDjdxNftKK4Mcjls8PqArlIjo3btG0r4LonNpbmlK24P0ZfecQ1 cfeh79Aighpig8lqmnIbIzQuKgT0xtsOaCmFIOLppYIwGUecoK6ixDv7aYfmyn8gyxIU XTHQ== X-Gm-Message-State: AMCzsaVS2FXu4swI7Nz1ClGT0qUkjU3e4+OcPOqnAr2fmcKXZ4HDLQDl Be1F4Ma7TJ1mMTOH3dZsFuo= X-Google-Smtp-Source: AOwi7QAUHsFFevavnLr1++yXnx/Xrq/uiVb/ZPMSdRZBsLzjbe8We5HCWzO3D2YnHfAzgVfOWXyBZQ== X-Received: by 10.200.44.167 with SMTP id 36mr5580503qtw.285.1507333952537; Fri, 06 Oct 2017 16:52:32 -0700 (PDT) Received: from yoga.lan ([181.93.89.178]) by smtp.gmail.com with ESMTPSA id g1sm1705226qta.95.2017.10.06.16.52.29 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 06 Oct 2017 16:52:32 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Markus Armbruster , Eric Blake , Pavel Dovgalyuk , Paolo Bonzini Date: Fri, 6 Oct 2017 20:49:30 -0300 Message-Id: <20171006235023.11952-36-f4bug@amsat.org> X-Mailer: git-send-email 2.14.2 In-Reply-To: <20171006235023.11952-1-f4bug@amsat.org> References: <20171006235023.11952-1-f4bug@amsat.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c0d::242 Subject: [Qemu-devel] [PATCH 35/88] Record/replay: use g_new() family of functions X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , qemu trival , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Marc-André Lureau Signed-off-by: Marc-André Lureau --- replay/replay-char.c | 4 ++-- replay/replay-events.c | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/replay/replay-char.c b/replay/replay-char.c index cbf7c04a9f..b8ed5c51d1 100755 --- a/replay/replay-char.c +++ b/replay/replay-char.c @@ -51,7 +51,7 @@ void replay_register_char_driver(Chardev *chr) void replay_chr_be_write(Chardev *s, uint8_t *buf, int len) { - CharEvent *event = g_malloc0(sizeof(CharEvent)); + CharEvent *event = g_new0(CharEvent, 1); event->id = find_char_driver(s); if (event->id < 0) { @@ -86,7 +86,7 @@ void replay_event_char_read_save(void *opaque) void *replay_event_char_read_load(void) { - CharEvent *event = g_malloc0(sizeof(CharEvent)); + CharEvent *event = g_new0(CharEvent, 1); event->id = replay_get_byte(); replay_get_array_alloc(&event->buf, &event->len); diff --git a/replay/replay-events.c b/replay/replay-events.c index 94a6dcccfc..c72dcaa708 100644 --- a/replay/replay-events.c +++ b/replay/replay-events.c @@ -128,7 +128,7 @@ void replay_add_event(ReplayAsyncEventKind event_kind, return; } - Event *event = g_malloc0(sizeof(Event)); + Event *event = g_new0(Event, 1); event->event_kind = event_kind; event->opaque = opaque; event->opaque2 = opaque2; @@ -239,17 +239,17 @@ static Event *replay_read_event(int checkpoint) } break; case REPLAY_ASYNC_EVENT_INPUT: - event = g_malloc0(sizeof(Event)); + event = g_new0(Event, 1); event->event_kind = read_event_kind; event->opaque = replay_read_input_event(); return event; case REPLAY_ASYNC_EVENT_INPUT_SYNC: - event = g_malloc0(sizeof(Event)); + event = g_new0(Event, 1); event->event_kind = read_event_kind; event->opaque = 0; return event; case REPLAY_ASYNC_EVENT_CHAR_READ: - event = g_malloc0(sizeof(Event)); + event = g_new0(Event, 1); event->event_kind = read_event_kind; event->opaque = replay_event_char_read_load(); return event; @@ -259,7 +259,7 @@ static Event *replay_read_event(int checkpoint) } break; case REPLAY_ASYNC_EVENT_NET: - event = g_malloc0(sizeof(Event)); + event = g_new0(Event, 1); event->event_kind = read_event_kind; event->opaque = replay_event_net_load(); return event; From patchwork Fri Oct 6 23:49:31 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 822803 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="Rg+ct2S6"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3y86Vw0tJVz9t3t for ; Sat, 7 Oct 2017 11:16:24 +1100 (AEDT) Received: from localhost ([::1]:47666 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e0cn0-0003R9-1p for incoming@patchwork.ozlabs.org; Fri, 06 Oct 2017 20:16:22 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41740) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e0cQ1-0008TY-GQ for qemu-devel@nongnu.org; Fri, 06 Oct 2017 19:52:38 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e0cQ0-0005wr-Ji for qemu-devel@nongnu.org; Fri, 06 Oct 2017 19:52:37 -0400 Received: from mail-qt0-x241.google.com ([2607:f8b0:400d:c0d::241]:44694) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1e0cQ0-0005wO-FJ; Fri, 06 Oct 2017 19:52:36 -0400 Received: by mail-qt0-x241.google.com with SMTP id v28so25502053qtv.1; Fri, 06 Oct 2017 16:52:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=TgeM8heC72pKCa2LEBzGZITh7g8M1kaYV2N9WefszIc=; b=Rg+ct2S6KwvhxMwb43IUwykEeiOHAjU64093hUj71QPvRzJzvL7YuTAlY3B5wn4EFs A2/8XMKeGxWnjnuWGK+c7ewsgHeuH3DwEXX13w7ut7FOmJ0X8UuMtSFYlDBE9NVu1qD7 gU3oHsBDAe6Ss+2/CY7NQH7Dmvns/p+ZtKzPiUda5+bpUahPXu4KS+GC0YnWnWOn3l44 A3ZoYeJKOpgYPyKEKgRebgTyYlZlQDP2h8C5pDAOj01c+RzMtoh7P8j3tSZIECiIOo6Z o4giLpPLeTOGYsaeFjjj/SMpQNLlt5MVhJ8VNJzhbLwIuEKZ9ERdx0lAseSIQh4ZtgTZ Amgw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=TgeM8heC72pKCa2LEBzGZITh7g8M1kaYV2N9WefszIc=; b=W+veShh6YRgIhBcBJ+OTstOtDqO7ubjkIRzNaLcWqvvWJ7jK7eHEVWuBCaaKUaWgXJ xR/07itrXxq4HQhTltngvGQStrq7UHqOPH40dI21cXYc8bmM7vYIBSeOh+trWYQOXkL8 qVVu5r+0jijLolXPUMERHJm0jeUec8E1LwhzQVOUKm3iSeUsNoKrf3/5Xtnom60XOmUb cs1xJr661H97sUhdHImy3Mp0cf4FDS3VQ4dKLa4JXoszChU0BcgLLeoVz9cfSjTfuXX+ j3lgrvqEwx+coGHLJS/aMqSsWIIF0xQe9iPSrh7//9i17SY5acJOKifcQwyhLNGjtEP8 Mp7g== X-Gm-Message-State: AMCzsaXV5gA0nqmYosw5AhxYejBag7gy8SZEUh4MV9HIT+QARy7DCQvt a8pnNUaPbWQ27QYxlhB1Q68= X-Google-Smtp-Source: AOwi7QC0DFe3p/CD6LGIFMuCqW4mW4XAthlt+e84gkgWFUfX/7h2O1sbPaeAS1I1pgL/ar44fotNHg== X-Received: by 10.237.36.145 with SMTP id t17mr5205976qtc.162.1507333955909; Fri, 06 Oct 2017 16:52:35 -0700 (PDT) Received: from yoga.lan ([181.93.89.178]) by smtp.gmail.com with ESMTPSA id g1sm1705226qta.95.2017.10.06.16.52.32 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 06 Oct 2017 16:52:35 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Markus Armbruster , Eric Blake , Samuel Thibault , Jan Kiszka , Jason Wang Date: Fri, 6 Oct 2017 20:49:31 -0300 Message-Id: <20171006235023.11952-37-f4bug@amsat.org> X-Mailer: git-send-email 2.14.2 In-Reply-To: <20171006235023.11952-1-f4bug@amsat.org> References: <20171006235023.11952-1-f4bug@amsat.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c0d::241 Subject: [Qemu-devel] [PATCH 36/88] SLIRP: use g_new() family of functions X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , qemu trival , qemu-devel@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Marc-André Lureau Signed-off-by: Marc-André Lureau Signed-off-by: Philippe Mathieu-Daudé [PMD: added net/slirp.c] --- net/slirp.c | 4 ++-- slirp/slirp.c | 2 +- slirp/socket.c | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/net/slirp.c b/net/slirp.c index 318a26e892..c42e1fd0d0 100644 --- a/net/slirp.c +++ b/net/slirp.c @@ -869,7 +869,7 @@ net_init_slirp_configs(const StringList *fwd, int flags) while (fwd) { struct slirp_config_str *config; - config = g_malloc0(sizeof(*config)); + config = g_new0(struct slirp_config_str, 1); pstrcpy(config->str, sizeof(config->str), fwd->value->str); config->flags = flags; config->next = slirp_configs; @@ -973,7 +973,7 @@ int net_slirp_parse_legacy(QemuOptsList *opts_list, const char *optarg, int *ret if (QTAILQ_EMPTY(&slirp_stacks)) { struct slirp_config_str *config; - config = g_malloc(sizeof(*config)); + config = g_new(struct slirp_config_str, 1); pstrcpy(config->str, sizeof(config->str), optarg); config->flags = SLIRP_CFG_LEGACY; config->next = slirp_configs; diff --git a/slirp/slirp.c b/slirp/slirp.c index 1cb6b07004..9af9179afa 100644 --- a/slirp/slirp.c +++ b/slirp/slirp.c @@ -288,7 +288,7 @@ Slirp *slirp_init(int restricted, bool in_enabled, struct in_addr vnetwork, struct in6_addr vnameserver6, const char **vdnssearch, void *opaque) { - Slirp *slirp = g_malloc0(sizeof(Slirp)); + Slirp *slirp = g_new0(Slirp, 1); slirp_init_once(); diff --git a/slirp/socket.c b/slirp/socket.c index cb7b5b608d..2eccb68c2e 100644 --- a/slirp/socket.c +++ b/slirp/socket.c @@ -48,7 +48,7 @@ socreate(Slirp *slirp) { struct socket *so; - so = (struct socket *)malloc(sizeof(struct socket)); + so = g_new(struct socket, 1); if(so) { memset(so, 0, sizeof(struct socket)); so->so_state = SS_NOFDREF; From patchwork Fri Oct 6 23:49:32 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 822804 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="iUTEL3c8"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3y86Wl6nVCz9t3v for ; Sat, 7 Oct 2017 11:17:07 +1100 (AEDT) Received: from localhost ([::1]:47670 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e0cnh-000401-Rs for incoming@patchwork.ozlabs.org; Fri, 06 Oct 2017 20:17:05 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41790) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e0cQ6-00006s-Ij for qemu-devel@nongnu.org; Fri, 06 Oct 2017 19:52:44 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e0cQ3-00061p-W3 for qemu-devel@nongnu.org; Fri, 06 Oct 2017 19:52:42 -0400 Received: from mail-qk0-x242.google.com ([2607:f8b0:400d:c09::242]:34137) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1e0cQ3-00061R-Rd; Fri, 06 Oct 2017 19:52:39 -0400 Received: by mail-qk0-x242.google.com with SMTP id b124so10271806qke.1; Fri, 06 Oct 2017 16:52:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=M4IUFxRt43tOeleQ/oW6MuO4gBsc7lh2yeWA0NF33bg=; b=iUTEL3c8eWVb91OABhBwtGEQm04vpilaNKCqJiHidInOUUf3dAoUTnBMzh9UXXGLaZ x932PrO4SERgHuehgpRvNS8J2lEFBksh8lVM+otGMKih4F9DLaEebBSRw0h07MsbRFHV 1DOhU+zX52+9mPSmYEgccQD01AHTRSPmUjOx6NvaTRGG6IZGTbMhtd4bReYnka5UK7/X gnd636+Fq721H2kzxh8KtKGpDz3hr3bRbgq6goymWuZcgusvNXdu2sdAFkJfOf/BQ7lC 3C7R2UJ5G6jYvMccHiV/GnvupY0N4CaM2Y6sqJ+yG6XJfYY7wKBsc/GxJyiq96wHskw6 We9Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=M4IUFxRt43tOeleQ/oW6MuO4gBsc7lh2yeWA0NF33bg=; b=QRWxMPfHlPO8Vprb7GcU/7ujBmarYl27mCmcw4W8xim4M7LuFGeLASJmOYwscc2vHc umgwHsaekPnniB6fKFtrLy1CiPocTJXhHLdfVX6JWfqhXjP0dBlydSYymXAFUqPu+LTD 3xT6JPREDiANLr/L1tN73kBQ9o22w657C1GnuD0tADO1Rj8Kqn9752ilX4TQVT7Lwbir DMayXDDu3YOEHsoEmAkzgMTu6ARVPzL3+gHgr/BTfh814Z2SschzYBP4J0+uMmkUrqD9 vH9kffzpyn+OiWJuhZFuK1lWkEaoFzUoWnLRwLwfYBc1xzpUu8olDthrP5lxOJiPQwMV ptpA== X-Gm-Message-State: AMCzsaVd5tiJCT5TwfbBLcyQ8+rd+FPyeMwEzMNHynm7B7qO6IEzDYHg QMz2COcG4QdZ1lEi3/iuEcA= X-Google-Smtp-Source: AOwi7QAmS3cIH6a6Fg1iuKr/rHfs3SguHJ3n2PLMH1CzZvuctkmsMMBJLHCmx2szyPog6rGGuCE3sg== X-Received: by 10.55.91.69 with SMTP id p66mr692259qkb.167.1507333959328; Fri, 06 Oct 2017 16:52:39 -0700 (PDT) Received: from yoga.lan ([181.93.89.178]) by smtp.gmail.com with ESMTPSA id g1sm1705226qta.95.2017.10.06.16.52.36 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 06 Oct 2017 16:52:38 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Markus Armbruster , Eric Blake , Richard Henderson , Peter Crosthwaite , Paolo Bonzini Date: Fri, 6 Oct 2017 20:49:32 -0300 Message-Id: <20171006235023.11952-38-f4bug@amsat.org> X-Mailer: git-send-email 2.14.2 In-Reply-To: <20171006235023.11952-1-f4bug@amsat.org> References: <20171006235023.11952-1-f4bug@amsat.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c09::242 Subject: [Qemu-devel] [PATCH 37/88] TCG: use g_new() family of functions X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , qemu trival , qemu-devel@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Marc-André Lureau Signed-off-by: Marc-André Lureau Signed-off-by: Philippe Mathieu-Daudé [PMD: avoid use of g_malloc0() in cpus.c] --- cpus.c | 18 +++++++++--------- tcg/tcg.c | 4 ++-- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/cpus.c b/cpus.c index c9a624003a..6dea1c7041 100644 --- a/cpus.c +++ b/cpus.c @@ -1666,8 +1666,8 @@ static void qemu_tcg_init_vcpu(CPUState *cpu) static QemuThread *single_tcg_cpu_thread; if (qemu_tcg_mttcg_enabled() || !single_tcg_cpu_thread) { - cpu->thread = g_malloc0(sizeof(QemuThread)); - cpu->halt_cond = g_malloc0(sizeof(QemuCond)); + cpu->thread = g_new0(QemuThread, 1); + cpu->halt_cond = g_new0(QemuCond, 1); qemu_cond_init(cpu->halt_cond); if (qemu_tcg_mttcg_enabled()) { @@ -1706,8 +1706,8 @@ static void qemu_hax_start_vcpu(CPUState *cpu) { char thread_name[VCPU_THREAD_NAME_SIZE]; - cpu->thread = g_malloc0(sizeof(QemuThread)); - cpu->halt_cond = g_malloc0(sizeof(QemuCond)); + cpu->thread = g_new0(QemuThread, 1); + cpu->halt_cond = g_new0(QemuCond, 1); qemu_cond_init(cpu->halt_cond); snprintf(thread_name, VCPU_THREAD_NAME_SIZE, "CPU %d/HAX", @@ -1726,8 +1726,8 @@ static void qemu_kvm_start_vcpu(CPUState *cpu) { char thread_name[VCPU_THREAD_NAME_SIZE]; - cpu->thread = g_malloc0(sizeof(QemuThread)); - cpu->halt_cond = g_malloc0(sizeof(QemuCond)); + cpu->thread = g_new0(QemuThread, 1); + cpu->halt_cond = g_new0(QemuCond, 1); qemu_cond_init(cpu->halt_cond); snprintf(thread_name, VCPU_THREAD_NAME_SIZE, "CPU %d/KVM", cpu->cpu_index); @@ -1742,8 +1742,8 @@ static void qemu_dummy_start_vcpu(CPUState *cpu) { char thread_name[VCPU_THREAD_NAME_SIZE]; - cpu->thread = g_malloc0(sizeof(QemuThread)); - cpu->halt_cond = g_malloc0(sizeof(QemuCond)); + cpu->thread = g_new0(QemuThread, 1); + cpu->halt_cond = g_new0(QemuCond, 1); qemu_cond_init(cpu->halt_cond); snprintf(thread_name, VCPU_THREAD_NAME_SIZE, "CPU %d/DUMMY", cpu->cpu_index); @@ -1931,7 +1931,7 @@ CpuInfoList *qmp_query_cpus(Error **errp) info->value->has_props = !!mc->cpu_index_to_instance_props; if (info->value->has_props) { CpuInstanceProperties *props; - props = g_malloc0(sizeof(*props)); + props = g_malloc(sizeof(*props)); *props = mc->cpu_index_to_instance_props(ms, cpu->cpu_index); info->value->props = props; } diff --git a/tcg/tcg.c b/tcg/tcg.c index dff9999bc6..d5c1c75aa7 100644 --- a/tcg/tcg.c +++ b/tcg/tcg.c @@ -342,8 +342,8 @@ void tcg_context_init(TCGContext *s) total_args += n; } - args_ct = g_malloc(sizeof(TCGArgConstraint) * total_args); - sorted_args = g_malloc(sizeof(int) * total_args); + args_ct = g_new(TCGArgConstraint, total_args); + sorted_args = g_new(int, total_args); for(op = 0; op < NB_OPS; op++) { def = &tcg_op_defs[op]; From patchwork Fri Oct 6 23:49:33 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 822815 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="XKKYYne1"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3y86gV2RcNz9t4X for ; Sat, 7 Oct 2017 11:23:50 +1100 (AEDT) Received: from localhost ([::1]:47706 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e0cuC-0001aQ-BY for incoming@patchwork.ozlabs.org; Fri, 06 Oct 2017 20:23:48 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41818) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e0cQ8-00007g-LD for qemu-devel@nongnu.org; Fri, 06 Oct 2017 19:52:46 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e0cQ7-00065m-Al for qemu-devel@nongnu.org; Fri, 06 Oct 2017 19:52:44 -0400 Received: from mail-qt0-x242.google.com ([2607:f8b0:400d:c0d::242]:49209) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1e0cQ7-00065T-5m; Fri, 06 Oct 2017 19:52:43 -0400 Received: by mail-qt0-x242.google.com with SMTP id o3so34347178qte.6; Fri, 06 Oct 2017 16:52:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=R6xePZMLxKwxCP3mOIf6xlQLtUECVd5CGTbpHDOl3uw=; b=XKKYYne1OZGaYAp6QFkIJfejzMDWPnBWher4jYXGDuUKzmQiyx1knUnwSJjDPxoZhY OhR+/QCGR7zJFrf0pYhBC3kfluMBR1rAtGrV9en25STszj+1D7uNfD3lk4+KTVoaomad 1zUgwF8TDgEU4lUuIPoAjl6nMwFdTV3XFASM7xOdLXXZc582CdQNDgcKOM3KVNYxt/rY AyVZKkO6azmOc+FtgXUEs+KVl9oJqZAOYqYSfxFaB/FjneKC/tpS+JjsGUSSTeVWFEMz vAwvNtiNy2idPHvz9f81PppyHmnL7C0jEQMSDL0VXXSKUutMypJAfrWKPwlK42uq9+H8 mzqw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=R6xePZMLxKwxCP3mOIf6xlQLtUECVd5CGTbpHDOl3uw=; b=HkKnHlJrc23MGE6hu71HU1Jzg5NNG+l0NyZvPpI/AG29NlDz4Ca+hLS65sgCSAmaSm djb98Q1VYlAwd1W8Z6XJO3fC4eecWcASGaj7jzysVq3817dPlyBRwTCMw8DAyneojTlb nKbBf466GF6WwcESkwqNWAaOK8TK9a3FiVThI2EkaYxJm9hGWYQPMzr3quPyaM1Ggu+J aDJuSQgMFoucb3FXhNdlR8NMjxz6VJSNxOmh8JGLGqTJlD7IG/LtadDbOJgseVNOd2TI 9B0+sBeUWi73kRkOBSdPxj4Nzl5jReOwVJhUDhhG6LTb3a/67qZK5N/sJZUhoxuDHFEl /EfA== X-Gm-Message-State: AMCzsaVFogQUqZuNviYMxHlyHN4gxFatRAFdLImrS5D7mkfwOghn8Scp YoCewFLriJtZBLEAl6tDu6U= X-Google-Smtp-Source: AOwi7QDfyMxPWMusyiyt1Eyqi3vIwEyHl9cD+VakzCIBbdfmkNzhRsTBz1vn5i48xY/3o5PWuRjuoQ== X-Received: by 10.237.46.98 with SMTP id j89mr5831642qtd.182.1507333962575; Fri, 06 Oct 2017 16:52:42 -0700 (PDT) Received: from yoga.lan ([181.93.89.178]) by smtp.gmail.com with ESMTPSA id g1sm1705226qta.95.2017.10.06.16.52.39 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 06 Oct 2017 16:52:41 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Markus Armbruster , Eric Blake , Alex Williamson Date: Fri, 6 Oct 2017 20:49:33 -0300 Message-Id: <20171006235023.11952-39-f4bug@amsat.org> X-Mailer: git-send-email 2.14.2 In-Reply-To: <20171006235023.11952-1-f4bug@amsat.org> References: <20171006235023.11952-1-f4bug@amsat.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c0d::242 Subject: [Qemu-devel] [PATCH 38/88] VFIO: use g_new() family of functions X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , qemu trival , qemu-devel@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Marc-André Lureau Signed-off-by: Marc-André Lureau Signed-off-by: Philippe Mathieu-Daudé [PMD: more changes in each file, added pci-quirks.c] --- hw/vfio/common.c | 12 ++++++------ hw/vfio/pci-quirks.c | 18 +++++++++--------- hw/vfio/pci.c | 7 +++---- hw/vfio/platform.c | 6 +++--- 4 files changed, 21 insertions(+), 22 deletions(-) diff --git a/hw/vfio/common.c b/hw/vfio/common.c index 7b2924c0ef..bde4fdba66 100644 --- a/hw/vfio/common.c +++ b/hw/vfio/common.c @@ -272,7 +272,7 @@ static void vfio_host_win_add(VFIOContainer *container, } } - hostwin = g_malloc0(sizeof(*hostwin)); + hostwin = g_new0(VFIOHostDMAWindow, 1); hostwin->min_iova = min_iova; hostwin->max_iova = max_iova; @@ -488,7 +488,7 @@ static void vfio_listener_region_add(MemoryListener *listener, * would be the right place to wire that up (tell the KVM * device emulation the VFIO iommu handles to use). */ - giommu = g_malloc0(sizeof(*giommu)); + giommu = g_new0(VFIOGuestIOMMU, 1); giommu->iommu = iommu_mr; giommu->iommu_offset = section->offset_within_address_space - section->offset_within_region; @@ -688,7 +688,7 @@ static int vfio_setup_region_sparse_mmaps(VFIORegion *region, } region->nr_mmaps = j; - region->mmaps = g_realloc(region->mmaps, j * sizeof(VFIOMmap)); + region->mmaps = g_renew(VFIOMmap, region->mmaps, j); return 0; } @@ -938,7 +938,7 @@ static VFIOAddressSpace *vfio_get_address_space(AddressSpace *as) } /* No suitable VFIOAddressSpace, create a new one */ - space = g_malloc0(sizeof(*space)); + space = g_new0(VFIOAddressSpace, 1); space->as = as; QLIST_INIT(&space->containers); @@ -987,7 +987,7 @@ static int vfio_connect_container(VFIOGroup *group, AddressSpace *as, goto close_fd_exit; } - container = g_malloc0(sizeof(*container)); + container = g_new0(VFIOContainer, 1); container->space = space; container->fd = fd; if (ioctl(fd, VFIO_CHECK_EXTENSION, VFIO_TYPE1_IOMMU) || @@ -1202,7 +1202,7 @@ VFIOGroup *vfio_get_group(int groupid, AddressSpace *as, Error **errp) } } - group = g_malloc0(sizeof(*group)); + group = g_new0(VFIOGroup, 1); snprintf(path, sizeof(path), "/dev/vfio/%d", groupid); group->fd = qemu_open(path, O_RDWR); diff --git a/hw/vfio/pci-quirks.c b/hw/vfio/pci-quirks.c index 14291c2a16..b51ee60368 100644 --- a/hw/vfio/pci-quirks.c +++ b/hw/vfio/pci-quirks.c @@ -288,7 +288,7 @@ static void vfio_vga_probe_ati_3c3_quirk(VFIOPCIDevice *vdev) return; } - quirk = g_malloc0(sizeof(*quirk)); + quirk = g_new0(VFIOQuirk, 1); quirk->mem = g_new0(MemoryRegion, 1); quirk->nr_mem = 1; @@ -323,7 +323,7 @@ static void vfio_probe_ati_bar4_quirk(VFIOPCIDevice *vdev, int nr) return; } - quirk = g_malloc0(sizeof(*quirk)); + quirk = g_new0(VFIOQuirk, 1); quirk->mem = g_new0(MemoryRegion, 2); quirk->nr_mem = 2; window = quirk->data = g_malloc0(sizeof(*window) + @@ -371,7 +371,7 @@ static void vfio_probe_ati_bar2_quirk(VFIOPCIDevice *vdev, int nr) return; } - quirk = g_malloc0(sizeof(*quirk)); + quirk = g_new0(VFIOQuirk, 1); mirror = quirk->data = g_malloc0(sizeof(*mirror)); mirror->mem = quirk->mem = g_new0(MemoryRegion, 1); quirk->nr_mem = 1; @@ -547,7 +547,7 @@ static void vfio_vga_probe_nvidia_3d0_quirk(VFIOPCIDevice *vdev) return; } - quirk = g_malloc0(sizeof(*quirk)); + quirk = g_new0(VFIOQuirk, 1); quirk->data = data = g_malloc0(sizeof(*data)); quirk->mem = g_new0(MemoryRegion, 2); quirk->nr_mem = 2; @@ -665,7 +665,7 @@ static void vfio_probe_nvidia_bar5_quirk(VFIOPCIDevice *vdev, int nr) return; } - quirk = g_malloc0(sizeof(*quirk)); + quirk = g_new0(VFIOQuirk, 1); quirk->mem = g_new0(MemoryRegion, 4); quirk->nr_mem = 4; bar5 = quirk->data = g_malloc0(sizeof(*bar5) + @@ -759,7 +759,7 @@ static void vfio_probe_nvidia_bar0_quirk(VFIOPCIDevice *vdev, int nr) return; } - quirk = g_malloc0(sizeof(*quirk)); + quirk = g_new0(VFIOQuirk, 1); mirror = quirk->data = g_malloc0(sizeof(*mirror)); mirror->mem = quirk->mem = g_new0(MemoryRegion, 1); quirk->nr_mem = 1; @@ -942,7 +942,7 @@ static void vfio_probe_rtl8168_bar2_quirk(VFIOPCIDevice *vdev, int nr) return; } - quirk = g_malloc0(sizeof(*quirk)); + quirk = g_new0(VFIOQuirk, 1); quirk->mem = g_new0(MemoryRegion, 2); quirk->nr_mem = 2; quirk->data = rtl = g_malloc0(sizeof(*rtl)); @@ -1500,7 +1500,7 @@ static void vfio_probe_igd_bar4_quirk(VFIOPCIDevice *vdev, int nr) } /* Setup our quirk to munge GTT addresses to the VM allocated buffer */ - quirk = g_malloc0(sizeof(*quirk)); + quirk = g_new0(VFIOQuirk, 1); quirk->mem = g_new0(MemoryRegion, 2); quirk->nr_mem = 2; igd = quirk->data = g_malloc0(sizeof(*igd)); @@ -1553,7 +1553,7 @@ static void vfio_probe_igd_bar4_quirk(VFIOPCIDevice *vdev, int nr) * memory region must be written to the device BDSM regsiter at PCI * config offset 0x5C. */ - bdsm_size = g_malloc(sizeof(*bdsm_size)); + bdsm_size = g_new(uint64_t, 1); *bdsm_size = cpu_to_le64((ggms_mb + gms_mb) * 1024 * 1024); fw_cfg_add_file(fw_cfg_find(), "etc/igd-bdsm-size", bdsm_size, sizeof(*bdsm_size)); diff --git a/hw/vfio/pci.c b/hw/vfio/pci.c index 9e86db7c3b..15b82b2942 100644 --- a/hw/vfio/pci.c +++ b/hw/vfio/pci.c @@ -1395,7 +1395,7 @@ static void vfio_msix_early_setup(VFIOPCIDevice *vdev, Error **errp) table = le32_to_cpu(table); pba = le32_to_cpu(pba); - msix = g_malloc0(sizeof(*msix)); + msix = g_new0(VFIOMSIXInfo, 1); msix->table_bar = table & PCI_MSIX_FLAGS_BIRMASK; msix->table_offset = table & ~PCI_MSIX_FLAGS_BIRMASK; msix->pba_bar = pba & PCI_MSIX_FLAGS_BIRMASK; @@ -1437,8 +1437,7 @@ static int vfio_msix_setup(VFIOPCIDevice *vdev, int pos, Error **errp) int ret; Error *err = NULL; - vdev->msix->pending = g_malloc0(BITS_TO_LONGS(vdev->msix->entries) * - sizeof(unsigned long)); + vdev->msix->pending = g_new0(unsigned long, BITS_TO_LONGS(vdev->msix->entries)); ret = msix_init(&vdev->pdev, vdev->msix->entries, vdev->bars[vdev->msix->table_bar].region.mem, vdev->msix->table_bar, vdev->msix->table_offset, @@ -2076,7 +2075,7 @@ static int vfio_pci_hot_reset(VFIOPCIDevice *vdev, bool single) } vdev->vbasedev.needs_reset = false; - info = g_malloc0(sizeof(*info)); + info = g_new0(struct vfio_pci_hot_reset_info, 1); info->argsz = sizeof(*info); ret = ioctl(vdev->vbasedev.fd, VFIO_DEVICE_GET_PCI_HOT_RESET_INFO, info); diff --git a/hw/vfio/platform.c b/hw/vfio/platform.c index da84abf4fc..547225037f 100644 --- a/hw/vfio/platform.c +++ b/hw/vfio/platform.c @@ -55,7 +55,7 @@ static VFIOINTp *vfio_init_intp(VFIODevice *vbasedev, SysBusDevice *sbdev = SYS_BUS_DEVICE(vdev); VFIOINTp *intp; - intp = g_malloc0(sizeof(*intp)); + intp = g_new0(VFIOINTp, 1); intp->vdev = vdev; intp->pin = info.index; intp->flags = info.flags; @@ -65,7 +65,7 @@ static VFIOINTp *vfio_init_intp(VFIODevice *vbasedev, sysbus_init_irq(sbdev, &intp->qemuirq); /* Get an eventfd for trigger */ - intp->interrupt = g_malloc0(sizeof(EventNotifier)); + intp->interrupt = g_new0(EventNotifier, 1); ret = event_notifier_init(intp->interrupt, 0); if (ret) { g_free(intp->interrupt); @@ -76,7 +76,7 @@ static VFIOINTp *vfio_init_intp(VFIODevice *vbasedev, } if (vfio_irq_is_automasked(intp)) { /* Get an eventfd for resample/unmask */ - intp->unmask = g_malloc0(sizeof(EventNotifier)); + intp->unmask = g_new0(EventNotifier, 1); ret = event_notifier_init(intp->unmask, 0); if (ret) { g_free(intp->interrupt); From patchwork Fri Oct 6 23:49:34 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 822813 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="ZsqDiVrj"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3y86fR69QCz9t4P for ; Sat, 7 Oct 2017 11:22:55 +1100 (AEDT) Received: from localhost ([::1]:47701 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e0ctJ-0000ld-S6 for incoming@patchwork.ozlabs.org; Fri, 06 Oct 2017 20:22:53 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41909) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e0cQC-0000Bq-BR for qemu-devel@nongnu.org; Fri, 06 Oct 2017 19:52:51 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e0cQB-00068a-4r for qemu-devel@nongnu.org; Fri, 06 Oct 2017 19:52:48 -0400 Received: from mail-qk0-x241.google.com ([2607:f8b0:400d:c09::241]:37984) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1e0cQA-00068J-VZ; Fri, 06 Oct 2017 19:52:47 -0400 Received: by mail-qk0-x241.google.com with SMTP id 17so5918662qkq.5; Fri, 06 Oct 2017 16:52:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=mWBlA/8kNNj4bK9MiOeknzoRwI7C27fxPZ0OkZsU1zg=; b=ZsqDiVrjJ7ZLyx/DVaf4I1JnJbpfGT6S5HydxJTQJhkp7wzKjDh14ZhgKEC6Cl5l/2 g8vfcIzRidDtAmv090KtoHXVpgvRG3KKTaWfYdsBQqnxVKNVnIe2nKZhQyRUA3XV//wC rXCbPVBdT7nKMrAKq0gdsRC8l3wRc8OyBEMhSFqqkjzYyiTMPldwDHRt5IOjCbN8EHiT lzgLtYqrGtCtWceA/vI7HNtmqdmy7RT9h0VHOAtVI6HUSMu3JQCZ8fvELDLTepxYBc3X RpsDoPzZs+NMOH6mYDXN+R1Dm6ZIpdhw0rH3fw9rMmLe34hOx7K9b4+M46UT1Frvcxdl yX+A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=mWBlA/8kNNj4bK9MiOeknzoRwI7C27fxPZ0OkZsU1zg=; b=M4eIQzmUtg2UkuJkYXq9U4Bfzdnda6SoYCE+t5yvb8tFqvSR56Fhjz6gcmB2m1INQh 6826vZI/2PiznOoSWz3kMP1Gh0pA8V+OW8LAyUxhvQwmhSmRvlPO/hVeenzRkRJTbkh5 e2X3y7HgStadcXYQbxfSZWHdCEQDO0/dxFQ/7q4QspdSTvPNI5jRAw+AIV72J3dF66Iv dKwApxlvbbIAvapWqPqxe+EICxh8DqlDSwKC+/ylQ5QBPxnW214a30IQKoEcVmUru5ch rS4isbKlI+K6OJVDgsyzKXpgr9Jx+4xrxEvdyOAGHlS+1AsYLVFvvZMBP7H8n0NL0Bfl bMHg== X-Gm-Message-State: AMCzsaU0oIBbHlwtZuHl2eWOFOiJJTCMdK0fBOq/EZAJk/sZX0WUHYES ddoFrJtvSbYZwSGKgDpf95o= X-Google-Smtp-Source: AOwi7QCskJOCss6J7t5Fol9KGog+HMlqPoYk9ZyyvQDKpGWJdC1mBAWd81D352w+uEx4P4XCmBbgRA== X-Received: by 10.55.220.2 with SMTP id v2mr756455qki.64.1507333966382; Fri, 06 Oct 2017 16:52:46 -0700 (PDT) Received: from yoga.lan ([181.93.89.178]) by smtp.gmail.com with ESMTPSA id g1sm1705226qta.95.2017.10.06.16.52.42 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 06 Oct 2017 16:52:45 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Markus Armbruster , Eric Blake , "Michael S. Tsirkin" , Igor Mammedov , Paolo Bonzini , Richard Henderson , Eduardo Habkost Date: Fri, 6 Oct 2017 20:49:34 -0300 Message-Id: <20171006235023.11952-40-f4bug@amsat.org> X-Mailer: git-send-email 2.14.2 In-Reply-To: <20171006235023.11952-1-f4bug@amsat.org> References: <20171006235023.11952-1-f4bug@amsat.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c09::241 Subject: [Qemu-devel] [PATCH 39/88] hw/i386: use g_new() family of functions X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , qemu trival , qemu-devel@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Marc-André Lureau Signed-off-by: Marc-André Lureau Signed-off-by: Philippe Mathieu-Daudé [PMD: renamed PC -> hw/i386, split of target/i386/cpu.c, added more changes] --- hw/i386/acpi-build.c | 4 ++-- hw/i386/amd_iommu.c | 4 ++-- hw/i386/intel_iommu.c | 2 +- hw/i386/pc.c | 8 ++++---- hw/i386/pc_sysfw.c | 6 +++--- 5 files changed, 12 insertions(+), 12 deletions(-) diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c index 2af37a9129..1aff7b4d2f 100644 --- a/hw/i386/acpi-build.c +++ b/hw/i386/acpi-build.c @@ -777,7 +777,7 @@ static void crs_range_insert(GPtrArray *ranges, uint64_t base, uint64_t limit) { CrsRangeEntry *entry; - entry = g_malloc(sizeof(*entry)); + entry = g_new(CrsRangeEntry, 1); entry->base = base; entry->limit = limit; @@ -2877,7 +2877,7 @@ void acpi_setup(void) return; } - build_state = g_malloc0(sizeof *build_state); + build_state = g_new0(AcpiBuildState, 1); acpi_build_tables_init(&tables); acpi_build(&tables, MACHINE(pcms)); diff --git a/hw/i386/amd_iommu.c b/hw/i386/amd_iommu.c index 334938a280..f871025376 100644 --- a/hw/i386/amd_iommu.c +++ b/hw/i386/amd_iommu.c @@ -1033,13 +1033,13 @@ static AddressSpace *amdvi_host_dma_iommu(PCIBus *bus, void *opaque, int devfn) /* allocate memory during the first run */ if (!iommu_as) { - iommu_as = g_malloc0(sizeof(AMDVIAddressSpace *) * PCI_DEVFN_MAX); + iommu_as = g_new0(AMDVIAddressSpace *, PCI_DEVFN_MAX); s->address_spaces[bus_num] = iommu_as; } /* set up AMD-Vi region */ if (!iommu_as[devfn]) { - iommu_as[devfn] = g_malloc0(sizeof(AMDVIAddressSpace)); + iommu_as[devfn] = g_new0(AMDVIAddressSpace, 1); iommu_as[devfn]->bus_num = (uint8_t)bus_num; iommu_as[devfn]->devfn = (uint8_t)devfn; iommu_as[devfn]->iommu_state = s; diff --git a/hw/i386/intel_iommu.c b/hw/i386/intel_iommu.c index 3a5bb0bc2e..62c94008ad 100644 --- a/hw/i386/intel_iommu.c +++ b/hw/i386/intel_iommu.c @@ -2708,7 +2708,7 @@ VTDAddressSpace *vtd_find_add_as(IntelIOMMUState *s, PCIBus *bus, int devfn) if (!vtd_dev_as) { snprintf(name, sizeof(name), "intel_iommu_devfn_%d", devfn); - vtd_bus->dev_as[devfn] = vtd_dev_as = g_malloc0(sizeof(VTDAddressSpace)); + vtd_bus->dev_as[devfn] = vtd_dev_as = g_new0(VTDAddressSpace, 1); vtd_dev_as->bus = bus; vtd_dev_as->devfn = (uint8_t)devfn; diff --git a/hw/i386/pc.c b/hw/i386/pc.c index 05985d4927..393aefdc4c 100644 --- a/hw/i386/pc.c +++ b/hw/i386/pc.c @@ -1175,7 +1175,7 @@ static void pc_build_feature_control_file(PCMachineState *pcms) return; } - val = g_malloc(sizeof(*val)); + val = g_new(uint64_t, 1); *val = cpu_to_le64(feature_control_bits | FEATURE_CONTROL_LOCKED); fw_cfg_add_file(pcms->fw_cfg, "etc/msr_feature_control", val, sizeof(*val)); } @@ -1336,11 +1336,11 @@ void pc_memory_init(PCMachineState *pcms, * aliases to address portions of it, mostly for backwards compatibility * with older qemus that used qemu_ram_alloc(). */ - ram = g_malloc(sizeof(*ram)); + ram = g_new(MemoryRegion, 1); memory_region_allocate_system_memory(ram, NULL, "pc.ram", machine->ram_size); *ram_memory = ram; - ram_below_4g = g_malloc(sizeof(*ram_below_4g)); + ram_below_4g = g_new(MemoryRegion, 1); memory_region_init_alias(ram_below_4g, NULL, "ram-below-4g", ram, 0, pcms->below_4g_mem_size); memory_region_add_subregion(system_memory, 0, ram_below_4g); @@ -1408,7 +1408,7 @@ void pc_memory_init(PCMachineState *pcms, /* Initialize PC system firmware */ pc_system_firmware_init(rom_memory, !pcmc->pci_enabled); - option_rom_mr = g_malloc(sizeof(*option_rom_mr)); + option_rom_mr = g_new(MemoryRegion, 1); memory_region_init_ram(option_rom_mr, NULL, "pc.rom", PC_ROM_SIZE, &error_fatal); if (pcmc->pci_enabled) { diff --git a/hw/i386/pc_sysfw.c b/hw/i386/pc_sysfw.c index 6b183747fc..d80cb17d70 100644 --- a/hw/i386/pc_sysfw.c +++ b/hw/i386/pc_sysfw.c @@ -56,7 +56,7 @@ static void pc_isa_bios_init(MemoryRegion *rom_memory, /* map the last 128KB of the BIOS in ISA space */ isa_bios_size = MIN(flash_size, 128 * 1024); - isa_bios = g_malloc(sizeof(*isa_bios)); + isa_bios = g_new(MemoryRegion, 1); memory_region_init_ram(isa_bios, NULL, "isa-bios", isa_bios_size, &error_fatal); memory_region_add_subregion_overlap(rom_memory, @@ -193,7 +193,7 @@ static void old_pc_system_rom_init(MemoryRegion *rom_memory, bool isapc_ram_fw) (bios_size % 65536) != 0) { goto bios_error; } - bios = g_malloc(sizeof(*bios)); + bios = g_new(MemoryRegion, 1); memory_region_init_ram(bios, NULL, "pc.bios", bios_size, &error_fatal); if (!isapc_ram_fw) { memory_region_set_readonly(bios, true); @@ -211,7 +211,7 @@ static void old_pc_system_rom_init(MemoryRegion *rom_memory, bool isapc_ram_fw) if (isa_bios_size > (128 * 1024)) { isa_bios_size = 128 * 1024; } - isa_bios = g_malloc(sizeof(*isa_bios)); + isa_bios = g_new(MemoryRegion, 1); memory_region_init_alias(isa_bios, NULL, "isa-bios", bios, bios_size - isa_bios_size, isa_bios_size); memory_region_add_subregion_overlap(rom_memory, From patchwork Fri Oct 6 23:49:35 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 822819 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="Ou8mQxrr"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3y86kp1j0Fz9t4r for ; Sat, 7 Oct 2017 11:26:42 +1100 (AEDT) Received: from localhost ([::1]:47731 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e0cwy-00049G-7X for incoming@patchwork.ozlabs.org; Fri, 06 Oct 2017 20:26:40 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41960) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e0cQI-0000Gc-Th for qemu-devel@nongnu.org; Fri, 06 Oct 2017 19:52:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e0cQH-0006CH-J2 for qemu-devel@nongnu.org; Fri, 06 Oct 2017 19:52:54 -0400 Received: from mail-qk0-x241.google.com ([2607:f8b0:400d:c09::241]:34139) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1e0cQH-0006C3-DL; Fri, 06 Oct 2017 19:52:53 -0400 Received: by mail-qk0-x241.google.com with SMTP id b124so10272086qke.1; Fri, 06 Oct 2017 16:52:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=v0c03LlLVTDKRVqufvOxdy1EDAej4sFIE2Oul3BvDZY=; b=Ou8mQxrrgN5cojJbYRpPHGyLOuKczBaAlYIqXzSGIhC76OOigZXEdZGoOzGikWYmPq 3dglgmCeimhhmY5YFnK9Xb8kl7/b0wWqBFwa5qAgNfupXZY3Rv/WGZoMWMS1i/6vHRRx rtSAN2fC4HJ7sLGLKngNIGTUu1ADlyjWplrmKnzOaro71IO7wsVJXEV19GkVkXV6syz1 RnNEdrZV8IlFL7Fp6YEXqFdnh36cHxmj8T/pv4Ecv7Gy19VA2yJXG1tblZPudaUcpbMx w4GQuee2BDC8dm/+VmyB3nkxwbFa55d1wvLl/yr5fptU6DA5klFwa3nM/80ILzUvmRou stYQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=v0c03LlLVTDKRVqufvOxdy1EDAej4sFIE2Oul3BvDZY=; b=fVPjyqnEjJ6rKdHg0VIbF65sH33sMtQeSIcK5WmxKdEHSiaO8BmdfuHr4cuFDFT+8B uU7PB3p3a2uehnqa6ORicVNJ0QyocoWaLkY8cY2R3XcIe39T4zPMTHnvybuif2WTAqT+ Va4Cw7YU0l0mHoiz+rRau+uSlBkcYTwe7jWCAIcShCONbbHukSmlwyPFtcNSDz0NtzXS PUOQTA92rL1exIrA4aiNDFugXR7787V0Cf5y3bL7f7NnX4c0xaGEgy8OXxAhgfC75JWc QAor3XAUmSpwpimcwSPGrm33s/qz6YLNMC6/ruAqyv0KaCq4HTUMAdQKE98CKJRkd9Gz Twxg== X-Gm-Message-State: AMCzsaXsoXVYqnIAXblUa6/9o48yyGpCf4DnEI5F5OIEKc/tWa0lv8nb 70FGbNxk7gF5xn3vU8QliuI= X-Google-Smtp-Source: AOwi7QDZcy43WjUTBdCfZNXWJfbcPdewDhbhQOEP00Jgx5i/sk0TW2r6dvlhzUeDXbP4CWhWVUx4og== X-Received: by 10.55.122.130 with SMTP id v124mr698157qkc.209.1507333972818; Fri, 06 Oct 2017 16:52:52 -0700 (PDT) Received: from yoga.lan ([181.93.89.178]) by smtp.gmail.com with ESMTPSA id g1sm1705226qta.95.2017.10.06.16.52.46 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 06 Oct 2017 16:52:52 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Markus Armbruster , Eric Blake , Stefano Stabellini , Anthony Perard , "Aneesh Kumar K.V" , Greg Kurz , Paolo Bonzini , Richard Henderson , Eduardo Habkost , "Michael S. Tsirkin" Date: Fri, 6 Oct 2017 20:49:35 -0300 Message-Id: <20171006235023.11952-41-f4bug@amsat.org> X-Mailer: git-send-email 2.14.2 In-Reply-To: <20171006235023.11952-1-f4bug@amsat.org> References: <20171006235023.11952-1-f4bug@amsat.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c09::241 Subject: [Qemu-devel] [PATCH 40/88] hw/xen: use g_new() family of functions X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , qemu trival , qemu-devel@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Marc-André Lureau Signed-off-by: Marc-André Lureau Signed-off-by: Philippe Mathieu-Daudé [PMD: replaced g_new0() -> g_new() in xen_remap_bucket() (no bzero required), renamed X86 -> hw/xen and few other changes] Reviewed-by: Anthony PERARD --- hw/9pfs/xen-9p-backend.c | 2 +- hw/display/xenfb.c | 4 ++-- hw/i386/xen/xen-hvm.c | 10 +++++----- hw/i386/xen/xen-mapcache.c | 14 +++++++------- hw/xen/xen_pvdev.c | 2 +- 5 files changed, 16 insertions(+), 16 deletions(-) diff --git a/hw/9pfs/xen-9p-backend.c b/hw/9pfs/xen-9p-backend.c index ee87f08926..d76fa0df8e 100644 --- a/hw/9pfs/xen-9p-backend.c +++ b/hw/9pfs/xen-9p-backend.c @@ -365,7 +365,7 @@ static int xen_9pfs_connect(struct XenDevice *xendev) return -1; } - xen_9pdev->rings = g_malloc0(xen_9pdev->num_rings * sizeof(Xen9pfsRing)); + xen_9pdev->rings = g_new0(Xen9pfsRing, xen_9pdev->num_rings); for (i = 0; i < xen_9pdev->num_rings; i++) { char *str; int ring_order; diff --git a/hw/display/xenfb.c b/hw/display/xenfb.c index 8e2547ac05..5b5fa34131 100644 --- a/hw/display/xenfb.c +++ b/hw/display/xenfb.c @@ -479,8 +479,8 @@ static int xenfb_map_fb(struct XenFB *xenfb) n_fbdirs = xenfb->fbpages * mode / 8; n_fbdirs = DIV_ROUND_UP(n_fbdirs, XC_PAGE_SIZE); - pgmfns = g_malloc0(sizeof(xen_pfn_t) * n_fbdirs); - fbmfns = g_malloc0(sizeof(xen_pfn_t) * xenfb->fbpages); + pgmfns = g_new0(xen_pfn_t, n_fbdirs); + fbmfns = g_new0(xen_pfn_t, xenfb->fbpages); xenfb_copy_mfns(mode, n_fbdirs, pgmfns, pd); map = xenforeignmemory_map(xen_fmem, xenfb->c.xendev.dom, diff --git a/hw/i386/xen/xen-hvm.c b/hw/i386/xen/xen-hvm.c index d9ccd5d0d6..37a4e1cd6c 100644 --- a/hw/i386/xen/xen-hvm.c +++ b/hw/i386/xen/xen-hvm.c @@ -376,7 +376,7 @@ go_physmap: mr_name = memory_region_name(mr); - physmap = g_malloc(sizeof(XenPhysmap)); + physmap = g_new(XenPhysmap, 1); physmap->start_addr = start_addr; physmap->size = size; @@ -1188,7 +1188,7 @@ static void xen_read_physmap(XenIOState *state) return; for (i = 0; i < num; i++) { - physmap = g_malloc(sizeof (XenPhysmap)); + physmap = g_new(XenPhysmap, 1); physmap->phys_offset = strtoull(entries[i], NULL, 16); snprintf(path, sizeof(path), "/local/domain/0/device-model/%d/physmap/%s/start_addr", @@ -1240,7 +1240,7 @@ void xen_hvm_init(PCMachineState *pcms, MemoryRegion **ram_memory) evtchn_port_t bufioreq_evtchn; XenIOState *state; - state = g_malloc0(sizeof (XenIOState)); + state = g_new0(XenIOState, 1); state->xce_handle = xenevtchn_open(NULL, 0); if (state->xce_handle == NULL) { @@ -1321,7 +1321,7 @@ void xen_hvm_init(PCMachineState *pcms, MemoryRegion **ram_memory) } /* Note: cpus is empty at this point in init */ - state->cpu_by_vcpu_id = g_malloc0(max_cpus * sizeof(CPUState *)); + state->cpu_by_vcpu_id = g_new0(CPUState *, max_cpus); rc = xen_set_ioreq_server_state(xen_domid, state->ioservid, true); if (rc < 0) { @@ -1330,7 +1330,7 @@ void xen_hvm_init(PCMachineState *pcms, MemoryRegion **ram_memory) goto err; } - state->ioreq_local_port = g_malloc0(max_cpus * sizeof (evtchn_port_t)); + state->ioreq_local_port = g_new0(evtchn_port_t, max_cpus); /* FIXME: how about if we overflow the page here? */ for (i = 0; i < max_cpus; i++) { diff --git a/hw/i386/xen/xen-mapcache.c b/hw/i386/xen/xen-mapcache.c index baab93b614..93cba7fb83 100644 --- a/hw/i386/xen/xen-mapcache.c +++ b/hw/i386/xen/xen-mapcache.c @@ -109,7 +109,7 @@ void xen_map_cache_init(phys_offset_to_gaddr_t f, void *opaque) unsigned long size; struct rlimit rlimit_as; - mapcache = g_malloc0(sizeof (MapCache)); + mapcache = g_new0(MapCache, 1); mapcache->phys_offset_to_gaddr = f; mapcache->opaque = opaque; @@ -165,8 +165,7 @@ static void xen_remap_bucket(MapCacheEntry *entry, trace_xen_remap_bucket(address_index); - pfns = g_malloc0(nb_pfn * sizeof (xen_pfn_t)); - err = g_malloc0(nb_pfn * sizeof (int)); + err = g_new0(int, nb_pfn); if (entry->vaddr_base != NULL) { if (!(entry->flags & XEN_MAPCACHE_ENTRY_DUMMY)) { @@ -180,6 +179,7 @@ static void xen_remap_bucket(MapCacheEntry *entry, g_free(entry->valid_mapping); entry->valid_mapping = NULL; + pfns = g_new(xen_pfn_t, nb_pfn); for (i = 0; i < nb_pfn; i++) { pfns[i] = (address_index << (MCACHE_BUCKET_SHIFT-XC_PAGE_SHIFT)) + i; } @@ -212,8 +212,8 @@ static void xen_remap_bucket(MapCacheEntry *entry, entry->vaddr_base = vaddr_base; entry->paddr_index = address_index; entry->size = size; - entry->valid_mapping = (unsigned long *) g_malloc0(sizeof(unsigned long) * - BITS_TO_LONGS(size >> XC_PAGE_SHIFT)); + entry->valid_mapping = g_new0(unsigned long, + BITS_TO_LONGS(size >> XC_PAGE_SHIFT)); if (dummy) { entry->flags |= XEN_MAPCACHE_ENTRY_DUMMY; @@ -300,7 +300,7 @@ tryagain: pentry = free_pentry; } if (!entry) { - entry = g_malloc0(sizeof (MapCacheEntry)); + entry = g_new0(MapCacheEntry, 1); pentry->next = entry; xen_remap_bucket(entry, NULL, cache_size, address_index, dummy); } else if (!entry->lock) { @@ -334,7 +334,7 @@ tryagain: mapcache->last_entry = entry; if (lock) { - MapCacheRev *reventry = g_malloc0(sizeof(MapCacheRev)); + MapCacheRev *reventry = g_new0(MapCacheRev, 1); entry->lock++; reventry->dma = dma; reventry->vaddr_req = mapcache->last_entry->vaddr_base + address_offset; diff --git a/hw/xen/xen_pvdev.c b/hw/xen/xen_pvdev.c index aed783e844..8c1c14fb60 100644 --- a/hw/xen/xen_pvdev.c +++ b/hw/xen/xen_pvdev.c @@ -43,7 +43,7 @@ static void xenstore_cleanup_dir(char *dir) { struct xs_dirs *d; - d = g_malloc(sizeof(*d)); + d = g_new(struct xs_dirs, 1); d->xs_dir = dir; QTAILQ_INSERT_TAIL(&xs_cleanup, d, list); } From patchwork Fri Oct 6 23:49:36 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 822808 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="FExwCZAT"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3y86ZV2r3wz9t4P for ; Sat, 7 Oct 2017 11:19:30 +1100 (AEDT) Received: from localhost ([::1]:47679 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e0cq0-0005yO-D4 for incoming@patchwork.ozlabs.org; Fri, 06 Oct 2017 20:19:28 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42025) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e0cQN-0000Lu-V8 for qemu-devel@nongnu.org; Fri, 06 Oct 2017 19:53:01 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e0cQK-0006Dv-U5 for qemu-devel@nongnu.org; Fri, 06 Oct 2017 19:53:00 -0400 Received: from mail-qk0-x241.google.com ([2607:f8b0:400d:c09::241]:35189) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1e0cQK-0006Di-PQ; Fri, 06 Oct 2017 19:52:56 -0400 Received: by mail-qk0-x241.google.com with SMTP id w63so11297253qkd.2; Fri, 06 Oct 2017 16:52:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=P/cUAO12wpwS/gf8FMOaiId1KFNcT/9XDXvNKKjjZMI=; b=FExwCZAToglZKm/SPomyn9JS0Lyy4e+9sfmCKb/TtULv1pYGc5sW6WTr5mOq3q4lp/ vhSnsJb0Hu8xgr4HPLb/p0RY+wjXw1w0kgapC6wiMusETk5mAw9yX3BJk3MszJoWL4cF 5UrznbqoGTVWnlZo6JBZm6TrC8g/iXCfqPNqQn5xqThl0kRoZI2y+R3lexfzyuH2Uy6J ILzLWtcmJQdwNsdpH8pVaxW5GGFKQNT4colF1mTlDcNLXFz9IMrfveIemcCtSzN0nAoh 2x3cjTweIL3Eked4XB5QmEn2DD61bJUWtsdLbo2+cSnHSC2NG+ueELPw6OBuN1T/0na1 /bGw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=P/cUAO12wpwS/gf8FMOaiId1KFNcT/9XDXvNKKjjZMI=; b=L2QhtkxgJ5I+o9nJiLDQTHUnNFwmcdgsRmQGNPvwfZsV1dXr6jRUvKFjr7E54tv/Gt 4u8iPfJC/TnDFumpUOU/tqSS6d6NMXX2FZyNWB1Wf1xHeDdS/6IYcO27eVKAZxcydTxK VM+Z9WZ9ifb5Gh7Banl0RmhEH7Z+xe5QCwbIYQLO0XNRBiEqZo2U1xKUpK1naHeiztY7 GYGYWrmNxD8QbKZVb61U+c/rd7DWjLpNm83dZHLVBXlhivRXoUjE5nUogmTmkZlmH4JC 5MjfJWyKp18tbpeFDEis7ZmYZipxufYIUQehn/CIwDoYXz9QrnDqGT3Lf3HzBHuGqEuW BHlg== X-Gm-Message-State: AMCzsaXFxvJZE5kbYlp+akYOFknNAYemuhy+yFL6allHE0hzXoqImACi c7im6uysoeIHUq41UwkuFWo= X-Google-Smtp-Source: AOwi7QA+jeo0ORx1EiwqooNLSXQ6WHH6zEZU8ivvRIsm8T51hCdiWhL08LbADbuOnOFDw5HnySFFiw== X-Received: by 10.55.127.70 with SMTP id a67mr696688qkd.90.1507333976226; Fri, 06 Oct 2017 16:52:56 -0700 (PDT) Received: from yoga.lan ([181.93.89.178]) by smtp.gmail.com with ESMTPSA id g1sm1705226qta.95.2017.10.06.16.52.53 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 06 Oct 2017 16:52:55 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Markus Armbruster , Eric Blake , Paolo Bonzini , Richard Henderson , Eduardo Habkost Date: Fri, 6 Oct 2017 20:49:36 -0300 Message-Id: <20171006235023.11952-42-f4bug@amsat.org> X-Mailer: git-send-email 2.14.2 In-Reply-To: <20171006235023.11952-1-f4bug@amsat.org> References: <20171006235023.11952-1-f4bug@amsat.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c09::241 Subject: [Qemu-devel] [PATCH 41/88] target/i386: use g_new() family of functions X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , qemu trival , =?utf-8?q?Philippe_Mathieu-Dau?= =?utf-8?b?ZMOp?= , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Marc-André Lureau Signed-off-by: Philippe Mathieu-Daudé [PMD: added more changes and hax] --- target/i386/cpu.c | 6 +++--- target/i386/hax-all.c | 4 ++-- target/i386/hax-mem.c | 2 +- target/i386/hyperv.c | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/target/i386/cpu.c b/target/i386/cpu.c index 98732cd65f..236a4115cd 100644 --- a/target/i386/cpu.c +++ b/target/i386/cpu.c @@ -2344,7 +2344,7 @@ static void x86_cpu_definition_entry(gpointer data, gpointer user_data) CpuDefinitionInfoList *entry; CpuDefinitionInfo *info; - info = g_malloc0(sizeof(*info)); + info = g_new0(CpuDefinitionInfo, 1); info->name = x86_cpu_class_get_model_name(cc); x86_cpu_class_check_missing_features(cc, &info->unavailable_features); info->has_unavailable_features = true; @@ -2353,7 +2353,7 @@ static void x86_cpu_definition_entry(gpointer data, gpointer user_data) info->has_migration_safe = true; info->q_static = cc->static_model; - entry = g_malloc0(sizeof(*entry)); + entry = g_new0(CpuDefinitionInfoList, 1); entry->value = info; entry->next = *cpu_list; *cpu_list = entry; @@ -3933,7 +3933,7 @@ static GuestPanicInformation *x86_cpu_get_crash_info(CPUState *cs) GuestPanicInformation *panic_info = NULL; if (env->features[FEAT_HYPERV_EDX] & HV_GUEST_CRASH_MSR_AVAILABLE) { - panic_info = g_malloc0(sizeof(GuestPanicInformation)); + panic_info = g_new0(GuestPanicInformation, 1); panic_info->type = GUEST_PANIC_INFORMATION_TYPE_HYPER_V; diff --git a/target/i386/hax-all.c b/target/i386/hax-all.c index 3ce6950296..8f4368fe01 100644 --- a/target/i386/hax-all.c +++ b/target/i386/hax-all.c @@ -155,7 +155,7 @@ int hax_vcpu_create(int id) return 0; } - vcpu = g_malloc(sizeof(struct hax_vcpu_state)); + vcpu = g_new(struct hax_vcpu_state, 1); if (!vcpu) { fprintf(stderr, "Failed to alloc vcpu state\n"); return -ENOMEM; @@ -251,7 +251,7 @@ struct hax_vm *hax_vm_create(struct hax_state *hax) return hax->vm; } - vm = g_malloc(sizeof(struct hax_vm)); + vm = g_new(struct hax_vm, 1); if (!vm) { return NULL; } diff --git a/target/i386/hax-mem.c b/target/i386/hax-mem.c index 27a0d214f2..826f7ca501 100644 --- a/target/i386/hax-mem.c +++ b/target/i386/hax-mem.c @@ -82,7 +82,7 @@ static void hax_insert_mapping_before(HAXMapping *next, uint64_t start_pa, { HAXMapping *entry; - entry = g_malloc0(sizeof(*entry)); + entry = g_new0(HAXMapping, 1); entry->start_pa = start_pa; entry->size = size; entry->host_va = host_va; diff --git a/target/i386/hyperv.c b/target/i386/hyperv.c index a050c9d2d1..a427602e58 100644 --- a/target/i386/hyperv.c +++ b/target/i386/hyperv.c @@ -78,7 +78,7 @@ HvSintRoute *kvm_hv_sint_route_create(uint32_t vcpu_id, uint32_t sint, HvSintRoute *sint_route; int r, gsi; - sint_route = g_malloc0(sizeof(*sint_route)); + sint_route = g_new0(HvSintRoute, 1); r = event_notifier_init(&sint_route->sint_set_notifier, false); if (r) { goto err; From patchwork Fri Oct 6 23:49:37 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 822809 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="mOXs3INI"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3y86Zw5GCFz9t4P for ; Sat, 7 Oct 2017 11:19:52 +1100 (AEDT) Received: from localhost ([::1]:47680 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e0cqM-0006I7-K6 for incoming@patchwork.ozlabs.org; Fri, 06 Oct 2017 20:19:50 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42038) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e0cQO-0000Lv-Ub for qemu-devel@nongnu.org; Fri, 06 Oct 2017 19:53:01 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e0cQN-0006Fm-N5 for qemu-devel@nongnu.org; Fri, 06 Oct 2017 19:53:01 -0400 Received: from mail-qk0-x243.google.com ([2607:f8b0:400d:c09::243]:33094) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1e0cQN-0006FV-If; Fri, 06 Oct 2017 19:52:59 -0400 Received: by mail-qk0-x243.google.com with SMTP id z12so9700171qkb.0; Fri, 06 Oct 2017 16:52:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=lb06OpFKlDd2si1bCa/v31LPELPQMFq165WGDCaTpuo=; b=mOXs3INIvgK01Z/B11zrHB7XftPVW5D8AyVi75aQafYX4nyPT2rS+jxjdvybZMx87v NJ/mjUhQOYlVYoQGDo65S9bzubaArsQk/1gNK9GfUdZQd2GB8aAMqcBvI8Ppen9vXp0x KT0FMoZQlAuSJf8A0SUfFOJTAFLmUagbYSA1dJ5Pc/WF+//+HmKX8wT7vkKztGKCvL9K 6e9Eu/i4VqU3aD8WPC73tbJOosVA1iz9L/WzgLM7AkqJej4LvxToxmm5c/NMMo4sTXqF e29rJ1zfzB4qk+wa189q7P3j58BcmtP2bvUu79BvA1PJTCy8vbTqkljabG2ZY7H7P6w0 ygMg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=lb06OpFKlDd2si1bCa/v31LPELPQMFq165WGDCaTpuo=; b=qA0w1JV5wYDVx34fKL6ptIW75cBycuBncOMfzy6/Pgax01V0gRTXCegC0qpwLr6ors FvpWGc3tqsCrXC5ue+xj3FCt6F7HX0XP4ULXIt/ctGYdQJFdl92I6bujCxWA3YRbq1rm G4pRhtavhZUtUsToYMuLGvQIx4nBAG1QJ72uHVPPdEFTVEG4Gktqd4/zI/JkOngF6/Q1 1m0FgtUjWXpYkCoFx1+qAQ/QVu2o37xdqFjjILf4DxdaMqUJt7Le18GBSvOCnG66m685 BYvI+FZ5+x1AaH009RDHQQ+3ccdWzazspr4y/Uw1l0BQfJjJhYEpiu+qPiAb1YViTPEf zJdQ== X-Gm-Message-State: AMCzsaXjfnPbZzOljkOT9f8fUgku03AN7m/xFNGwGAzo92jmxU9US1AO zgtJZkucUf8JGSScfix2HnM= X-Google-Smtp-Source: AOwi7QBMJ7NvWoDe3OucoxsRZi8sAXV14ssk1Ukhy6ZXNJg9pkXFvfTFfo6zUYMadpkammFLsM7ZNg== X-Received: by 10.55.183.134 with SMTP id h128mr710005qkf.96.1507333979057; Fri, 06 Oct 2017 16:52:59 -0700 (PDT) Received: from yoga.lan ([181.93.89.178]) by smtp.gmail.com with ESMTPSA id g1sm1705226qta.95.2017.10.06.16.52.56 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 06 Oct 2017 16:52:58 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Markus Armbruster , Eric Blake , Max Filippov Date: Fri, 6 Oct 2017 20:49:37 -0300 Message-Id: <20171006235023.11952-43-f4bug@amsat.org> X-Mailer: git-send-email 2.14.2 In-Reply-To: <20171006235023.11952-1-f4bug@amsat.org> References: <20171006235023.11952-1-f4bug@amsat.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c09::243 Subject: [Qemu-devel] [PATCH 42/88] XTFPGA: use g_new() family of functions X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , qemu trival , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Marc-André Lureau Signed-off-by: Marc-André Lureau --- hw/xtensa/xtfpga.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/xtensa/xtfpga.c b/hw/xtensa/xtfpga.c index a19ccebdba..c54a09df83 100644 --- a/hw/xtensa/xtfpga.c +++ b/hw/xtensa/xtfpga.c @@ -115,7 +115,7 @@ static const MemoryRegionOps lx60_fpga_ops = { static Lx60FpgaState *lx60_fpga_init(MemoryRegion *address_space, hwaddr base) { - Lx60FpgaState *s = g_malloc(sizeof(Lx60FpgaState)); + Lx60FpgaState *s = g_new(Lx60FpgaState, 1); memory_region_init_io(&s->iomem, NULL, &lx60_fpga_ops, s, "lx60.fpga", 0x10000); From patchwork Fri Oct 6 23:49:38 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 822823 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="hSaUskY2"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3y86p05w4Xz9t2h for ; Sat, 7 Oct 2017 11:29:28 +1100 (AEDT) Received: from localhost ([::1]:47747 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e0cze-0006ba-Rg for incoming@patchwork.ozlabs.org; Fri, 06 Oct 2017 20:29:26 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42092) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e0cQR-0000OT-SW for qemu-devel@nongnu.org; Fri, 06 Oct 2017 19:53:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e0cQQ-0006Km-Vx for qemu-devel@nongnu.org; Fri, 06 Oct 2017 19:53:03 -0400 Received: from mail-qk0-x241.google.com ([2607:f8b0:400d:c09::241]:33095) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1e0cQQ-0006KI-Qr; Fri, 06 Oct 2017 19:53:02 -0400 Received: by mail-qk0-x241.google.com with SMTP id z12so9700207qkb.0; Fri, 06 Oct 2017 16:53:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=dw5JZ7lP1J1VuPTLyCE48EbyvBxnuDnQ7g/+mqHt1Xk=; b=hSaUskY2QvuogyFgFKQjzmoc0+nbN1WuaCy2Q81q3SKvNyv9XoYQrH2EhOelJWVPJY A277knl4wSYNTpibD9P+sdoaCDrvGKkeueMiy8DNn+o/FJ4Kp++617P+H9wpu8NNbqDO hQStJ1Q6kavHugXOnWmMmjWuS/C2eFDhH9Z4n9YbpUIn8KRfq1QIngj5SlJ1/Jr/qedn LRFEt7NxMNXfHetTdBB0KOy3hGWdepZfsC8fCzKtwLu29/DYo9ouLlYzB/ILACb1eFWv GU55ZBn3F7vO6Bj5YGQBM0Nj+9UcHi1ukB5Lemfn/OtzM+WRpbwNYa5btT3RekCzdRBy l+kQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=dw5JZ7lP1J1VuPTLyCE48EbyvBxnuDnQ7g/+mqHt1Xk=; b=kOxdwrRwhOlwMzYdzlZL2bUNURuayYbBDCr2pkJQmkW7KAt5AX91eZ4uGqIB0gnv4l o9qk03NkyBNsTfWK5MP6aP7UFbDUntyfNWCV1t+3Z3otyssJ8XJjAuOSJ4HdUlxxmAWA GW6fP8cYKBvuSO5Jxu+QrxlTciDXjhLPSIT0Cc95awOFQFV6qTOxGvUSHo48LM1MvZeH evwWb2YqOI9G/osoKxA0mhyfeWwsqIKVCu+wzYa9ejxwyQQNiJrnLiEYYaTiLi0XEskx GO66pFaYvL5VzfTeSFABI1Yhop2ixagt5bC5H5f2XvpHxwWfH+Fr7clBJZoSUcUK52pu fM/g== X-Gm-Message-State: AMCzsaVDqYcdtnfaVeQTqLra2kicQA+AXFeEPB8fOoKxuVr1nTT5l9+T 6aH1Lm0fXuLCswntj5/XSFk= X-Google-Smtp-Source: AOwi7QBDA1PO8bp4FgVS/EsFOIpiQoLgtSEavcihSY4trPLWM1RKQZbyF+btLN1nhJx5+k6nEMeE5A== X-Received: by 10.55.125.6 with SMTP id y6mr749339qkc.272.1507333982303; Fri, 06 Oct 2017 16:53:02 -0700 (PDT) Received: from yoga.lan ([181.93.89.178]) by smtp.gmail.com with ESMTPSA id g1sm1705226qta.95.2017.10.06.16.52.59 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 06 Oct 2017 16:53:01 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Markus Armbruster , Eric Blake , Paolo Bonzini , Peter Maydell Date: Fri, 6 Oct 2017 20:49:38 -0300 Message-Id: <20171006235023.11952-44-f4bug@amsat.org> X-Mailer: git-send-email 2.14.2 In-Reply-To: <20171006235023.11952-1-f4bug@amsat.org> References: <20171006235023.11952-1-f4bug@amsat.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c09::241 Subject: [Qemu-devel] [PATCH 43/88] hw/core: use g_new() family of functions X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , qemu trival , qemu-devel@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Marc-André Lureau Signed-off-by: Marc-André Lureau Signed-off-by: Philippe Mathieu-Daudé [PMD: added changes in hw/core/qdev.c] --- hw/core/irq.c | 2 +- hw/core/ptimer.c | 2 +- hw/core/qdev.c | 2 +- hw/core/reset.c | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/hw/core/irq.c b/hw/core/irq.c index b98d1d69f5..d9b13b1762 100644 --- a/hw/core/irq.c +++ b/hw/core/irq.c @@ -115,7 +115,7 @@ static void qemu_splitirq(void *opaque, int line, int level) qemu_irq qemu_irq_split(qemu_irq irq1, qemu_irq irq2) { - qemu_irq *s = g_malloc0(2 * sizeof(qemu_irq)); + qemu_irq *s = g_new0(qemu_irq, 2); s[0] = irq1; s[1] = irq2; return qemu_allocate_irq(qemu_splitirq, s, 0); diff --git a/hw/core/ptimer.c b/hw/core/ptimer.c index 7221c68a98..ef4a6646ed 100644 --- a/hw/core/ptimer.c +++ b/hw/core/ptimer.c @@ -349,7 +349,7 @@ ptimer_state *ptimer_init(QEMUBH *bh, uint8_t policy_mask) { ptimer_state *s; - s = (ptimer_state *)g_malloc0(sizeof(ptimer_state)); + s = g_new0(ptimer_state, 1); s->bh = bh; s->timer = timer_new_ns(QEMU_CLOCK_VIRTUAL, ptimer_tick, s); s->policy_mask = policy_mask; diff --git a/hw/core/qdev.c b/hw/core/qdev.c index 606ab53c42..7b92af1013 100644 --- a/hw/core/qdev.c +++ b/hw/core/qdev.c @@ -378,7 +378,7 @@ static NamedGPIOList *qdev_get_named_gpio_list(DeviceState *dev, } } - ngl = g_malloc0(sizeof(*ngl)); + ngl = g_new0(NamedGPIOList, 1); ngl->name = g_strdup(name); QLIST_INSERT_HEAD(&dev->gpios, ngl, node); return ngl; diff --git a/hw/core/reset.c b/hw/core/reset.c index 84c8869371..01d86c3a95 100644 --- a/hw/core/reset.c +++ b/hw/core/reset.c @@ -40,7 +40,7 @@ static QTAILQ_HEAD(reset_handlers, QEMUResetEntry) reset_handlers = void qemu_register_reset(QEMUResetHandler *func, void *opaque) { - QEMUResetEntry *re = g_malloc0(sizeof(QEMUResetEntry)); + QEMUResetEntry *re = g_new0(QEMUResetEntry, 1); re->func = func; re->opaque = opaque; From patchwork Fri Oct 6 23:49:39 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 822826 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="NpQ0wxXY"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3y86s34RMgz9t4b for ; Sat, 7 Oct 2017 11:32:07 +1100 (AEDT) Received: from localhost ([::1]:47761 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e0d2D-0000RB-BZ for incoming@patchwork.ozlabs.org; Fri, 06 Oct 2017 20:32:05 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42127) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e0cQX-0000Tw-14 for qemu-devel@nongnu.org; Fri, 06 Oct 2017 19:53:09 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e0cQT-0006OC-UX for qemu-devel@nongnu.org; Fri, 06 Oct 2017 19:53:09 -0400 Received: from mail-qt0-x244.google.com ([2607:f8b0:400d:c0d::244]:48142) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1e0cQT-0006Ny-QK; Fri, 06 Oct 2017 19:53:05 -0400 Received: by mail-qt0-x244.google.com with SMTP id d13so33659726qta.5; Fri, 06 Oct 2017 16:53:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=WWJSXR6oz9H0fjG+8qlk4h49zt78HYqwsPCvnQ6cPvo=; b=NpQ0wxXYI3iAswZHrp2V7QBMf8AmQIUQ//HEsqYAAnSa7AmAWYrksJX5IBffCNxCkx RAYRiihd1pfj4ShqyxsflR8JsO8ocBrTHKqH1YKFO//MxVVNMXzpt1NJN53RTgtD33Hc +7c5X7z4Xz/NtqKtKnerOgcuqh1SWt9LhF83UBRIWCO5hE/uTGEEc9nDmsJ3vQZxR9G2 bPIgvgltq13OF10RjYpxGDOoN9Efk3bWtIptWrj1nGhIaNWBiaPS9GykoV/FLe8jMiGY wZGoYrAHiFbKBE5VxLhOwOrJNmsHm01FkH4Q0ogLsQb77qLnFiBrDIifX7iXoTbjmO8F akTw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=WWJSXR6oz9H0fjG+8qlk4h49zt78HYqwsPCvnQ6cPvo=; b=n4PHdvAr0Vzuihesik2k4tQ1P+9a6bB6++SmmOrztWxWeldOW411BZ6C7dFuCXJQzV SDGBVK40JP25G6/kS+3b/Dc36WQsmd7DhrycSTYSKRMu3C9SPqCAYzbJ1sPac4KJ7BIv aZrkkOSi3bSyiJrv0RPnO1oOZMV7T1Akex6meS2sl+pitcHVCNUvRLI7719vrDWziQz6 WVxiTyU2ZtEHMyShO0fpH6W6RMlQaVo6pFsEHn+zivPpRWgPsOWS2coN6FHLOo1iN2QI zDFIAmshrYYep/TEKqBcxz19msGiHBU00xbFML1gUM0uIFZGVTYuVNcpd/GE/D2uR4nk rpog== X-Gm-Message-State: AMCzsaVyTKrJ/2UKl6jNImZXSzy0PsGl+QVSjZb6KT8bC41eR4FDlui9 Yj3+zSTfiReFYhzgTQ0teTI= X-Google-Smtp-Source: AOwi7QBqutmFqWCHSgQoXr/AkO5zL6t4JfdP6QC90OH1PLS6eg4AwFTWJgBpexA2RvxD7J+6m9JQpQ== X-Received: by 10.237.36.125 with SMTP id s58mr5559393qtc.24.1507333985284; Fri, 06 Oct 2017 16:53:05 -0700 (PDT) Received: from yoga.lan ([181.93.89.178]) by smtp.gmail.com with ESMTPSA id g1sm1705226qta.95.2017.10.06.16.53.02 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 06 Oct 2017 16:53:04 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Markus Armbruster , Eric Blake , Alistair Francis Date: Fri, 6 Oct 2017 20:49:39 -0300 Message-Id: <20171006235023.11952-45-f4bug@amsat.org> X-Mailer: git-send-email 2.14.2 In-Reply-To: <20171006235023.11952-1-f4bug@amsat.org> References: <20171006235023.11952-1-f4bug@amsat.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c0d::244 Subject: [Qemu-devel] [PATCH 44/88] hw/core/loader: use g_new() family of functions X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , qemu trival , =?utf-8?q?Philippe_Mathieu-Dau?= =?utf-8?b?ZMOp?= , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Alistair Francis --- hw/core/loader.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/hw/core/loader.c b/hw/core/loader.c index 4593061445..def4766dbb 100644 --- a/hw/core/loader.c +++ b/hw/core/loader.c @@ -899,7 +899,7 @@ int rom_add_file(const char *file, const char *fw_dir, return -1; } - rom = g_malloc0(sizeof(*rom)); + rom = g_new0(Rom, 1); rom->name = g_strdup(file); rom->path = qemu_find_file(QEMU_FILE_TYPE_BIOS, rom->name); rom->as = as; @@ -996,7 +996,7 @@ MemoryRegion *rom_add_blob(const char *name, const void *blob, size_t len, Rom *rom; MemoryRegion *mr = NULL; - rom = g_malloc0(sizeof(*rom)); + rom = g_new0(Rom, 1); rom->name = g_strdup(name); rom->as = as; rom->addr = addr; @@ -1039,7 +1039,7 @@ int rom_add_elf_program(const char *name, void *data, size_t datasize, { Rom *rom; - rom = g_malloc0(sizeof(*rom)); + rom = g_new0(Rom, 1); rom->name = g_strdup(name); rom->addr = addr; rom->datasize = datasize; From patchwork Fri Oct 6 23:49:40 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 822817 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="uea+WMpg"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3y86kF1qsPz9t4r for ; Sat, 7 Oct 2017 11:26:13 +1100 (AEDT) Received: from localhost ([::1]:47727 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e0cwV-0003lI-8B for incoming@patchwork.ozlabs.org; Fri, 06 Oct 2017 20:26:11 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42141) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e0cQY-0000Ux-1H for qemu-devel@nongnu.org; Fri, 06 Oct 2017 19:53:10 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e0cQX-0006RC-8F for qemu-devel@nongnu.org; Fri, 06 Oct 2017 19:53:10 -0400 Received: from mail-qt0-x241.google.com ([2607:f8b0:400d:c0d::241]:51472) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1e0cQX-0006Qk-3S; Fri, 06 Oct 2017 19:53:09 -0400 Received: by mail-qt0-x241.google.com with SMTP id q4so34332092qtq.8; Fri, 06 Oct 2017 16:53:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=QnSAemlhAlxePX2Db1XfE+qraoQWJcXTmefuRFTkacs=; b=uea+WMpgJ2R3yhnRA7aE+r7vHGeU4xHH/Xsq+f7M2cr8VjuTEV9iCpX8u40e5xN0D1 VHPErV9NVm7w6a1khNF7IvKfHtScci+4f/gWIL1Ds734Sz1xKItYn9a0qpbn0qUJ04xL 1LTlO0BGPKhZVuzgqPasPA82QS/VM/09Oz+ooDKhOQwLydfVOWv+XCgU1VLzw7TLVP55 tC1Mbvl7YLc7OjDS2mZbZvBqEuK6gC3sZE2QR5ARMvjrGk/QdKcpto1H6Sjr62U5Cnen GBb+U2qlbMabERi4v+sLYa9kdxrxKVvV4xCvU9EYOaPe1Qy3jkoK6CmLJmkzFThWVbv/ Wfeg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=QnSAemlhAlxePX2Db1XfE+qraoQWJcXTmefuRFTkacs=; b=d3YRwrTV+xD5lnrQlb22D5j9j3cq1kMedpcpmVn9CMDklvFPGPh5QDmnm/Sj7XPSb1 nkSsyM7aEjbKXwRk8q4WjselpAOh7/Z9b3qSzXzu+nceU6SCOHTGvOYKWQ2fqwMD6lsg aBe/+tug27cYGGZwGzxNmuTyeAGCOktM6rQER/dXhura68xOD3HQnS2DJ6BgC9WmpBa/ S0H7/IDRKp33lYt2YjKq2bDIJ0ILY5iV1f40NHKm9g2ClzEadYv2hSR6HzhylHKT2+UZ B0QZRHNzagjXvpeK+iuvM/hpN1pe2cADpNTIaFLJBp6huEg1ZDullvZ9xmq9/bDUdiGZ Rm3A== X-Gm-Message-State: AMCzsaWG2qezMmbDqFid1u67iV+mrp8GRa0vJqgMtklMNxBigpNtRFWt TuNzBTilTh5yLSbAvo7dXjg= X-Google-Smtp-Source: AOwi7QBm4i8k6Z/+UAqZRtzUQKQBxF6BurSmrLZMTKfIxQkVYrnRZFw7CFplYAlUn0O/EFKl3O/WlQ== X-Received: by 10.237.60.101 with SMTP id u34mr5153388qte.153.1507333988567; Fri, 06 Oct 2017 16:53:08 -0700 (PDT) Received: from yoga.lan ([181.93.89.178]) by smtp.gmail.com with ESMTPSA id g1sm1705226qta.95.2017.10.06.16.53.05 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 06 Oct 2017 16:53:08 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Markus Armbruster , Eric Blake , Andrzej Zaborowski Date: Fri, 6 Oct 2017 20:49:40 -0300 Message-Id: <20171006235023.11952-46-f4bug@amsat.org> X-Mailer: git-send-email 2.14.2 In-Reply-To: <20171006235023.11952-1-f4bug@amsat.org> References: <20171006235023.11952-1-f4bug@amsat.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c0d::241 Subject: [Qemu-devel] [PATCH 45/88] hw/display: use g_new() family of functions X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , qemu trival , qemu-devel@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , qemu-arm@nongnu.org, =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Marc-André Lureau Signed-off-by: Marc-André Lureau Signed-off-by: Philippe Mathieu-Daudé [PMD: squashed pxa2xx_lcd.c] --- Andrzej should the tc6393xb files go under the PXA2XX section in MAINTAINERS? hw/display/pxa2xx_lcd.c | 2 +- hw/display/tc6393xb.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/display/pxa2xx_lcd.c b/hw/display/pxa2xx_lcd.c index 845521c5b2..0ca997cae2 100644 --- a/hw/display/pxa2xx_lcd.c +++ b/hw/display/pxa2xx_lcd.c @@ -1006,7 +1006,7 @@ PXA2xxLCDState *pxa2xx_lcdc_init(MemoryRegion *sysmem, PXA2xxLCDState *s; DisplaySurface *surface; - s = (PXA2xxLCDState *) g_malloc0(sizeof(PXA2xxLCDState)); + s = g_new0(PXA2xxLCDState, 1); s->invalidated = 1; s->irq = irq; s->sysmem = sysmem; diff --git a/hw/display/tc6393xb.c b/hw/display/tc6393xb.c index 74d10af3d4..2bd73a27e0 100644 --- a/hw/display/tc6393xb.c +++ b/hw/display/tc6393xb.c @@ -570,7 +570,7 @@ TC6393xbState *tc6393xb_init(MemoryRegion *sysmem, uint32_t base, qemu_irq irq) }, }; - s = (TC6393xbState *) g_malloc0(sizeof(TC6393xbState)); + s = g_new0(TC6393xbState, 1); s->irq = irq; s->gpio_in = qemu_allocate_irqs(tc6393xb_gpio_set, s, TC6393XB_GPIOS); From patchwork Fri Oct 6 23:49:41 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 822821 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="YA5rd6aG"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3y86nR3jQjz9t7x for ; Sat, 7 Oct 2017 11:28:59 +1100 (AEDT) Received: from localhost ([::1]:47744 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e0czB-0006BV-Hk for incoming@patchwork.ozlabs.org; Fri, 06 Oct 2017 20:28:57 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42179) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e0cQb-0000YL-7o for qemu-devel@nongnu.org; Fri, 06 Oct 2017 19:53:14 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e0cQa-0006UL-CL for qemu-devel@nongnu.org; Fri, 06 Oct 2017 19:53:13 -0400 Received: from mail-qt0-x243.google.com ([2607:f8b0:400d:c0d::243]:48143) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1e0cQa-0006Tg-7f; Fri, 06 Oct 2017 19:53:12 -0400 Received: by mail-qt0-x243.google.com with SMTP id d13so33659950qta.5; Fri, 06 Oct 2017 16:53:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=AwzxV1u+FMFWfMxm8oAn6a2MVILBkbhR53tGYP/q+ms=; b=YA5rd6aG69gS+uQ1/Ya/BtTe5PHGRUQElyajU/1zKuyK8pymK396xMPy1E1wHo8bbc EZ5bDzABKJpYoFOAwi3QPVtQQLU8NZm0Yvsrwlt9r+SlfmuVyapVLPDgjxiE82mOJfUS i6a1KLC+YI3wuLfry76brqwPoWMQAkKLpIMiYy7nQHqbnFnRTWO9Tm+yLvM8jSXYcmdE Ilhvky+jdORVpcWC3G2+IIP/42Is6vHLH4dFbqUrXm0A0/I/XN62IL/WgdJWSzKpDoEl 0Fq2EnmUDYXGzrNI0Cto0XLGd/LUTSVaz9QaqVaPc6jRN8JQroFvTDEUUYsrGBP5FJnJ AecA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=AwzxV1u+FMFWfMxm8oAn6a2MVILBkbhR53tGYP/q+ms=; b=l6ipSrhFo7VCFSTBa6WAtVnSjNp4XarWbqKXYukB2Ugf1hCEg3qyoUm2T4akc9T5eE SBqibNgGQinrDkczedqutDIhX0mC+mF34QFRiA3HG5dvHygVlpdX7LtyRSl/MNj7Ze46 +1/enKmsyIA68feZNz1aB58zVzZSST5H0EUt3E9oNumR+Xo9etPUB+brmV+VWDTUqMJQ Z60RPMARTiPNywlp+Iop9BGq4+lv5ytnKCqPhRcQYxcJ0rpVntUn8jEcc0u2gehIKm98 sLwt8jNwy2nGV80akuEdIYTfJRE5gW+qCAd/Nn9x3TrUXObaX+YCFz179SOmyL7V6mFr GVHQ== X-Gm-Message-State: AMCzsaWbLcoD8FIatnX/afmbc/DNxtpNSK/w0e6PWbMTM4Yy24thiH87 GUfB2c0C+GvrnWaHGnEukuM= X-Google-Smtp-Source: AOwi7QCG8KLe7wxrfd/gMfRTsBfKIhWQEv3k24U0hdikJ9ahcGX2qGd4liY/cofkhZGjVwQzwc02tg== X-Received: by 10.237.48.236 with SMTP id 99mr5560935qtf.316.1507333991686; Fri, 06 Oct 2017 16:53:11 -0700 (PDT) Received: from yoga.lan ([181.93.89.178]) by smtp.gmail.com with ESMTPSA id g1sm1705226qta.95.2017.10.06.16.53.08 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 06 Oct 2017 16:53:11 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Markus Armbruster , Eric Blake , Gerd Hoffmann Date: Fri, 6 Oct 2017 20:49:41 -0300 Message-Id: <20171006235023.11952-47-f4bug@amsat.org> X-Mailer: git-send-email 2.14.2 In-Reply-To: <20171006235023.11952-1-f4bug@amsat.org> References: <20171006235023.11952-1-f4bug@amsat.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c0d::243 Subject: [Qemu-devel] [PATCH 46/88] hw/display/vga: use g_new() family of functions X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , qemu trival , =?utf-8?q?Philippe_Mathieu-Dau?= =?utf-8?b?ZMOp?= , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Philippe Mathieu-Daudé --- Gerd: should those files go under Graphics section in MAINTAINERS? hw/display/vga-isa-mm.c | 6 +++--- hw/display/vga.c | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/hw/display/vga-isa-mm.c b/hw/display/vga-isa-mm.c index 51ccbccc41..7af72864df 100644 --- a/hw/display/vga-isa-mm.c +++ b/hw/display/vga-isa-mm.c @@ -105,12 +105,12 @@ static void vga_mm_init(ISAVGAMMState *s, hwaddr vram_base, MemoryRegion *s_ioport_ctrl, *vga_io_memory; s->it_shift = it_shift; - s_ioport_ctrl = g_malloc(sizeof(*s_ioport_ctrl)); + s_ioport_ctrl = g_new(MemoryRegion, 1); memory_region_init_io(s_ioport_ctrl, NULL, &vga_mm_ctrl_ops, s, "vga-mm-ctrl", 0x100000); memory_region_set_flush_coalesced(s_ioport_ctrl); - vga_io_memory = g_malloc(sizeof(*vga_io_memory)); + vga_io_memory = g_new(MemoryRegion, 1); /* XXX: endianness? */ memory_region_init_io(vga_io_memory, NULL, &vga_mem_ops, &s->vga, "vga-mem", 0x20000); @@ -130,7 +130,7 @@ int isa_vga_mm_init(hwaddr vram_base, { ISAVGAMMState *s; - s = g_malloc0(sizeof(*s)); + s = g_new0(ISAVGAMMState, 1); s->vga.vram_size_mb = VGA_RAM_SIZE >> 20; vga_common_init(&s->vga, NULL, true); diff --git a/hw/display/vga.c b/hw/display/vga.c index ed24ef7076..bdefa60f30 100644 --- a/hw/display/vga.c +++ b/hw/display/vga.c @@ -2236,7 +2236,7 @@ MemoryRegion *vga_init_io(VGACommonState *s, Object *obj, *vga_ports = vga_portio_list; *vbe_ports = vbe_portio_list; - vga_mem = g_malloc(sizeof(*vga_mem)); + vga_mem = g_new(MemoryRegion, 1); memory_region_init_io(vga_mem, obj, &vga_mem_ops, s, "vga-lowmem", 0x20000); memory_region_set_flush_coalesced(vga_mem); From patchwork Fri Oct 6 23:49:42 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 822812 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="MptSe0SB"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3y86fL65XZz9t4P for ; Sat, 7 Oct 2017 11:22:48 +1100 (AEDT) Received: from localhost ([::1]:47700 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e0ctB-0000dX-8J for incoming@patchwork.ozlabs.org; Fri, 06 Oct 2017 20:22:45 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42215) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e0cQg-0000bb-ER for qemu-devel@nongnu.org; Fri, 06 Oct 2017 19:53:19 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e0cQd-0006WV-JD for qemu-devel@nongnu.org; Fri, 06 Oct 2017 19:53:18 -0400 Received: from mail-qk0-x244.google.com ([2607:f8b0:400d:c09::244]:37988) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1e0cQd-0006WG-FB; Fri, 06 Oct 2017 19:53:15 -0400 Received: by mail-qk0-x244.google.com with SMTP id 17so5919173qkq.5; Fri, 06 Oct 2017 16:53:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=edaFnNj2NF0wlhE1awkFNUNVg++iVsowZaQaA7wkc9E=; b=MptSe0SBhxG38ezA0ohkTGQJeE1uDM4bMsjdT0bhbWhT8XjVhdQZgpRPYHuAfAjtKG HUCFw6J35ZmwUIoi3VurB8PcYRbbkXI6c9kDi0xI8reimteBV4cdF4ndH0iN4aJkXtCl boosc+WG78/U5lMBh/+r7c0le5jPtJvBH+IA+IrA9+lx/knOxjaVlbupp1jIbLX77vWi 6DhqXw+Z0EUXf80fiK4iOOCSvmtcO1VQG7s/KsjmWEGrJexu1+XrDhXfLAN4FieA4cgb vOacKlZAR+mQzT1+7qHLEk2MzWR7JIkThW9mDoSb2H9B5q00Moa7+IFltZokeWKctER2 YOYA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=edaFnNj2NF0wlhE1awkFNUNVg++iVsowZaQaA7wkc9E=; b=MRhX7yXqcKEbcpxIg2U3wr+8a4IRg8dnvROvRkV/DWsIuiSZ3EIvTxG85GtL1oj/AB tLpXr4hkb8t+0zNmQAomAmwwNSeeDH0OaWS3jNHi3m1pUyoJXcTESLAbU11IRIvkDjVn +fA3bwUz1oIxHggru20Bx9RookFFMTN3212OcyjUFJ3YPbeBHeLT2L8tZOX/xu3MklN7 LZdFKyxg7kkXugvhZXQYzmswPsVXCken2T9HjsG/K1gl85fK2sw7iRNbWQkcMiEZ/HXt XXQ9iT+FxFQgrUjMmTLnreR1KA61+fvnIDhzXEnJ5Egc0VWPAqrnQIzVfGECUHWcYpXs c29A== X-Gm-Message-State: AMCzsaUquvujW49ckykGKjFUWYM8Nc3oAbK6Ccu2wa9mbp7fPhv7rp60 zBwKSq3+QK7zpLNdgGyPt4Q= X-Google-Smtp-Source: AOwi7QBdS+ObTpGGO6M8+pWFV9EwfsNDfXKXj5KCI49czkQjM3yRhBwn6KyuwGW3AjuqS9EmMPzGJA== X-Received: by 10.55.181.129 with SMTP id e123mr765446qkf.128.1507333994896; Fri, 06 Oct 2017 16:53:14 -0700 (PDT) Received: from yoga.lan ([181.93.89.178]) by smtp.gmail.com with ESMTPSA id g1sm1705226qta.95.2017.10.06.16.53.11 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 06 Oct 2017 16:53:14 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Markus Armbruster , Eric Blake , Peter Maydell , Corey Minyard , Andrzej Zaborowski Date: Fri, 6 Oct 2017 20:49:42 -0300 Message-Id: <20171006235023.11952-48-f4bug@amsat.org> X-Mailer: git-send-email 2.14.2 In-Reply-To: <20171006235023.11952-1-f4bug@amsat.org> References: <20171006235023.11952-1-f4bug@amsat.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c09::244 Subject: [Qemu-devel] [PATCH 47/88] hw/i2c: use g_new() family of functions X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , qemu trival , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Marc-André Lureau Signed-off-by: Marc-André Lureau --- hw/i2c/bitbang_i2c.c | 2 +- hw/i2c/core.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/hw/i2c/bitbang_i2c.c b/hw/i2c/bitbang_i2c.c index 8be88ee265..20a9deef1a 100644 --- a/hw/i2c/bitbang_i2c.c +++ b/hw/i2c/bitbang_i2c.c @@ -186,7 +186,7 @@ bitbang_i2c_interface *bitbang_i2c_init(I2CBus *bus) { bitbang_i2c_interface *s; - s = g_malloc0(sizeof(bitbang_i2c_interface)); + s = g_new0(bitbang_i2c_interface, 1); s->bus = bus; s->last_data = 1; diff --git a/hw/i2c/core.c b/hw/i2c/core.c index 59068f157e..be84d6735f 100644 --- a/hw/i2c/core.c +++ b/hw/i2c/core.c @@ -132,7 +132,7 @@ int i2c_start_transfer(I2CBus *bus, uint8_t address, int recv) DeviceState *qdev = kid->child; I2CSlave *candidate = I2C_SLAVE(qdev); if ((candidate->address == address) || (bus->broadcast)) { - node = g_malloc(sizeof(struct I2CNode)); + node = g_new(struct I2CNode, 1); node->elt = candidate; QLIST_INSERT_HEAD(&bus->current_devs, node, next); if (!bus->broadcast) { @@ -258,7 +258,7 @@ static int i2c_slave_post_load(void *opaque, int version_id) bus = I2C_BUS(qdev_get_parent_bus(DEVICE(dev))); if ((bus->saved_address == dev->address) || (bus->saved_address == I2C_BROADCAST)) { - node = g_malloc(sizeof(struct I2CNode)); + node = g_new(struct I2CNode, 1); node->elt = dev; QLIST_INSERT_HEAD(&bus->current_devs, node, next); } From patchwork Fri Oct 6 23:49:43 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 822824 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="f15xcgSU"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3y86rP1JG1z9t2h for ; Sat, 7 Oct 2017 11:31:33 +1100 (AEDT) Received: from localhost ([::1]:47758 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e0d1e-0008R0-Ub for incoming@patchwork.ozlabs.org; Fri, 06 Oct 2017 20:31:31 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42236) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e0cQi-0000dN-3h for qemu-devel@nongnu.org; Fri, 06 Oct 2017 19:53:21 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e0cQh-0006Y6-7X for qemu-devel@nongnu.org; Fri, 06 Oct 2017 19:53:20 -0400 Received: from mail-qt0-x242.google.com ([2607:f8b0:400d:c0d::242]:50913) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1e0cQh-0006Xw-3Z; Fri, 06 Oct 2017 19:53:19 -0400 Received: by mail-qt0-x242.google.com with SMTP id f15so34352210qtf.7; Fri, 06 Oct 2017 16:53:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=k0eXN00AQ8GTUou7mfAYYCN+s5gjdW17Nycg9K+gzqE=; b=f15xcgSU3SAjrh8Bza/5pgEWQ0zlTUrwouzuMn3UIfRcu/NcgCAGAYiQ5BmdPHXBAC XwvE/IFIw57SLWBA37PeX4z1cHgqntkrgv/rc51TSbSUczwnXeurqk8vhYbcoROVOjYB mvWf9tfC67Vbw/CDjwJYau8gltZ/QNOY6VPSPOIb9hPSJt8Bygp4a2T/xqbZ9pSbSxwq vZGlyz+VOslbC49AJ4n/0eBtIHz0Y7gl935M1Mi9QX9+kL/hWspj027oNZjjXpOWL9r0 y1bRtq2ozlEd1DyEZ4bFbSgj0QXBlyyNXtPRoGuJ1l0q6oTH61ca9MboGcg5okouu22z fyjQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=k0eXN00AQ8GTUou7mfAYYCN+s5gjdW17Nycg9K+gzqE=; b=pmQK4khPmXRhfUk7eg7yK0kaMfP0KeZS6TIWK3TeiMr6BMbqUh2BLZN7Kz172nBmQn aT4MTXEzLX30/a1duYfUtYBskkTRHksz/VAGzgdaf14qamSmYHqvwSUlOBK48xG8s5CG dwXSYC4vbc4o6+ac3fjt1hxlJgW8q937CJzw1zIA1VfOn76V6xzYI6r5prCNm6VwKQe4 /zGbH+U7WDlSqxO+zlFWXe9ji8YCam1jq4vljeGZZTsCP3bLpDy7kZ6DAL3jSUbYwg7x NhHwCn1pKpciCdwDTZssPwLFZdLl20Lg1GFkz9aLz0vShZgjYdrtIKsqrOtloYaKSGh4 IKpg== X-Gm-Message-State: AMCzsaWBmUKYHZCupdgbAUOfxmF+fVTmGKFfoLSbRzSOI79hwWP+YEjz QW3tQU8i7GdWzBYGQaUa3z4= X-Google-Smtp-Source: AOwi7QDFv+2ZjKBfRbAPLVhGzEF8ZbpFju2Trxgob2H3DIBf38VZHUuGLQIj2N7A4+chsbjNLgn1qg== X-Received: by 10.200.56.108 with SMTP id r41mr5068034qtb.143.1507333998543; Fri, 06 Oct 2017 16:53:18 -0700 (PDT) Received: from yoga.lan ([181.93.89.178]) by smtp.gmail.com with ESMTPSA id g1sm1705226qta.95.2017.10.06.16.53.15 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 06 Oct 2017 16:53:17 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Markus Armbruster , Eric Blake , Andrzej Zaborowski , "M : Michael S . Tsirkin" , Paolo Bonzini , Gerd Hoffmann Date: Fri, 6 Oct 2017 20:49:43 -0300 Message-Id: <20171006235023.11952-49-f4bug@amsat.org> X-Mailer: git-send-email 2.14.2 In-Reply-To: <20171006235023.11952-1-f4bug@amsat.org> References: <20171006235023.11952-1-f4bug@amsat.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c0d::242 Subject: [Qemu-devel] [PATCH 48/88] hw/input: use g_new() family of functions X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , qemu trival , qemu-devel@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Marc-André Lureau Signed-off-by: Marc-André Lureau Signed-off-by: Philippe Mathieu-Daudé [PMD: squashed hw/input/pxa2xx_keypad.c] --- Andrzej: can you add an entry for tsc2005.c in MAINTAINERS? (or tell me where) hw/input/pckbd.c | 2 +- hw/input/ps2.c | 4 ++-- hw/input/pxa2xx_keypad.c | 2 +- hw/input/tsc2005.c | 3 +-- 4 files changed, 5 insertions(+), 6 deletions(-) diff --git a/hw/input/pckbd.c b/hw/input/pckbd.c index c479f827b6..ef9e055b1d 100644 --- a/hw/input/pckbd.c +++ b/hw/input/pckbd.c @@ -465,7 +465,7 @@ void i8042_mm_init(qemu_irq kbd_irq, qemu_irq mouse_irq, MemoryRegion *region, ram_addr_t size, hwaddr mask) { - KBDState *s = g_malloc0(sizeof(KBDState)); + KBDState *s = g_new0(KBDState, 1); s->irq_kbd = kbd_irq; s->irq_mouse = mouse_irq; diff --git a/hw/input/ps2.c b/hw/input/ps2.c index dff3f1e024..3e8f5ee98d 100644 --- a/hw/input/ps2.c +++ b/hw/input/ps2.c @@ -1296,7 +1296,7 @@ static QemuInputHandler ps2_keyboard_handler = { void *ps2_kbd_init(void (*update_irq)(void *, int), void *update_arg) { - PS2KbdState *s = (PS2KbdState *)g_malloc0(sizeof(PS2KbdState)); + PS2KbdState *s = g_new0(PS2KbdState, 1); trace_ps2_kbd_init(s); s->common.update_irq = update_irq; @@ -1318,7 +1318,7 @@ static QemuInputHandler ps2_mouse_handler = { void *ps2_mouse_init(void (*update_irq)(void *, int), void *update_arg) { - PS2MouseState *s = (PS2MouseState *)g_malloc0(sizeof(PS2MouseState)); + PS2MouseState *s = g_new0(PS2MouseState, 1); trace_ps2_mouse_init(s); s->common.update_irq = update_irq; diff --git a/hw/input/pxa2xx_keypad.c b/hw/input/pxa2xx_keypad.c index 2b70bbb95c..016b095e94 100644 --- a/hw/input/pxa2xx_keypad.c +++ b/hw/input/pxa2xx_keypad.c @@ -310,7 +310,7 @@ PXA2xxKeyPadState *pxa27x_keypad_init(MemoryRegion *sysmem, { PXA2xxKeyPadState *s; - s = (PXA2xxKeyPadState *) g_malloc0(sizeof(PXA2xxKeyPadState)); + s = g_new0(PXA2xxKeyPadState, 1); s->irq = irq; memory_region_init_io(&s->iomem, NULL, &pxa2xx_keypad_ops, s, diff --git a/hw/input/tsc2005.c b/hw/input/tsc2005.c index eb5320af40..34dd4ea0da 100644 --- a/hw/input/tsc2005.c +++ b/hw/input/tsc2005.c @@ -485,8 +485,7 @@ void *tsc2005_init(qemu_irq pintdav) { TSC2005State *s; - s = (TSC2005State *) - g_malloc0(sizeof(TSC2005State)); + s = g_new0(TSC2005State, 1); s->x = 400; s->y = 240; s->pressure = false; From patchwork Fri Oct 6 23:49:44 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 822828 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="hOX88c14"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3y86w55Dn8z9t3m for ; Sat, 7 Oct 2017 11:34:45 +1100 (AEDT) Received: from localhost ([::1]:47771 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e0d4l-0002Xq-OX for incoming@patchwork.ozlabs.org; Fri, 06 Oct 2017 20:34:43 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42274) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e0cQl-0000gn-DF for qemu-devel@nongnu.org; Fri, 06 Oct 2017 19:53:24 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e0cQk-0006ax-Pc for qemu-devel@nongnu.org; Fri, 06 Oct 2017 19:53:23 -0400 Received: from mail-qt0-x241.google.com ([2607:f8b0:400d:c0d::241]:51474) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1e0cQk-0006ak-Lo; Fri, 06 Oct 2017 19:53:22 -0400 Received: by mail-qt0-x241.google.com with SMTP id q4so34332582qtq.8; Fri, 06 Oct 2017 16:53:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=ZyghmgeowrOeYWPAWPdWiGRkj3RR6t7cAXme875MWUg=; b=hOX88c14ItvQq5hrEN/W+1mgZgY7k8G1p+WADliA4xpJ8EEueT93cApZJQ6dlYKbPn dFIewHRKiCewRwqbma1RYrR94Xd843lmMTvVke0eNu7rKw3E+AWXOvSFozlBOldQGCiS PqbK0tYcUjlFnMh/2zKZ7TrcdbEcbC2nrZyXvRcowfWvBviLevYJZXmPxQLDqprjwFgH JQQ11QSGtPubA3tq3yuu2lyOT5mbx7fKJsowPB70gZPU75MA4ZP2eoFXoHLnthRMxxU0 QZNypG+ZZBPdTSyXiIKNasUEn2LmzhhSb6Ry5ZwLO2h9Eil4bpWor15n5bQAG/tu0YC8 mPNQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=ZyghmgeowrOeYWPAWPdWiGRkj3RR6t7cAXme875MWUg=; b=JWd9WL8PUm9SS+TvZGIpfm3yCVbyfmBFS8TJKx2b0cD1SXBgUMv+C/2H2hniE3uYKr dO2dA3/3GMlQKyP7DXqwAC71a3cf3T0CR+oQm18Re6WmAGegoOfbjxkpKjqt+PmCkf5m /HDD2mR/1TDTVh7ten4AfAPMUjCbo91SbZKTQxkVgpNhh2jy87FeNYrZr7v2tfZ2K3n8 Vaj1XXrybP80ZRPX6oJvV6uUcGxqVwxurH+AY2G+mixoNQzz1vTjWVcRW5yNNqLH3XbH uqBiPDMetdd744W/Gn2Ae5B+721dTCFJYpqo7wYfsCxDIB7gkf6sK9BwUxNc058PmZca gonA== X-Gm-Message-State: AMCzsaUh33RMApmXel2LCc3fPMkc6n9O/gsENYw9Vlqlcdq98YvE6OZE pJ8XAJUYI4NQ+lHZS8Hau3g= X-Google-Smtp-Source: AOwi7QAI6Ph27pQU+q9M7JHHc37guv6xtMpPsKUzzDjP3Gf2VETW+Zw7va6bhTMUkdAi2vdFM2baHQ== X-Received: by 10.237.46.98 with SMTP id j89mr5833139qtd.182.1507334002167; Fri, 06 Oct 2017 16:53:22 -0700 (PDT) Received: from yoga.lan ([181.93.89.178]) by smtp.gmail.com with ESMTPSA id g1sm1705226qta.95.2017.10.06.16.53.18 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 06 Oct 2017 16:53:21 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Markus Armbruster , Eric Blake , Gerd Hoffmann , Gabriel Somlo , "Denis V. Lunev" , Anton Nefedov Date: Fri, 6 Oct 2017 20:49:44 -0300 Message-Id: <20171006235023.11952-50-f4bug@amsat.org> X-Mailer: git-send-email 2.14.2 In-Reply-To: <20171006235023.11952-1-f4bug@amsat.org> References: <20171006235023.11952-1-f4bug@amsat.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c0d::241 Subject: [Qemu-devel] [PATCH 49/88] hw/misc: use g_new() family of functions X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , qemu trival , qemu-devel@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Marc-André Lureau Signed-off-by: Marc-André Lureau Signed-off-by: Philippe Mathieu-Daudé [PMD: added hw/misc/pvpanic.c] Reviewed-by: Gabriel Somlo --- 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)); From patchwork Fri Oct 6 23:49:45 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 822814 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="kfnMle9l"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3y86fr6V6Qz9t4P for ; Sat, 7 Oct 2017 11:23:16 +1100 (AEDT) Received: from localhost ([::1]:47703 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e0cte-000149-Pi for incoming@patchwork.ozlabs.org; Fri, 06 Oct 2017 20:23:14 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42297) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e0cQp-0000jI-Gs for qemu-devel@nongnu.org; Fri, 06 Oct 2017 19:53:29 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e0cQn-0006cB-Tf for qemu-devel@nongnu.org; Fri, 06 Oct 2017 19:53:27 -0400 Received: from mail-qk0-x243.google.com ([2607:f8b0:400d:c09::243]:36748) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1e0cQn-0006c0-Pe; Fri, 06 Oct 2017 19:53:25 -0400 Received: by mail-qk0-x243.google.com with SMTP id z14so12861450qkg.3; Fri, 06 Oct 2017 16:53:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=O9bKfudW6f8SNHCIhSKJI9NDcD4/xEssUfEFcjfdl6A=; b=kfnMle9lNyryo9JVBRMVPhGOwuU245wLYMNfGtjPtJoaOZpIWmIXqWZpJxK6I1gtE6 GLNscjUSKt1XqM9kZhFfWuu1iLBAo4j7f5o2NcfVJF/C646LSVGiZ+MfcldmxZsbZyQq WS6aig2MGKG7n8y16Jes7vfp+hJNYVYoA9hUM0+x2wUeo92t/e1G42Tk7WpdPrTMqfnS V3JJLLyupraMsnPCWjHVIHnzpSx1TaR0ZqVoopwaccf46IvSKFQFjrf6OvyADTmT2FU5 HvVhAXydeh9c9Rz+Yfz4ohKWMun4tX85Zfnewdb6rh+BmaMFVOIiaHX8jFMBl62b91x9 iGcw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=O9bKfudW6f8SNHCIhSKJI9NDcD4/xEssUfEFcjfdl6A=; b=FtxfijK7nejO2alD53INHEQrhrMc1Ncw1wEwebdtivQdf+XmG9sjuQI2NKaNK0EghT SADRBeRwwrcbBRz7DYTeGUGCGi8kfvbs1ynEf6Ry/jlRuq4D+MdLZtejtFFV0KIGEl4Q UFwmsuQ8JIf2n8vXAQCKPjfuOkwfNxNdm17TCJD34B7t1M34JtUZrJsolvI9X6LMLyO0 RJNXVo03Z89qz27gLVzFfZTzzunu9+Wb4sxa79SXIBEAbMM5rH5LjHNKlKO/hH8PYRz3 4kXmG3yJIeYs0QD5Mcv13tEWx2h6LskSCBfwWtkYSs5mL/++OF7O+nRyY73fe12g+nTh oKsg== X-Gm-Message-State: AMCzsaUmLipnDU7adj25rHc5pxcnl1kWo0NwiuY/komjc7v0Bv3lV5cA kY5sBZHUkfu0kgHtq96QXC4= X-Google-Smtp-Source: AOwi7QBIkJxOpkQ7aXI9n0YCVYFfrAGcDE+rWhrx/tPCmCdPQsZrJ2mL1QmgqbUdzVcYn6fuhYxILA== X-Received: by 10.55.22.38 with SMTP id g38mr730372qkh.98.1507334005255; Fri, 06 Oct 2017 16:53:25 -0700 (PDT) Received: from yoga.lan ([181.93.89.178]) by smtp.gmail.com with ESMTPSA id g1sm1705226qta.95.2017.10.06.16.53.22 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 06 Oct 2017 16:53:24 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Markus Armbruster , Eric Blake , Paolo Bonzini , "Dr. David Alan Gilbert" Date: Fri, 6 Oct 2017 20:49:45 -0300 Message-Id: <20171006235023.11952-51-f4bug@amsat.org> X-Mailer: git-send-email 2.14.2 In-Reply-To: <20171006235023.11952-1-f4bug@amsat.org> References: <20171006235023.11952-1-f4bug@amsat.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c09::243 Subject: [Qemu-devel] [PATCH 50/88] ivshmem: use g_new() family of functions X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , qemu trival , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Marc-André Lureau Signed-off-by: Marc-André Lureau --- hw/misc/ivshmem.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/misc/ivshmem.c b/hw/misc/ivshmem.c index b3ef3ec1e3..9dd432a295 100644 --- a/hw/misc/ivshmem.c +++ b/hw/misc/ivshmem.c @@ -429,7 +429,7 @@ static void resize_peers(IVShmemState *s, int nb_peers) assert(nb_peers > old_nb_peers); IVSHMEM_DPRINTF("bumping storage to %d peers\n", nb_peers); - s->peers = g_realloc(s->peers, nb_peers * sizeof(Peer)); + s->peers = g_renew(Peer, s->peers, nb_peers); s->nb_peers = nb_peers; for (i = old_nb_peers; i < nb_peers; i++) { @@ -753,7 +753,7 @@ static void ivshmem_reset(DeviceState *d) static int ivshmem_setup_interrupts(IVShmemState *s, Error **errp) { /* allocate QEMU callback data for receiving interrupts */ - s->msi_vectors = g_malloc0(s->vectors * sizeof(MSIVector)); + s->msi_vectors = g_new0(MSIVector, s->vectors); if (ivshmem_has_feature(s, IVSHMEM_MSI)) { if (msix_init_exclusive_bar(PCI_DEVICE(s), s->vectors, 1, errp)) { From patchwork Fri Oct 6 23:49:46 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 822830 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="sxgNEOzf"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3y86xr73Qmz9t3m for ; Sat, 7 Oct 2017 11:36:16 +1100 (AEDT) Received: from localhost ([::1]:47789 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e0d6F-0003xF-0b for incoming@patchwork.ozlabs.org; Fri, 06 Oct 2017 20:36:15 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42320) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e0cQs-0000kK-HS for qemu-devel@nongnu.org; Fri, 06 Oct 2017 19:53:31 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e0cQr-0006dL-QC for qemu-devel@nongnu.org; Fri, 06 Oct 2017 19:53:30 -0400 Received: from mail-qt0-x241.google.com ([2607:f8b0:400d:c0d::241]:56009) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1e0cQr-0006dA-Ld; Fri, 06 Oct 2017 19:53:29 -0400 Received: by mail-qt0-x241.google.com with SMTP id x54so34278818qth.12; Fri, 06 Oct 2017 16:53:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=49NwupevJ+PbpOKOE8EAPS+cws/gv4+UP3rDgHzT8C8=; b=sxgNEOzfmVkWD4Nm/dTGf5Q71vO9ej4bPGh6pMyfcHEyStSZRnwoDZe5YEvSOOShm8 Y+n1HQZBlEDBaD7xv+5KWduCdg42rkTwJTCZs7F2jup1kXXsz89u5ESldPdLswus4L0i 7ZVkKMSg/sINgqakHNdZhp8/LKV58eWf1+Fjuef0LITDbbxUZ6cviHQyvBfYiRKJHBxn X9i7KpUi2dPyT7EhZNfzm0BaLTAxZJO5zchcjZTv53Vs7CDKQV//4eWQYLMS71ZrikOh qI0c2Axv4csO/RZFHVcmvr+i5DnLHw0KzBkmlp0h7xAO8QKZCJTvTBHlfP8+No3m9jzC gClg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=49NwupevJ+PbpOKOE8EAPS+cws/gv4+UP3rDgHzT8C8=; b=emZC0RU+5aAHNhF59KBXEVJcAhBETYGX2283nSL6T+hvYLX+lwugJGZucjgzCDqDgp kPHRtPQbKS1JYP1RdLaEWYwiZ/ZLkt8kyJGF4bsrPmTt/4PB7B8YJwC0zb3xSIt72EgK 2N9tmYk2OMod/yoww9dZkWCNo2uhPAPjKEj8wEh8jRRSM16tRPTo14+AoqLxM45o48Ez 4Eaq/McpvhUKHHNNxKjqPzg5ISiK9/6A+0y+xVCUmA9xomN891JbOYyCD+K0B/7w4f/J sftKHTB164kHrv7qxyfx1ScfZBnsyeovfMGqAANxTudllWaWJxhPdsfWhnmoek6WWNc+ XpWw== X-Gm-Message-State: AMCzsaVI3XQY1sULqxE6RRQHg7lh7+MeAsvpowN4QM+TRocb/Mes2HZm FsKSlGz42K14hsi5e5O3mBs= X-Google-Smtp-Source: AOwi7QDk3xnjHPwZejU+usFgEmI6PIryWoUVDvAqChw0RaC/CN+5sGnRAwjUaRU7r6lU0KztPYPO/g== X-Received: by 10.200.52.56 with SMTP id u53mr5498990qtb.16.1507334009152; Fri, 06 Oct 2017 16:53:29 -0700 (PDT) Received: from yoga.lan ([181.93.89.178]) by smtp.gmail.com with ESMTPSA id g1sm1705226qta.95.2017.10.06.16.53.25 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 06 Oct 2017 16:53:28 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Markus Armbruster , Eric Blake , xiaoqiang zhao , Mark Cave-Ayland , Artyom Tarasenko Date: Fri, 6 Oct 2017 20:49:46 -0300 Message-Id: <20171006235023.11952-52-f4bug@amsat.org> X-Mailer: git-send-email 2.14.2 In-Reply-To: <20171006235023.11952-1-f4bug@amsat.org> References: <20171006235023.11952-1-f4bug@amsat.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c0d::241 Subject: [Qemu-devel] [PATCH 51/88] hw/timer: use g_new() family of functions X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , qemu trival , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Marc-André Lureau Signed-off-by: Marc-André Lureau Reviewed-by: xiaoqiang zhao Reviewed-by: xiaoqiang zhao --- hw/timer/slavio_timer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/timer/slavio_timer.c b/hw/timer/slavio_timer.c index a8cc9c0148..6d0282a788 100644 --- a/hw/timer/slavio_timer.c +++ b/hw/timer/slavio_timer.c @@ -385,7 +385,7 @@ static void slavio_timer_init(Object *obj) uint64_t size; char timer_name[20]; - tc = g_malloc0(sizeof(TimerContext)); + tc = g_new0(TimerContext, 1); tc->s = s; tc->timer_index = i; From patchwork Fri Oct 6 23:49:47 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 822816 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="iaqz5SlR"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3y86jv5gxhz9t4r for ; Sat, 7 Oct 2017 11:25:55 +1100 (AEDT) Received: from localhost ([::1]:47722 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e0cwD-0003RC-Fc for incoming@patchwork.ozlabs.org; Fri, 06 Oct 2017 20:25:53 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42379) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e0cQz-0000r3-5Z for qemu-devel@nongnu.org; Fri, 06 Oct 2017 19:53:38 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e0cQw-0006fP-4F for qemu-devel@nongnu.org; Fri, 06 Oct 2017 19:53:37 -0400 Received: from mail-qk0-x244.google.com ([2607:f8b0:400d:c09::244]:33099) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1e0cQv-0006fD-W9; Fri, 06 Oct 2017 19:53:34 -0400 Received: by mail-qk0-x244.google.com with SMTP id z12so9700654qkb.0; Fri, 06 Oct 2017 16:53:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=K11BF4s8VQOqU6nEorWyCTrelnBi8QPU65wJU5KBOvQ=; b=iaqz5SlRs2WeBmN3/1CEh38Cll16nB1xATBjYxS/1uKy+OiTMFIuM2WJkNIQxXKLJR ZIN4j5E2bNZCHiTn6bSTdLtuCJ5Y71LKwdhMErVEOTiLnn1IwrWZXDSEnJWRF+SyUFz0 en6/LCQvt08ML+ce1qbEn+4DTi5hw4zt+RsqeDs0MZWLGSNEGWUTGM3jZOKHIMXK+3+8 tT/3FEL1dJixGgjOoVDLZ906gS0u2SPcYCETyhsGwIl7B7e7gUjwG+wObBaCd7bYbnd0 NC40TXs4ApTsWA+RPXo+pYw+e2yFNF/qKyYEPoSpoYtmUo5qGQgTXYkX1puPsC42Gajf pdCg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=K11BF4s8VQOqU6nEorWyCTrelnBi8QPU65wJU5KBOvQ=; b=Ch/jlhXD8F22dd3hQP+RneVxRQ/7RodELMSPxTDCOmII1VQeyIjGAoS7Lq+le6YOyw s0g0uu8DZKX4mygxPrPHV5x5BIn2FTg1SiyCPDqBNXP8dhuIDy6KXwV2d520Nw4BpUMJ ngTrGmxAHcVh+wi+YOHdgxIU9ggDhuibe8G0jOXDV8E2B2pSj+n8zKS1UC3KlrRS3kE3 JH2qFw6HDpfk/PTGlV5bw4rwKB0ZmIVYtIQdxKypxIfh9WqFcwlka5uHrTSGgrjoCer9 0sb971LLiNB+/xcf8bs/eT+09mxjOD3wa9MjVZOxRXmKmuToZYILAWaRQfIAJOlLmt6m lsLQ== X-Gm-Message-State: AMCzsaUe4FplMtOIHiam4Utdc/KAbUmivvBMsWH0weQ5vkBQAJKpbS24 3xHpuq1xjOYOJHhEDz2AAyU= X-Google-Smtp-Source: AOwi7QCVN20tIASnmxLG1u0cgLNgyEj8L9oOsss9VN33Wu+viT4+9h780aY53U6Wq1YTm9Wp6u08VA== X-Received: by 10.55.25.85 with SMTP id k82mr624058qkh.223.1507334013457; Fri, 06 Oct 2017 16:53:33 -0700 (PDT) Received: from yoga.lan ([181.93.89.178]) by smtp.gmail.com with ESMTPSA id g1sm1705226qta.95.2017.10.06.16.53.29 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 06 Oct 2017 16:53:32 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Markus Armbruster , Eric Blake , Peter Chubb Date: Fri, 6 Oct 2017 20:49:47 -0300 Message-Id: <20171006235023.11952-53-f4bug@amsat.org> X-Mailer: git-send-email 2.14.2 In-Reply-To: <20171006235023.11952-1-f4bug@amsat.org> References: <20171006235023.11952-1-f4bug@amsat.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c09::244 Subject: [Qemu-devel] [PATCH 52/88] i.MX31: use g_new() family of functions X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , qemu trival , qemu-devel@nongnu.org, qemu-arm@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Marc-André Lureau Signed-off-by: Marc-André Lureau --- hw/misc/imx6_src.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/misc/imx6_src.c b/hw/misc/imx6_src.c index cfb08710fb..9342bce6de 100644 --- a/hw/misc/imx6_src.c +++ b/hw/misc/imx6_src.c @@ -149,7 +149,7 @@ static void imx6_defer_clear_reset_bit(int cpuid, return; } - ri = g_malloc(sizeof(struct SRCSCRResetInfo)); + ri = g_new(struct SRCSCRResetInfo, 1); ri->s = s; ri->reset_bit = reset_shift; From patchwork Fri Oct 6 23:49:48 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 822834 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="ISCgSry7"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3y870p73vQz9t4b for ; Sat, 7 Oct 2017 11:38:50 +1100 (AEDT) Received: from localhost ([::1]:47799 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e0d8j-0006i2-2F for incoming@patchwork.ozlabs.org; Fri, 06 Oct 2017 20:38:49 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42422) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e0cR1-0000tL-FD for qemu-devel@nongnu.org; Fri, 06 Oct 2017 19:53:40 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e0cR0-0006iT-S8 for qemu-devel@nongnu.org; Fri, 06 Oct 2017 19:53:39 -0400 Received: from mail-qk0-x242.google.com ([2607:f8b0:400d:c09::242]:35192) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1e0cR0-0006i3-N0; Fri, 06 Oct 2017 19:53:38 -0400 Received: by mail-qk0-x242.google.com with SMTP id w63so11297853qkd.2; Fri, 06 Oct 2017 16:53:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=jIrG+a6KimlGzqMXERmfHO2ieK/rsLvFRe7ABtgy544=; b=ISCgSry7u0NSsjcT4JS7WcFdzSmn8owFz9Q62WUW+OMu8DJ02SKX8+edAMjV74EzMA 0LzLBDNdBay5JDIK3qBP984FhgFPdXb/+4Tfhhpuj7SvnReBaitLDtof2fr5Cjrtdh1n LCSwZGvfHU/iiH4WzJmo5QJZnD1a2oz5nRevqihjC1VEk32JsJXxkNXz+3NzOpOjAjBJ IUCOIhjn6YJgrJce1ipYWGO7Q6xOd2YrMlOBXF3fbY/uAMpbO1ZQmY9YdhRmsn9k63DJ Luih96dF1C2QXyRfkLEvulTrcvIWAo3dbPbh7Dp4QPeFNP7U+gJBT642CJidIW+s0Nm7 qT/A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=jIrG+a6KimlGzqMXERmfHO2ieK/rsLvFRe7ABtgy544=; b=hTW6m/VLzMg0jBHjht08Ro5faG6s0FJtFRGQmMZhCRXnmbsiIio0+4zPemGWmCLe6Q inqCZfl/imif6rAxZ57yieuUq28s6JsMfktwaWyIpvJXuS+EiqUV5EOh9kct72o9F/B6 959rtWKdZafOMwUeanokUW7gf5C7hEK01sR2jdlO+kyr/Aqyby366K2JrSzgNamrpxyH +QBiDy1pP6ybnAD6mA4b2zuAQwbQWNS52I5wDFLx1HAuwlyHhWHdbQFBnMnKkq/7jLvg ErhE9fmwadtTsJTrzoReA13ZhztqXxb+PLWhVzrOgqBlCskR/uQhAT7yqQQVXjNGhV7V LhxQ== X-Gm-Message-State: AMCzsaVsv01CsdYRPuaHaHMZ9Rhsyr+DmG6ALbMKPvoc53xLTzW4FZb3 Y45cjlqLtDRXjoLV6UyDMjs= X-Google-Smtp-Source: AOwi7QCaLGO0Gbp40uk0XD218uquauaqpo9Upsr4mgv4cK5xYQT19sqlblif+maxPIC0vh6yzfnvHw== X-Received: by 10.55.127.70 with SMTP id a67mr698163qkd.90.1507334018182; Fri, 06 Oct 2017 16:53:38 -0700 (PDT) Received: from yoga.lan ([181.93.89.178]) by smtp.gmail.com with ESMTPSA id g1sm1705226qta.95.2017.10.06.16.53.33 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 06 Oct 2017 16:53:37 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Markus Armbruster , Eric Blake , Ronnie Sahlberg , Paolo Bonzini , Peter Lieven , Kevin Wolf , Max Reitz Date: Fri, 6 Oct 2017 20:49:48 -0300 Message-Id: <20171006235023.11952-54-f4bug@amsat.org> X-Mailer: git-send-email 2.14.2 In-Reply-To: <20171006235023.11952-1-f4bug@amsat.org> References: <20171006235023.11952-1-f4bug@amsat.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c09::242 Subject: [Qemu-devel] [PATCH 53/88] iSCSI: use g_new() family of functions X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu trival , =?utf-8?q?Marc-Andr=C3=A9_Lurea?= =?utf-8?q?u?= , qemu-devel@nongnu.org, qemu-block@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Marc-André Lureau Signed-off-by: Marc-André Lureau --- block/iscsi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/block/iscsi.c b/block/iscsi.c index 4683f3b244..f9f910168d 100644 --- a/block/iscsi.c +++ b/block/iscsi.c @@ -1001,7 +1001,7 @@ static BlockAIOCB *iscsi_aio_ioctl(BlockDriverState *bs, return NULL; } - acb->task = malloc(sizeof(struct scsi_task)); + acb->task = g_new(struct scsi_task, 1); if (acb->task == NULL) { error_report("iSCSI: Failed to allocate task for scsi command. %s", iscsi_get_error(iscsi)); From patchwork Fri Oct 6 23:49:49 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 822833 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="HHja9FQX"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3y86zp0wVrz9t3m for ; Sat, 7 Oct 2017 11:37:58 +1100 (AEDT) Received: from localhost ([::1]:47797 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e0d7s-0005gB-2U for incoming@patchwork.ozlabs.org; Fri, 06 Oct 2017 20:37:56 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42477) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e0cR5-0000xl-9P for qemu-devel@nongnu.org; Fri, 06 Oct 2017 19:53:46 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e0cR4-0006mw-KN for qemu-devel@nongnu.org; Fri, 06 Oct 2017 19:53:43 -0400 Received: from mail-qk0-x242.google.com ([2607:f8b0:400d:c09::242]:33100) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1e0cR4-0006ma-FR; Fri, 06 Oct 2017 19:53:42 -0400 Received: by mail-qk0-x242.google.com with SMTP id z12so9700751qkb.0; Fri, 06 Oct 2017 16:53:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=ykI4tnSUBkLz8hzKxB9N2iyqvP6oAmt1ciyJeGB7v/c=; b=HHja9FQXhlZibjKWra5LZLQX77bxC4ibNNhZcp7+2PYtTyz+bBH0m48juFGUEssayT AaT0IcXlysGlxe3vVUUwwYLwWgjYFpyR2Hi1RuFKjUw9XVPIAu61i8GIsztQOwq/WhoQ 5h5jsP/kDLVT0n2DX6b5ztpDoKQeyR+x24thQ4CSOF9hTzprfrAzLrzLofwajoIX51Wf wKOo5aPHh+nX60N5F3bpaL+ie5xfjSetIlcN/jsUTxZeEK60ko1sATYzU9XXR+muZVMl q6U75Sg8wk3WT78bWtmi6nKCfYiU1gnn7XSyGnlGskLLVCWS3Z/4E3m9KSenX3l6sUTm g8Vg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=ykI4tnSUBkLz8hzKxB9N2iyqvP6oAmt1ciyJeGB7v/c=; b=k8mZ8vLV5IKpPOGxj+MXx9RyEQUDsM2L+mubzkznrppH9GkIzat4u4gTBUYx/Yhu+F yNatuDfW3T7K74Spl3e/WDyDhSevdC6+SMaKA6DIHi62Nof6I+fCA6l6LxKdZMcmAEff B59DdP6kwgx7RbdtVXaPeCMjxe3i8MLJifTx5I86iMSsNDcvkZ1N8bVU1CZl9xean2YT sQcr6w3arKX9esj/mWsKjr7Iq1pjZT7Vf5XVvdpsFcUYNRbbNgLT9JjxnSsiE0akul2y ioDgBGIINRvKhGCmLwJVb4qD4GVD6PtWfTwO1K+en+BaPVjT7nhF/hnRVbXJBeJzsUiW bbbw== X-Gm-Message-State: AMCzsaU79hXqtfTbPMzdH9mU8hefKIitTUUQJeuk3oAczIC5A7OiUIRC jIGTQdZZPJv8mYK0Rbcri0U= X-Google-Smtp-Source: AOwi7QCvdc2uq3J7s9Hd6sA1uqX4omoq3y9CsqJMIAw18FRnMociFrs+lDfNsU2t0gqKJ3GeKCsu9Q== X-Received: by 10.55.91.69 with SMTP id p66mr694664qkb.167.1507334021939; Fri, 06 Oct 2017 16:53:41 -0700 (PDT) Received: from yoga.lan ([181.93.89.178]) by smtp.gmail.com with ESMTPSA id g1sm1705226qta.95.2017.10.06.16.53.38 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 06 Oct 2017 16:53:41 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Markus Armbruster , Eric Blake , Paolo Bonzini , kvm@vger.kernel.org Date: Fri, 6 Oct 2017 20:49:49 -0300 Message-Id: <20171006235023.11952-55-f4bug@amsat.org> X-Mailer: git-send-email 2.14.2 In-Reply-To: <20171006235023.11952-1-f4bug@amsat.org> References: <20171006235023.11952-1-f4bug@amsat.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c09::242 Subject: [Qemu-devel] [PATCH 54/88] KVM: use g_new() family of functions X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , qemu trival , qemu-devel@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Marc-André Lureau Signed-off-by: Marc-André Lureau Signed-off-by: Philippe Mathieu-Daudé [PMD: more changes] Reviewed-by: Gabriel Somlo --- accel/kvm/kvm-all.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/accel/kvm/kvm-all.c b/accel/kvm/kvm-all.c index 90c88b517d..12568d703c 100644 --- a/accel/kvm/kvm-all.c +++ b/accel/kvm/kvm-all.c @@ -278,7 +278,7 @@ int kvm_destroy_vcpu(CPUState *cpu) goto err; } - vcpu = g_malloc0(sizeof(*vcpu)); + vcpu = g_new0(struct KVMParkedVcpu, 1); vcpu->vcpu_id = kvm_arch_vcpu_id(cpu); vcpu->kvm_fd = cpu->kvm_fd; QLIST_INSERT_HEAD(&kvm_state->kvm_parked_vcpus, vcpu, node); @@ -865,7 +865,7 @@ void kvm_memory_listener_register(KVMState *s, KVMMemoryListener *kml, { int i; - kml->slots = g_malloc0(s->nr_slots * sizeof(KVMSlot)); + kml->slots = g_new0(KVMSlot, s->nr_slots); kml->as_id = as_id; for (i = 0; i < s->nr_slots; i++) { @@ -1129,7 +1129,7 @@ int kvm_irqchip_send_msi(KVMState *s, MSIMessage msg) return virq; } - route = g_malloc0(sizeof(KVMMSIRoute)); + route = g_new0(KVMMSIRoute, 1); route->kroute.gsi = virq; route->kroute.type = KVM_IRQ_ROUTING_MSI; route->kroute.flags = 0; @@ -2243,7 +2243,7 @@ int kvm_insert_breakpoint(CPUState *cpu, target_ulong addr, return 0; } - bp = g_malloc(sizeof(struct kvm_sw_breakpoint)); + bp = g_new(struct kvm_sw_breakpoint, 1); bp->pc = addr; bp->use_count = 1; err = kvm_arch_insert_sw_breakpoint(cpu, bp); From patchwork Fri Oct 6 23:49:50 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 822818 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="FU7xkhC+"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3y86kN25nnz9t4r for ; Sat, 7 Oct 2017 11:26:20 +1100 (AEDT) Received: from localhost ([::1]:47728 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e0cwc-0003ps-9r for incoming@patchwork.ozlabs.org; Fri, 06 Oct 2017 20:26:18 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42537) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e0cR9-00011B-07 for qemu-devel@nongnu.org; Fri, 06 Oct 2017 19:53:47 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e0cR8-0006rO-94 for qemu-devel@nongnu.org; Fri, 06 Oct 2017 19:53:47 -0400 Received: from mail-qk0-x242.google.com ([2607:f8b0:400d:c09::242]:37991) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1e0cR8-0006qq-5T; Fri, 06 Oct 2017 19:53:46 -0400 Received: by mail-qk0-x242.google.com with SMTP id 17so5919590qkq.5; Fri, 06 Oct 2017 16:53:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=hAX8a1zhko+r8FcH7TTw6l2tfK33CDbsSZ5ACwAaIT0=; b=FU7xkhC+QX6lQs2a52nIMlZaMQhPkF56t5tN1xUXNr/jeXWPNhIRlq0dVhHAI26k5i VuueyJrpe5LV0RMMOXO8c56+zJAmOBX9dkZxAbpJwYbagF+EB6VEoUdtYWNPUb6nVZpI EfKgeRJpnwW9dskyd2I/o8u9/DAfud9d5oC8xG9ljm2ZF988+ilmOMsBx7bo0yiIY0Fo 1f1bgL9qOQYsaEFjzTJmowsqz8mkYZTGPZlG1vKC2ETRch0gcacXbnwxbEyMwcNeJuKV dFv+Ng+YSIDKqCnqSSQOjnNDmUqLkC+qKSLDKmQVVQZKnkklCAM9+rg0Xbi4idBUaFfd A5iQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=hAX8a1zhko+r8FcH7TTw6l2tfK33CDbsSZ5ACwAaIT0=; b=aS3k0CyuTdJ2XO37/bYpOh6KN4V9yafiGgkRPaJxI1sUEjDksyFxYFtXLonjyb4kKR WFXd7i9Zl1jWMeItNneqpuZIdAK5Nwc3Q9mSLNacZoYkAfgsy2bZdan/4obbVdfkHCg3 5qrRUql1x4enQb6gco2BkGStPl9GIW1Mlf8FaNhCUts3pT5BKWQUIu1aDru3mXU3AgV6 HpRSQyO+FpW0Cf12JKHntJsUGMrspmlzMhTG48cWu1n4k7nkURn4xdhlTX9x9RQw3iUb 0pIruyDaKofbcuaqAOciiPuqZIpLfX6T1yUoL+VDkspPRexBM5j3L9uYyw5tVF4VIgp9 BXZw== X-Gm-Message-State: AMCzsaX8vmKTubq+rucfRsaZP2QghefahrL8vXEZhr9375pCmzyctubf gFRS6O4oYgMIjvHL3UhOHJE= X-Google-Smtp-Source: AOwi7QA6iY9YcX1ITDErLB7ddzxtj01OBZaewjSlZ+IMAuVjcGSe+zuFS8acMYZzpnebfLZh+m70+w== X-Received: by 10.55.140.68 with SMTP id o65mr727713qkd.293.1507334025648; Fri, 06 Oct 2017 16:53:45 -0700 (PDT) Received: from yoga.lan ([181.93.89.178]) by smtp.gmail.com with ESMTPSA id g1sm1705226qta.95.2017.10.06.16.53.42 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 06 Oct 2017 16:53:45 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Markus Armbruster , Eric Blake , =?utf-8?q?Herv=C3=A9_Poussineau?= , David Gibson , Alexander Graf Date: Fri, 6 Oct 2017 20:49:50 -0300 Message-Id: <20171006235023.11952-56-f4bug@amsat.org> X-Mailer: git-send-email 2.14.2 In-Reply-To: <20171006235023.11952-1-f4bug@amsat.org> References: <20171006235023.11952-1-f4bug@amsat.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c09::242 Subject: [Qemu-devel] [PATCH 55/88] PReP: use g_new() family of functions X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , qemu trival , qemu-ppc@nongnu.org, qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Marc-André Lureau Signed-off-by: Marc-André Lureau Acked-by: David Gibson --- hw/ppc/prep.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/ppc/prep.c b/hw/ppc/prep.c index 94138a4e8c..c638d3d17a 100644 --- a/hw/ppc/prep.c +++ b/hw/ppc/prep.c @@ -512,7 +512,7 @@ static void ppc_prep_init(MachineState *machine) int ppc_boot_device; DriveInfo *hd[MAX_IDE_BUS * MAX_IDE_DEVS]; - sysctrl = g_malloc0(sizeof(sysctrl_t)); + sysctrl = g_new0(sysctrl_t, 1); linux_boot = (kernel_filename != NULL); From patchwork Fri Oct 6 23:49:51 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 822837 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="uFZM1Gtw"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3y872f1cr0z9t4X for ; Sat, 7 Oct 2017 11:40:26 +1100 (AEDT) Received: from localhost ([::1]:47805 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e0dAG-0008Bm-98 for incoming@patchwork.ozlabs.org; Fri, 06 Oct 2017 20:40:24 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42613) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e0cRD-000163-4r for qemu-devel@nongnu.org; Fri, 06 Oct 2017 19:53:52 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e0cRC-0006x4-16 for qemu-devel@nongnu.org; Fri, 06 Oct 2017 19:53:51 -0400 Received: from mail-qk0-x242.google.com ([2607:f8b0:400d:c09::242]:34146) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1e0cRB-0006wM-SY; Fri, 06 Oct 2017 19:53:49 -0400 Received: by mail-qk0-x242.google.com with SMTP id b124so10272919qke.1; Fri, 06 Oct 2017 16:53:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=JeQSNHXuKQzQ/GdktK/KDg07Hpoa0RCBsuEhP5sLZPc=; b=uFZM1GtwIg2Z2TNIXoDNhPUQBoWWbqxPnYwGDoNts6u7ZF5+cNOlCjR4gbmWp1ISYi koDMHuVx0U/YIAFfeJIFE06hLtcXMxyYThUuOB8CeI3dGolqBZGvvMt0PzSyUDafP8U1 7YoWDcu50Xaj5X00GtfZyUd/UgPJca5HC9u67RqoiADRh1n2KcmU6nzh1A6wEqiaeIns nKGVV4hwSO6Mfqh+EolnfsCMPkMPSzRhFwTZDl+iRXvqc0JSLcoXopBOxYYHHErEv+wr ESfTkLS0StigYdFoIa7SltP/2ChBGu7cnztU3TXaYCEonCKURPbupzPGqWW6QTo1qJNr dirg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=JeQSNHXuKQzQ/GdktK/KDg07Hpoa0RCBsuEhP5sLZPc=; b=pwiMB5rU9g3BaTgnDw9hnmlVAfh9yhpGQsRlz1aurj6gLNIG3w6HDyfgxFFTSnIKde WcDfUoF9VzEQBWlZkqa4x4aZ0YwUzHrDciV8rAM9E8TazrIaRAR/IecUWTSZsl4Gj6yQ y/E5JdyTxa8Q/A9d6Fe+GckfSnSVGExly+wQXXLl/cH/zkQYRJbXT8dYSvBcWegmlSva gLN4SevlcJeuxPhn4Qwmwqq6uwyjDK6PLKnXan5mIze1GPxJucNw3GhNaPMcFpILQqx7 7gmWEWD528/SNAtUje3h6xS6ApP5UxDT+7zUvwdXrfEk6+hXEoci7ZufrE4I8UA5hPeK zEyw== X-Gm-Message-State: AMCzsaWyNWSdtWwN0AAXitM9xGrVIyCS1QVXhWMqyjWbNA4RxwdnSzmi x4JL4kaJAiI5uDroW7s3D58= X-Google-Smtp-Source: AOwi7QBDKIQB6tBFONb28dg5xuV1T4NfGKyztfr4Pbgsr/BSJ7L0/BT4YAorzZW7ZC8EyFnxJ5ebNA== X-Received: by 10.55.19.146 with SMTP id 18mr660468qkt.33.1507334029303; Fri, 06 Oct 2017 16:53:49 -0700 (PDT) Received: from yoga.lan ([181.93.89.178]) by smtp.gmail.com with ESMTPSA id g1sm1705226qta.95.2017.10.06.16.53.45 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 06 Oct 2017 16:53:48 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Markus Armbruster , Eric Blake , David Gibson , Alexander Graf Date: Fri, 6 Oct 2017 20:49:51 -0300 Message-Id: <20171006235023.11952-57-f4bug@amsat.org> X-Mailer: git-send-email 2.14.2 In-Reply-To: <20171006235023.11952-1-f4bug@amsat.org> References: <20171006235023.11952-1-f4bug@amsat.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c09::242 Subject: [Qemu-devel] [PATCH 56/88] PowerPC: use g_new() family of functions X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , qemu trival , qemu-devel@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , qemu-ppc@nongnu.org, =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Marc-André Lureau Signed-off-by: Marc-André Lureau Signed-off-by: Philippe Mathieu-Daudé [PMD: one more change in target/ppc/translate_init.c, added target/ppc/kvm.c] Acked-by: David Gibson --- hw/ppc/ppc.c | 8 ++++---- hw/ppc/ppc_booke.c | 4 ++-- target/ppc/kvm.c | 2 +- target/ppc/translate_init.c | 14 +++++++------- 4 files changed, 14 insertions(+), 14 deletions(-) diff --git a/hw/ppc/ppc.c b/hw/ppc/ppc.c index 05da316e0b..647d70fc13 100644 --- a/hw/ppc/ppc.c +++ b/hw/ppc/ppc.c @@ -965,7 +965,7 @@ clk_setup_cb cpu_ppc_tb_init (CPUPPCState *env, uint32_t freq) PowerPCCPU *cpu = ppc_env_get_cpu(env); ppc_tb_t *tb_env; - tb_env = g_malloc0(sizeof(ppc_tb_t)); + tb_env = g_new0(ppc_tb_t, 1); env->tb_env = tb_env; tb_env->flags = PPC_DECR_UNDERFLOW_TRIGGERED; if (env->insns_flags & PPC_SEGMENT_64B) { @@ -1224,10 +1224,10 @@ clk_setup_cb ppc_40x_timers_init (CPUPPCState *env, uint32_t freq, ppc_tb_t *tb_env; ppc40x_timer_t *ppc40x_timer; - tb_env = g_malloc0(sizeof(ppc_tb_t)); + tb_env = g_new0(ppc_tb_t, 1); env->tb_env = tb_env; tb_env->flags = PPC_DECR_UNDERFLOW_TRIGGERED; - ppc40x_timer = g_malloc0(sizeof(ppc40x_timer_t)); + ppc40x_timer = g_new0(ppc40x_timer_t, 1); tb_env->tb_freq = freq; tb_env->decr_freq = freq; tb_env->opaque = ppc40x_timer; @@ -1332,7 +1332,7 @@ int ppc_dcr_init (CPUPPCState *env, int (*read_error)(int dcrn), { ppc_dcr_t *dcr_env; - dcr_env = g_malloc0(sizeof(ppc_dcr_t)); + dcr_env = g_new0(ppc_dcr_t, 1); dcr_env->read_error = read_error; dcr_env->write_error = write_error; env->dcr_env = dcr_env; diff --git a/hw/ppc/ppc_booke.c b/hw/ppc/ppc_booke.c index 23bcf1b138..dafc6aa3fc 100644 --- a/hw/ppc/ppc_booke.c +++ b/hw/ppc/ppc_booke.c @@ -339,8 +339,8 @@ void ppc_booke_timers_init(PowerPCCPU *cpu, uint32_t freq, uint32_t flags) booke_timer_t *booke_timer; int ret = 0; - tb_env = g_malloc0(sizeof(ppc_tb_t)); - booke_timer = g_malloc0(sizeof(booke_timer_t)); + tb_env = g_new0(ppc_tb_t, 1); + booke_timer = g_new0(booke_timer_t, 1); cpu->env.tb_env = tb_env; tb_env->flags = flags | PPC_TIMER_BOOKE | PPC_DECR_ZERO_TRIGGERED; diff --git a/target/ppc/kvm.c b/target/ppc/kvm.c index 171d3d8040..d8565fd4a3 100644 --- a/target/ppc/kvm.c +++ b/target/ppc/kvm.c @@ -364,7 +364,7 @@ struct ppc_radix_page_info *kvm_get_radix_page_info(void) if (kvm_vm_ioctl(s, KVM_PPC_GET_RMMU_INFO, &rmmu_info)) { return NULL; } - radix_page_info = g_malloc0(sizeof(*radix_page_info)); + radix_page_info = g_new0(struct ppc_radix_page_info, 1); radix_page_info->count = 0; for (i = 0; i < PPC_PAGE_SIZES_MAX_SZ; i++) { if (rmmu_info.ap_encodings[i]) { diff --git a/target/ppc/translate_init.c b/target/ppc/translate_init.c index c6399a3a0d..850ff038ca 100644 --- a/target/ppc/translate_init.c +++ b/target/ppc/translate_init.c @@ -9341,13 +9341,13 @@ static void init_ppc_proc(PowerPCCPU *cpu) nb_tlb *= 2; switch (env->tlb_type) { case TLB_6XX: - env->tlb.tlb6 = g_malloc0(nb_tlb * sizeof(ppc6xx_tlb_t)); + env->tlb.tlb6 = g_new0(ppc6xx_tlb_t, nb_tlb); break; case TLB_EMB: - env->tlb.tlbe = g_malloc0(nb_tlb * sizeof(ppcemb_tlb_t)); + env->tlb.tlbe = g_new0(ppcemb_tlb_t, nb_tlb); break; case TLB_MAS: - env->tlb.tlbm = g_malloc0(nb_tlb * sizeof(ppcmas_tlb_t)); + env->tlb.tlbm = g_new0(ppcmas_tlb_t, nb_tlb); break; } /* Pre-compute some useful values */ @@ -10442,11 +10442,11 @@ static void ppc_cpu_defs_entry(gpointer data, gpointer user_data) } typename = object_class_get_name(oc); - info = g_malloc0(sizeof(*info)); + info = g_new0(CpuDefinitionInfo, 1); info->name = g_strndup(typename, strlen(typename) - strlen(POWERPC_CPU_TYPE_SUFFIX)); - entry = g_malloc0(sizeof(*entry)); + entry = g_new0(CpuDefinitionInfoList, 1); entry->value = info; entry->next = *first; *first = entry; @@ -10473,11 +10473,11 @@ CpuDefinitionInfoList *arch_query_cpu_definitions(Error **errp) continue; } - info = g_malloc0(sizeof(*info)); + info = g_new0(CpuDefinitionInfo, 1); info->name = g_strdup(alias->alias); info->q_typename = g_strdup(object_class_get_name(oc)); - entry = g_malloc0(sizeof(*entry)); + entry = g_new0(CpuDefinitionInfoList, 1); entry->value = info; entry->next = cpu_list; cpu_list = entry; From patchwork Fri Oct 6 23:49:52 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 822820 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="ngGORyaZ"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3y86nM1dfTz9t7x for ; Sat, 7 Oct 2017 11:28:55 +1100 (AEDT) Received: from localhost ([::1]:47743 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e0cz7-00068S-7A for incoming@patchwork.ozlabs.org; Fri, 06 Oct 2017 20:28:53 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42665) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e0cRH-0001Aq-R7 for qemu-devel@nongnu.org; Fri, 06 Oct 2017 19:53:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e0cRF-00072X-Iq for qemu-devel@nongnu.org; Fri, 06 Oct 2017 19:53:55 -0400 Received: from mail-qk0-x242.google.com ([2607:f8b0:400d:c09::242]:36753) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1e0cRF-00072I-Ds; Fri, 06 Oct 2017 19:53:53 -0400 Received: by mail-qk0-x242.google.com with SMTP id z14so12861819qkg.3; Fri, 06 Oct 2017 16:53:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=NDdpqTJ9kavxct9lmQyVZokOhYs81BGK+YxWb7wEQC4=; b=ngGORyaZBCCMAiILpLaqxk0bhC7phEfOYssvQk014pnsPfCiPyAvKpNthPJfSJq390 d23l20N2JoOYXTD4IQIGrV1Da4oGSvT8ahkiIikzPSv+In43zEorCByGxex0qtRDyvKk Xqosb4/xlesAOJ+vH1EEJbS2deBDPJPpR580AcExEZrnhIf9NqQn1EAibNxRJHg03fN0 jYMluDkuXtsGhAG8hZTfQ8ij8peGRjfJDRdijn/kU0+gRii5slKmBfvEtuB+mzDPWI8x 65EITMmU8LDvr542T3u2Hsq4ypukVuZoz0QlB8nS3bJ40DtZZEYWZ2Bu02FCn07uMgKN hy0A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=NDdpqTJ9kavxct9lmQyVZokOhYs81BGK+YxWb7wEQC4=; b=qWkRHH6QmPrmHbw4HqxPV1WqHE+AZoDepKMfUwFIbS3RKEONKB4elyHUZBovuulBXU koVihQqxi8gpUkLFNY8LcMnp5P51HAHahr+B1SKcwhXqMLQEnwUu0jhkGCjPoLpzfW77 gClLeY/AYBnTlU71xgNwAL9wCUVz/2/+/DEwgDPcvlAP356MXfbHMe4y/IE521LPwDd9 8wUabYKsT4x11V0GOYE5TX7Igvzn1Ku0CIpBmVn4K4sguiPK0NtMuwIdBg84kr0KVRYC gWCoaPA1nEgz2tFORsTcNc8byAKmcDrxX8Hmgawu5g/1TEwcjyl0TJ91pr/GDs9EK0lz cr5w== X-Gm-Message-State: AMCzsaXGXW8T/hQVAF0hr7AWTZdwdqKZEYLdWcci+1XhaPjsw50ICOGc 5pYjoIoueXvjfBVM3L0dUls= X-Google-Smtp-Source: AOwi7QCI98LTIAHAFhLy6jvtobeWtPA2y8OAOL4P9xY3Usrpl8+QpVLWX4RHYJ1P/qHTC6I+fCyovA== X-Received: by 10.55.56.14 with SMTP id f14mr739381qka.286.1507334032844; Fri, 06 Oct 2017 16:53:52 -0700 (PDT) Received: from yoga.lan ([181.93.89.178]) by smtp.gmail.com with ESMTPSA id g1sm1705226qta.95.2017.10.06.16.53.49 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 06 Oct 2017 16:53:52 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Markus Armbruster , Eric Blake , David Gibson , Alexander Graf Date: Fri, 6 Oct 2017 20:49:52 -0300 Message-Id: <20171006235023.11952-58-f4bug@amsat.org> X-Mailer: git-send-email 2.14.2 In-Reply-To: <20171006235023.11952-1-f4bug@amsat.org> References: <20171006235023.11952-1-f4bug@amsat.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c09::242 Subject: [Qemu-devel] [PATCH 57/88] ppc: use g_new() family of functions X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , qemu trival , qemu-devel@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , qemu-ppc@nongnu.org, =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Marc-André Lureau Signed-off-by: Marc-André Lureau Signed-off-by: Philippe Mathieu-Daudé [PMD: replaced g_new0() -> g_new() in mac_newworld.c, added virtex_ml507] Acked-by: David Gibson --- hw/intc/heathrow_pic.c | 2 +- hw/ppc/mac_newworld.c | 5 ++--- hw/ppc/mac_oldworld.c | 2 +- hw/ppc/virtex_ml507.c | 2 +- 4 files changed, 5 insertions(+), 6 deletions(-) diff --git a/hw/intc/heathrow_pic.c b/hw/intc/heathrow_pic.c index 171f5ed814..90c1e6a4b1 100644 --- a/hw/intc/heathrow_pic.c +++ b/hw/intc/heathrow_pic.c @@ -201,7 +201,7 @@ qemu_irq *heathrow_pic_init(MemoryRegion **pmem, { HeathrowPICS *s; - s = g_malloc0(sizeof(HeathrowPICS)); + s = g_new0(HeathrowPICS, 1); /* only 1 CPU */ s->irqs = irqs[0]; memory_region_init_io(&s->mem, NULL, &heathrow_pic_ops, s, diff --git a/hw/ppc/mac_newworld.c b/hw/ppc/mac_newworld.c index 6d0ace20ca..59cded95b8 100644 --- a/hw/ppc/mac_newworld.c +++ b/hw/ppc/mac_newworld.c @@ -295,7 +295,7 @@ static void ppc_core99_init(MachineState *machine) memory_region_init_io(unin2_memory, NULL, &unin_ops, token, "unin", 0x1000); memory_region_add_subregion(get_system_memory(), 0xf3000000, unin2_memory); - openpic_irqs = g_malloc0(smp_cpus * sizeof(qemu_irq *)); + openpic_irqs = g_new0(qemu_irq *, smp_cpus); openpic_irqs[0] = g_malloc0(smp_cpus * sizeof(qemu_irq) * OPENPIC_OUTPUT_NB); for (i = 0; i < smp_cpus; i++) { @@ -339,8 +339,6 @@ static void ppc_core99_init(MachineState *machine) } } - pic = g_new0(qemu_irq, 64); - dev = qdev_create(NULL, TYPE_OPENPIC); qdev_prop_set_uint32(dev, "model", OPENPIC_MODEL_KEYLARGO); qdev_init_nofail(dev); @@ -353,6 +351,7 @@ static void ppc_core99_init(MachineState *machine) } } + pic = g_new(qemu_irq, 64); for (i = 0; i < 64; i++) { pic[i] = qdev_get_gpio_in(dev, i); } diff --git a/hw/ppc/mac_oldworld.c b/hw/ppc/mac_oldworld.c index bc7c8b7bd7..50ad9c56cb 100644 --- a/hw/ppc/mac_oldworld.c +++ b/hw/ppc/mac_oldworld.c @@ -232,7 +232,7 @@ static void ppc_heathrow_init(MachineState *machine) memory_region_add_subregion(sysmem, 0xfe000000, isa); /* XXX: we register only 1 output pin for heathrow PIC */ - heathrow_irqs = g_malloc0(smp_cpus * sizeof(qemu_irq *)); + heathrow_irqs = g_new0(qemu_irq *, smp_cpus); heathrow_irqs[0] = g_malloc0(smp_cpus * sizeof(qemu_irq) * 1); /* Connect the heathrow PIC outputs to the 6xx bus */ diff --git a/hw/ppc/virtex_ml507.c b/hw/ppc/virtex_ml507.c index ed9b406fd3..ed6e054611 100644 --- a/hw/ppc/virtex_ml507.c +++ b/hw/ppc/virtex_ml507.c @@ -104,7 +104,7 @@ static PowerPCCPU *ppc440_init_xilinx(ram_addr_t *ram_size, ppc_dcr_init(env, NULL, NULL); /* interrupt controller */ - irqs = g_malloc0(sizeof(qemu_irq) * PPCUIC_OUTPUT_NB); + irqs = g_new0(qemu_irq, PPCUIC_OUTPUT_NB); irqs[PPCUIC_OUTPUT_INT] = ((qemu_irq *)env->irq_inputs)[PPC40x_INPUT_INT]; irqs[PPCUIC_OUTPUT_CINT] = ((qemu_irq *)env->irq_inputs)[PPC40x_INPUT_CINT]; ppcuic_init(env, irqs, 0x0C0, 0, 1); From patchwork Fri Oct 6 23:49:53 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 822822 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="eerlBA1+"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3y86nZ2SGBz9t2f for ; Sat, 7 Oct 2017 11:29:06 +1100 (AEDT) Received: from localhost ([::1]:47745 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e0czI-0006HL-AW for incoming@patchwork.ozlabs.org; Fri, 06 Oct 2017 20:29:04 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42711) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e0cRK-0001DO-KC for qemu-devel@nongnu.org; Fri, 06 Oct 2017 19:54:00 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e0cRJ-00076L-7Q for qemu-devel@nongnu.org; Fri, 06 Oct 2017 19:53:58 -0400 Received: from mail-qt0-x243.google.com ([2607:f8b0:400d:c0d::243]:47285) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1e0cRJ-00075T-2R; Fri, 06 Oct 2017 19:53:57 -0400 Received: by mail-qt0-x243.google.com with SMTP id z50so29315306qtj.4; Fri, 06 Oct 2017 16:53:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=BEpldn5LBrdw5+P2VfCSDrvKqsre0nxXS2hWM1zx2nk=; b=eerlBA1+//O4BLmhEcRkC9PGWLTyTr6jlO+S5iZwhlec24V6k+8VWvcc2nYVIrAf1i iMWgBUl7zInxyCfEVWGyzmHiiYPQ8HExb6DUU9tBd0h+jeYChwaisiBWplYDVN22F5DY 1L49JTECNnwdUPWN5C6N8veXAQbc0KB6mZMyOKxesYDB793PIzlGKdtAkaMLaOIHJx5G MOGXDYs0QzO74AOTJEjzxy9iuDG2Mn7wOmNtYZ9q5nXSFthMCj1nm7EWL1JP8pSBBK2F ZW7JnmXyzLHHqTZW8Pe8Kg2GOhoW8/404bHroOzGTyXqSSTg5Bh4Q0UwVnPplFgMHDZe XbPg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=BEpldn5LBrdw5+P2VfCSDrvKqsre0nxXS2hWM1zx2nk=; b=e5Ce7iggsOh51FKf+I1Rt+ax3Bsx74U7BoRqxN8By1uzH008H+9/1wM6ugTKJwUXSe 67FjW0v4n0Il4eaXuuUYAKLKdxjR/XMs+uRWXcxPbs6olaN5lAFcImuzTE6yHUxlTc+F OJKOc3fA3vWZN9g6SRDljHuvmWNtZMNZdfHmx5hfmx+pQWAo8fbTQz+XgYwUTxTLv7LP A9Szowa8Wr6bgjSLMao6zukfWHoKh5L7OEGP/476dcxjmV9NXzhLEGH/nXsMFKODjRx9 t5RnYeI07ub3oHhHIKTWCX8a8oMOKHGJd3hRHI3H7DdRLfm+uZMYC7YSnQhIkWtdRyjm 9BHQ== X-Gm-Message-State: AMCzsaUDp9IZFLmyjgquwmwdb4QIqWwPIolUm4MrRR7mGImCQSS3DHjg srBLY1+kN7HbnHk5K27jDcY= X-Google-Smtp-Source: AOwi7QCuXB7LMY3qU1svuz+NSMIWqhJnPz2gHBGT3s+MQfk2DInNpmsEMhbjvi1bXIvN1iNCf4OgTQ== X-Received: by 10.200.44.167 with SMTP id 36mr5583605qtw.285.1507334036452; Fri, 06 Oct 2017 16:53:56 -0700 (PDT) Received: from yoga.lan ([181.93.89.178]) by smtp.gmail.com with ESMTPSA id g1sm1705226qta.95.2017.10.06.16.53.53 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 06 Oct 2017 16:53:55 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Markus Armbruster , Eric Blake , David Gibson , Alexander Graf Date: Fri, 6 Oct 2017 20:49:53 -0300 Message-Id: <20171006235023.11952-59-f4bug@amsat.org> X-Mailer: git-send-email 2.14.2 In-Reply-To: <20171006235023.11952-1-f4bug@amsat.org> References: <20171006235023.11952-1-f4bug@amsat.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c0d::243 Subject: [Qemu-devel] [PATCH 58/88] ppc4xx: use g_new() family of functions X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , qemu trival , qemu-devel@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , qemu-ppc@nongnu.org, =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Marc-André Lureau Signed-off-by: Marc-André Lureau Signed-off-by: Philippe Mathieu-Daudé [PMD: added more changes in hw/ppc/ppc405_uc.c and hw/ppc/ppc4xx_devs.c] Acked-by: David Gibson --- hw/ppc/ppc405_boards.c | 4 ++-- hw/ppc/ppc405_uc.c | 24 ++++++++++++------------ hw/ppc/ppc440_bamboo.c | 2 +- hw/ppc/ppc4xx_devs.c | 6 +++--- 4 files changed, 18 insertions(+), 18 deletions(-) diff --git a/hw/ppc/ppc405_boards.c b/hw/ppc/ppc405_boards.c index e92db2c66a..a812985baa 100644 --- a/hw/ppc/ppc405_boards.c +++ b/hw/ppc/ppc405_boards.c @@ -169,7 +169,7 @@ static void ref405ep_fpga_init(MemoryRegion *sysmem, uint32_t base) ref405ep_fpga_t *fpga; MemoryRegion *fpga_memory = g_new(MemoryRegion, 1); - fpga = g_malloc0(sizeof(ref405ep_fpga_t)); + fpga = g_new0(ref405ep_fpga_t, 1); memory_region_init_io(fpga_memory, NULL, &ref405ep_fpga_ops, fpga, "fpga", 0x00000100); memory_region_add_subregion(sysmem, base, fpga_memory); @@ -472,7 +472,7 @@ static void taihu_cpld_init(MemoryRegion *sysmem, uint32_t base) taihu_cpld_t *cpld; MemoryRegion *cpld_memory = g_new(MemoryRegion, 1); - cpld = g_malloc0(sizeof(taihu_cpld_t)); + cpld = g_new0(taihu_cpld_t, 1); memory_region_init_io(cpld_memory, NULL, &taihu_cpld_ops, cpld, "cpld", 0x100); memory_region_add_subregion(sysmem, base, cpld_memory); qemu_register_reset(&taihu_cpld_reset, cpld); diff --git a/hw/ppc/ppc405_uc.c b/hw/ppc/ppc405_uc.c index 8e58065f5f..02ab2a24ff 100644 --- a/hw/ppc/ppc405_uc.c +++ b/hw/ppc/ppc405_uc.c @@ -181,7 +181,7 @@ void ppc4xx_plb_init(CPUPPCState *env) { ppc4xx_plb_t *plb; - plb = g_malloc0(sizeof(ppc4xx_plb_t)); + plb = g_new0(ppc4xx_plb_t, 1); ppc_dcr_register(env, PLB3A0_ACR, plb, &dcr_read_plb, &dcr_write_plb); ppc_dcr_register(env, PLB4A0_ACR, plb, &dcr_read_plb, &dcr_write_plb); ppc_dcr_register(env, PLB0_ACR, plb, &dcr_read_plb, &dcr_write_plb); @@ -266,7 +266,7 @@ static void ppc4xx_pob_init(CPUPPCState *env) { ppc4xx_pob_t *pob; - pob = g_malloc0(sizeof(ppc4xx_pob_t)); + pob = g_new0(ppc4xx_pob_t, 1); ppc_dcr_register(env, POB0_BEAR, pob, &dcr_read_pob, &dcr_write_pob); ppc_dcr_register(env, POB0_BESR0, pob, &dcr_read_pob, &dcr_write_pob); ppc_dcr_register(env, POB0_BESR1, pob, &dcr_read_pob, &dcr_write_pob); @@ -397,7 +397,7 @@ static void ppc4xx_opba_init(hwaddr base) { ppc4xx_opba_t *opba; - opba = g_malloc0(sizeof(ppc4xx_opba_t)); + opba = g_new0(ppc4xx_opba_t, 1); #ifdef DEBUG_OPBA printf("%s: offset " TARGET_FMT_plx "\n", __func__, base); #endif @@ -595,7 +595,7 @@ void ppc405_ebc_init(CPUPPCState *env) { ppc4xx_ebc_t *ebc; - ebc = g_malloc0(sizeof(ppc4xx_ebc_t)); + ebc = g_new0(ppc4xx_ebc_t, 1); qemu_register_reset(&ebc_reset, ebc); ppc_dcr_register(env, EBC0_CFGADDR, ebc, &dcr_read_ebc, &dcr_write_ebc); @@ -678,7 +678,7 @@ static void ppc405_dma_init(CPUPPCState *env, qemu_irq irqs[4]) { ppc405_dma_t *dma; - dma = g_malloc0(sizeof(ppc405_dma_t)); + dma = g_new0(ppc405_dma_t, 1); memcpy(dma->irqs, irqs, 4 * sizeof(qemu_irq)); qemu_register_reset(&ppc405_dma_reset, dma); ppc_dcr_register(env, DMA0_CR0, @@ -819,7 +819,7 @@ static void ppc405_gpio_init(hwaddr base) { ppc405_gpio_t *gpio; - gpio = g_malloc0(sizeof(ppc405_gpio_t)); + gpio = g_new0(ppc405_gpio_t, 1); #ifdef DEBUG_GPIO printf("%s: offset " TARGET_FMT_plx "\n", __func__, base); #endif @@ -981,7 +981,7 @@ static void ppc405_ocm_init(CPUPPCState *env) { ppc405_ocm_t *ocm; - ocm = g_malloc0(sizeof(ppc405_ocm_t)); + ocm = g_new0(ppc405_ocm_t, 1); /* XXX: Size is 4096 or 0x04000000 */ memory_region_init_ram(&ocm->isarc_ram, NULL, "ppc405.ocm", 4096, &error_fatal); @@ -1264,7 +1264,7 @@ static void ppc4xx_gpt_init(hwaddr base, qemu_irq irqs[5]) ppc4xx_gpt_t *gpt; int i; - gpt = g_malloc0(sizeof(ppc4xx_gpt_t)); + gpt = g_new0(ppc4xx_gpt_t, 1); for (i = 0; i < 5; i++) { gpt->irqs[i] = irqs[i]; } @@ -1590,7 +1590,7 @@ static void ppc405cr_cpc_init (CPUPPCState *env, clk_setup_t clk_setup[7], { ppc405cr_cpc_t *cpc; - cpc = g_malloc0(sizeof(ppc405cr_cpc_t)); + cpc = g_new0(ppc405cr_cpc_t, 1); memcpy(cpc->clk_setup, clk_setup, PPC405CR_CLK_NB * sizeof(clk_setup_t)); cpc->sysclk = sysclk; @@ -1640,7 +1640,7 @@ CPUPPCState *ppc405cr_init(MemoryRegion *address_space_mem, /* OBP arbitrer */ ppc4xx_opba_init(0xef600600); /* Universal interrupt controller */ - irqs = g_malloc0(sizeof(qemu_irq) * PPCUIC_OUTPUT_NB); + irqs = g_new0(qemu_irq, PPCUIC_OUTPUT_NB); irqs[PPCUIC_OUTPUT_INT] = ((qemu_irq *)env->irq_inputs)[PPC40x_INPUT_INT]; irqs[PPCUIC_OUTPUT_CINT] = @@ -1934,7 +1934,7 @@ static void ppc405ep_cpc_init (CPUPPCState *env, clk_setup_t clk_setup[8], { ppc405ep_cpc_t *cpc; - cpc = g_malloc0(sizeof(ppc405ep_cpc_t)); + cpc = g_new0(ppc405ep_cpc_t, 1); memcpy(cpc->clk_setup, clk_setup, PPC405EP_CLK_NB * sizeof(clk_setup_t)); cpc->jtagid = 0x20267049; @@ -1997,7 +1997,7 @@ CPUPPCState *ppc405ep_init(MemoryRegion *address_space_mem, /* Initialize timers */ ppc_booke_timers_init(cpu, sysclk, 0); /* Universal interrupt controller */ - irqs = g_malloc0(sizeof(qemu_irq) * PPCUIC_OUTPUT_NB); + irqs = g_new0(qemu_irq, PPCUIC_OUTPUT_NB); irqs[PPCUIC_OUTPUT_INT] = ((qemu_irq *)env->irq_inputs)[PPC40x_INPUT_INT]; irqs[PPCUIC_OUTPUT_CINT] = diff --git a/hw/ppc/ppc440_bamboo.c b/hw/ppc/ppc440_bamboo.c index f92d47f28d..f55071abaf 100644 --- a/hw/ppc/ppc440_bamboo.c +++ b/hw/ppc/ppc440_bamboo.c @@ -200,7 +200,7 @@ static void bamboo_init(MachineState *machine) ppc_dcr_init(env, NULL, NULL); /* interrupt controller */ - irqs = g_malloc0(sizeof(qemu_irq) * PPCUIC_OUTPUT_NB); + irqs = g_new0(qemu_irq, PPCUIC_OUTPUT_NB); irqs[PPCUIC_OUTPUT_INT] = ((qemu_irq *)env->irq_inputs)[PPC40x_INPUT_INT]; irqs[PPCUIC_OUTPUT_CINT] = ((qemu_irq *)env->irq_inputs)[PPC40x_INPUT_CINT]; pic = ppcuic_init(env, irqs, 0x0C0, 0, 1); diff --git a/hw/ppc/ppc4xx_devs.c b/hw/ppc/ppc4xx_devs.c index 6d7f7857fe..a5ea8f8a63 100644 --- a/hw/ppc/ppc4xx_devs.c +++ b/hw/ppc/ppc4xx_devs.c @@ -300,7 +300,7 @@ qemu_irq *ppcuic_init (CPUPPCState *env, qemu_irq *irqs, ppcuic_t *uic; int i; - uic = g_malloc0(sizeof(ppcuic_t)); + uic = g_new0(ppcuic_t, 1); uic->dcr_base = dcr_base; uic->irqs = irqs; if (has_vr) @@ -648,7 +648,7 @@ void ppc4xx_sdram_init (CPUPPCState *env, qemu_irq irq, int nbanks, { ppc4xx_sdram_t *sdram; - sdram = g_malloc0(sizeof(ppc4xx_sdram_t)); + sdram = g_new0(ppc4xx_sdram_t, 1); sdram->irq = irq; sdram->nbanks = nbanks; sdram->ram_memories = ram_memories; @@ -911,7 +911,7 @@ void ppc4xx_mal_init(CPUPPCState *env, uint8_t txcnum, uint8_t rxcnum, int i; assert(txcnum <= 32 && rxcnum <= 32); - mal = g_malloc0(sizeof(*mal)); + mal = g_new0(ppc4xx_mal_t, 1); mal->txcnum = txcnum; mal->rxcnum = rxcnum; mal->txctpr = g_new0(uint32_t, txcnum); From patchwork Fri Oct 6 23:49:54 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 822825 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="ASIWgNFP"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3y86rf6l8sz9t2h for ; Sat, 7 Oct 2017 11:31:46 +1100 (AEDT) Received: from localhost ([::1]:47759 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e0d1s-00007F-Vy for incoming@patchwork.ozlabs.org; Fri, 06 Oct 2017 20:31:45 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42763) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e0cRN-0001Hy-D9 for qemu-devel@nongnu.org; Fri, 06 Oct 2017 19:54:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e0cRM-00078X-Jr for qemu-devel@nongnu.org; Fri, 06 Oct 2017 19:54:01 -0400 Received: from mail-qk0-x242.google.com ([2607:f8b0:400d:c09::242]:35195) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1e0cRM-00078C-Fh; Fri, 06 Oct 2017 19:54:00 -0400 Received: by mail-qk0-x242.google.com with SMTP id w63so11298134qkd.2; Fri, 06 Oct 2017 16:54:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=X/j8jouztJxvilzTDMtGcpYt5nCMgjiiE7X5lnIP9ZM=; b=ASIWgNFPpqPvwAuF10Y9Ux9FOadO/rkO99aG70q9KPPNkcG4MWhqND35Rp1qr3axHW hBc55TwE2EhfTbcgNCWsRvfQ9xixXFh5ymmSi+fEHrGOhNAGDhNpnTrbI8nt31IVYU1/ k56ZEHofHaN8qptcEqkKT3FTdCdEY6KZaCelLGWMDQm2VVvuR110xyPGBzqJaeMXIFAv 9aLLPrUEe5SVlZtFlMYKo/wkp6xg+AtCaEtEyeWo8gwhJvf5vYgnZ/0fR90w9tO/cSZA uWQQdE0Yo/h+EhzxWwwnTYlCuWud5EyPSpG/T9VX8L4r2CUdn9uBXbK6cFsDxtMp9JGv hcNQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=X/j8jouztJxvilzTDMtGcpYt5nCMgjiiE7X5lnIP9ZM=; b=H07clsoq6j7cSarTuyaXJIB8Ff+GvdlwEDD3au/XSAMS56JCDhJz0Ypd9FaCgyOcoJ EX5bG/27hxtL0XypYcbEdIB+UMzpsY/J+J21yqEFZOm7ihThg+IWYSI3tSq1KeQFJNQ6 lJfh4HHRFNyNQC34zJJmTZRoSn0dh0JM3DdC2sym9Q+IxUfRq+aft1GcXGvgBHw5mBRO hQub4FOwYQe9eyQcuyAcBN5Twji0RuNqbiMg1jiDaEimz18SG4orqq5vxdF+LsgNBvNr imqTKECACsu2q6ksLThmaCm+wHOePmEUZ6Z6wlbtkOlOCyuy3ZoERd/z3G6FqRXZGWl2 AdDw== X-Gm-Message-State: AMCzsaVFvWOw8qIqZYu+lLtuhyG5Xz2SrW2gEg2lS9R3Jte6K/SH+2tR crwiNzD7VG2Nc11RVR3msIc= X-Google-Smtp-Source: AOwi7QAc41mbsM8SbMjHr5T4mbhgwNGbWsYLOiQ7dzYGvl+CF+pm6zuClp28aH3AOpcy4ywiJ+aPTA== X-Received: by 10.55.127.70 with SMTP id a67mr698885qkd.90.1507334039948; Fri, 06 Oct 2017 16:53:59 -0700 (PDT) Received: from yoga.lan ([181.93.89.178]) by smtp.gmail.com with ESMTPSA id g1sm1705226qta.95.2017.10.06.16.53.56 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 06 Oct 2017 16:53:59 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Markus Armbruster , Eric Blake , David Gibson , Alexander Graf Date: Fri, 6 Oct 2017 20:49:54 -0300 Message-Id: <20171006235023.11952-60-f4bug@amsat.org> X-Mailer: git-send-email 2.14.2 In-Reply-To: <20171006235023.11952-1-f4bug@amsat.org> References: <20171006235023.11952-1-f4bug@amsat.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c09::242 Subject: [Qemu-devel] [PATCH 59/88] ppce500: use g_new() family of functions X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , qemu trival , qemu-devel@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , qemu-ppc@nongnu.org, =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Marc-André Lureau Signed-off-by: Marc-André Lureau Signed-off-by: Philippe Mathieu-Daudé [PMD: replaced g_new0() -> g_new() since no bzero() required] Acked-by: David Gibson --- 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 { From patchwork Fri Oct 6 23:49:55 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 822838 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="YX5ExWtG"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3y874m2Mb2z9t5C for ; Sat, 7 Oct 2017 11:42:16 +1100 (AEDT) Received: from localhost ([::1]:47819 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e0dC2-0001QI-Ae for incoming@patchwork.ozlabs.org; Fri, 06 Oct 2017 20:42:14 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42810) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e0cRR-0001Kd-12 for qemu-devel@nongnu.org; Fri, 06 Oct 2017 19:54:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e0cRP-0007BW-TZ for qemu-devel@nongnu.org; Fri, 06 Oct 2017 19:54:05 -0400 Received: from mail-qk0-x242.google.com ([2607:f8b0:400d:c09::242]:36755) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1e0cRP-0007B0-O3; Fri, 06 Oct 2017 19:54:03 -0400 Received: by mail-qk0-x242.google.com with SMTP id z14so12861984qkg.3; Fri, 06 Oct 2017 16:54:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=/87O0wcJzkuMaVGLZDwjtPPj6/UloO+mmd50YR5m0nc=; b=YX5ExWtGijvlSpP7w1imZ4KX4neCw2fwm2aomGXoDJFBCcXzVX08aVpPiZbrrvTtmp MRrg2uqpcmUrgmfFEjxtCSsGOmbVQhViINEXsZQXayKfiSNKXQKgYCmyFtx6jPHSv2sq SXmYE1GyugBM888EMPirQ35UNJeeM/AVqPrj3brfq2haINFioWPdTE+ogPDdUGrNZZOU nVbq3bdZOVU+tnSTd4a6LCOu5gzUvDwAYwPDy2mKTK1pOULaDxH2Cm/PFQOUEZ9EhGVJ qluqgAHe416AEFne8oJsbLJp4Swmf43t3jRS8hvvfEMo+POb9TnzLowJ5i5wL/dWVgQg ZwxQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=/87O0wcJzkuMaVGLZDwjtPPj6/UloO+mmd50YR5m0nc=; b=AdnIrnTGZI0v0mXAV8ugxH7i6eNyKXBtq+9nE1UkZdpAnHeIGnfsCbBSqgVRWof5iY gJhVLf5+nUbk1DFBaa0MnCFtJrNJ1l/Tw/sOqcVz5+Era1lgN7KA0pn8H3Qcs2POWxsX HWOt3OzS3tQ//4oqRDrb8xOso6UCToQND3gC4aZ1Wzhg+U7z4B1L+VCA01eC6LXFq7XY vrTk8UmOmuOyk1SklIsS1W/nRQ2aDjviGxG9+DIqYmGDwo6Ai8fQqwwgMQw+AXb2YmUU 8DA6Y8RTtNXVhi3scRFEo/dBGheJMW7edQMYHYHIlL+kb9Dl/f//CLU9igSyTklClR9i fbZw== X-Gm-Message-State: AMCzsaVUO7/x7ZNeGA0GF2Ox2xiiNnsgK7+mfbonFnpLkT79XPuB1+lv VMp5kO032AW3maXDKrMC9OL6sleL2aE= X-Google-Smtp-Source: AOwi7QA7zPDRJB/JvOtTIUjHwjoNTtZK6DwPRuKi0Y2KdKw6ob+vIOgETjl8IifOacAamhh7pGVleA== X-Received: by 10.55.6.149 with SMTP id 143mr673395qkg.231.1507334043167; Fri, 06 Oct 2017 16:54:03 -0700 (PDT) Received: from yoga.lan ([181.93.89.178]) by smtp.gmail.com with ESMTPSA id g1sm1705226qta.95.2017.10.06.16.54.00 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 06 Oct 2017 16:54:02 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Markus Armbruster , Eric Blake , Alexander Graf Date: Fri, 6 Oct 2017 20:49:55 -0300 Message-Id: <20171006235023.11952-61-f4bug@amsat.org> X-Mailer: git-send-email 2.14.2 In-Reply-To: <20171006235023.11952-1-f4bug@amsat.org> References: <20171006235023.11952-1-f4bug@amsat.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c09::242 Subject: [Qemu-devel] [PATCH 60/88] sPAPR: use g_new() family of functions X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , qemu trival , qemu-devel@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , qemu-ppc@nongnu.org, =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Marc-André Lureau Signed-off-by: Marc-André Lureau Signed-off-by: Philippe Mathieu-Daudé [PMD: one more change in hw/ppc/spapr_events.c, added hw/intc/xics_kvm.c and tests/libqos/pci-spapr.c] --- hw/intc/xics.c | 2 +- hw/intc/xics_kvm.c | 4 ++-- hw/ppc/spapr.c | 2 +- hw/ppc/spapr_events.c | 4 ++-- hw/ppc/spapr_iommu.c | 2 +- hw/ppc/spapr_pci.c | 2 +- tests/libqos/pci-spapr.c | 2 +- 7 files changed, 9 insertions(+), 9 deletions(-) diff --git a/hw/intc/xics.c b/hw/intc/xics.c index cc9816e7f2..e7e1605a1c 100644 --- a/hw/intc/xics.c +++ b/hw/intc/xics.c @@ -603,7 +603,7 @@ static void ics_simple_realize(ICSState *ics, Error **errp) error_setg(errp, "Number of interrupts needs to be greater 0"); return; } - ics->irqs = g_malloc0(ics->nr_irqs * sizeof(ICSIRQState)); + ics->irqs = g_new0(ICSIRQState, ics->nr_irqs); ics->qirqs = qemu_allocate_irqs(ics_simple_set_irq, ics, ics->nr_irqs); qemu_register_reset(ics_simple_reset, ics); diff --git a/hw/intc/xics_kvm.c b/hw/intc/xics_kvm.c index 3091ad3ac2..e6742b0118 100644 --- a/hw/intc/xics_kvm.c +++ b/hw/intc/xics_kvm.c @@ -143,7 +143,7 @@ static void icp_kvm_realize(ICPState *icp, Error **errp) strerror(errno)); return; } - enabled_icp = g_malloc(sizeof(*enabled_icp)); + enabled_icp = g_new(KVMEnabledICP, 1); enabled_icp->vcpu_id = vcpu_id; QLIST_INSERT_HEAD(&kvm_enabled_icps, enabled_icp, node); } @@ -334,7 +334,7 @@ static void ics_kvm_realize(ICSState *ics, Error **errp) error_setg(errp, "Number of interrupts needs to be greater 0"); return; } - ics->irqs = g_malloc0(ics->nr_irqs * sizeof(ICSIRQState)); + ics->irqs = g_new0(ICSIRQState, ics->nr_irqs); ics->qirqs = qemu_allocate_irqs(ics_kvm_set_irq, ics, ics->nr_irqs); qemu_register_reset(ics_kvm_reset, ics); diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c index ff87f155d5..53492595f2 100644 --- a/hw/ppc/spapr.c +++ b/hw/ppc/spapr.c @@ -2988,7 +2988,7 @@ static sPAPRDIMMState *spapr_pending_dimm_unplugs_add(sPAPRMachineState *spapr, */ ds = spapr_pending_dimm_unplugs_find(spapr, dimm); if (!ds) { - ds = g_malloc0(sizeof(sPAPRDIMMState)); + ds = g_new0(sPAPRDIMMState, 1); ds->nr_lmbs = nr_lmbs; ds->dimm = dimm; QTAILQ_INSERT_HEAD(&spapr->pending_dimm_unplugs, ds, next); diff --git a/hw/ppc/spapr_events.c b/hw/ppc/spapr_events.c index e377fc7dde..0ff4c2404f 100644 --- a/hw/ppc/spapr_events.c +++ b/hw/ppc/spapr_events.c @@ -437,7 +437,7 @@ static void spapr_powerdown_req(Notifier *n, void *opaque) struct epow_extended_log *new_epow; entry = g_new(sPAPREventLogEntry, 1); - new_epow = g_malloc0(sizeof(*new_epow)); + new_epow = g_new0(struct epow_extended_log, 1); entry->extended_log = new_epow; v6hdr = &new_epow->v6hdr; @@ -490,7 +490,7 @@ static void spapr_hotplug_req_event(uint8_t hp_id, uint8_t hp_action, struct rtas_event_log_v6_hp *hp; entry = g_new(sPAPREventLogEntry, 1); - new_hp = g_malloc0(sizeof(struct hp_extended_log)); + new_hp = g_new0(struct hp_extended_log, 1); entry->extended_log = new_hp; v6hdr = &new_hp->v6hdr; diff --git a/hw/ppc/spapr_iommu.c b/hw/ppc/spapr_iommu.c index 5ccd785d5a..36cf3d6908 100644 --- a/hw/ppc/spapr_iommu.c +++ b/hw/ppc/spapr_iommu.c @@ -93,7 +93,7 @@ static uint64_t *spapr_tce_alloc_table(uint32_t liobn, if (!table) { *fd = -1; - table = g_malloc0(nb_table * sizeof(uint64_t)); + table = g_new0(uint64_t, nb_table); } trace_spapr_iommu_new_table(liobn, table, *fd); diff --git a/hw/ppc/spapr_pci.c b/hw/ppc/spapr_pci.c index 5049ced4e8..4ec31f65c5 100644 --- a/hw/ppc/spapr_pci.c +++ b/hw/ppc/spapr_pci.c @@ -1825,7 +1825,7 @@ static int spapr_pci_pre_save(void *opaque) if (!sphb->msi_devs_num) { return 0; } - sphb->msi_devs = g_malloc(sphb->msi_devs_num * sizeof(spapr_pci_msi_mig)); + sphb->msi_devs = g_new(spapr_pci_msi_mig, sphb->msi_devs_num); g_hash_table_iter_init(&iter, sphb->msi); for (i = 0; g_hash_table_iter_next(&iter, &key, &value); ++i) { diff --git a/tests/libqos/pci-spapr.c b/tests/libqos/pci-spapr.c index 2043f1e123..e3816ec29f 100644 --- a/tests/libqos/pci-spapr.c +++ b/tests/libqos/pci-spapr.c @@ -158,7 +158,7 @@ QPCIBus *qpci_init_spapr(QGuestAllocator *alloc) { QPCIBusSPAPR *ret; - ret = g_malloc(sizeof(*ret)); + ret = g_new(QPCIBusSPAPR, 1); ret->alloc = alloc; From patchwork Fri Oct 6 23:49:56 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 822827 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="iS8SJk2y"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3y86sd46grz9sRg for ; Sat, 7 Oct 2017 11:32:37 +1100 (AEDT) Received: from localhost ([::1]:47763 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e0d2h-0000n0-Id for incoming@patchwork.ozlabs.org; Fri, 06 Oct 2017 20:32:35 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42897) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e0cRV-0001Ol-0A for qemu-devel@nongnu.org; Fri, 06 Oct 2017 19:54:10 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e0cRT-0007Dp-OO for qemu-devel@nongnu.org; Fri, 06 Oct 2017 19:54:09 -0400 Received: from mail-qk0-x244.google.com ([2607:f8b0:400d:c09::244]:36756) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1e0cRT-0007Db-JY; Fri, 06 Oct 2017 19:54:07 -0400 Received: by mail-qk0-x244.google.com with SMTP id z14so12862051qkg.3; Fri, 06 Oct 2017 16:54:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=dusgOxJe7/1VyXSe7SGQ7qXnNCPleel/uoLcXQUFiAw=; b=iS8SJk2yY0h8QpODa2Jy8DUbsnKL8VkltPmffgg/J7ZRNNc47jfTl2PQeyuC0ENDEn 3XxejhY4JB+cDLdfVNT3cLHYCWPlcxqkWFQpXETXxjShKvPfKPpPaOmnE2gudAlRP3K6 RvP3Tul+sYfkHGeFASGwG1HtQaEZpy9Y5ZXH6G7gks7DKQl+DURzLxdZydm51fYE8Skm Df2ZGGaAB4lbGwIFITH/AzO60HnB7HB7tS/KFOQ65sR54Xxi3vC/5VqeLRbPTb7rYzqa h1KqOBGXn+B3aaFPKZcuDOdCUYuNPm7+peCajSzj5kQfuX8Z8PezexQSBeqjXpqeeMHd aHlg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=dusgOxJe7/1VyXSe7SGQ7qXnNCPleel/uoLcXQUFiAw=; b=mo1nhQQQY9cd2Lq/J7q4nvSLJaFWAlnuNAwrZdwCzNKVq/pk0sQfeWBIcLj9MOyfpo pYheLQVTSOZ1kMXA5ZussZhUTarz3KsgAIW6NvQ4bl1IKBTqHI+M2i4t0KoQExxgdzNe 39tJFgN9c46GaTdtpN+hH4QM1Is3Sk4M9hLz36MCR6wlhPRDy9eEuH37GqMukq8KkqDR L5WveGkczKveMeZz2wNoi2+S+7wr/mgayynJDChZ3UzWfJnElO419QGI9SC8RypK2izG Uxz5EgLhDaywnnLikmAUC6x+/HpYYTgKN7ODByStKaWGvwhuMSY/mSw787fqcHGyPtfK ly+g== X-Gm-Message-State: AMCzsaUbg5G3QqXUSBlkgVgoqf91mk9AOvzkYF7drJ2xlsrGTn2mHnwC uSf+ORMmFldf1Hos/w3Ou0A= X-Google-Smtp-Source: AOwi7QDp8D0GHCJNxFnfkFNbywC+gTxp/XEO5/xT6wKRW3QdL4pLi7QY93SF6xuDGJHaWc58L+3Pjw== X-Received: by 10.55.181.129 with SMTP id e123mr767495qkf.128.1507334047012; Fri, 06 Oct 2017 16:54:07 -0700 (PDT) Received: from yoga.lan ([181.93.89.178]) by smtp.gmail.com with ESMTPSA id g1sm1705226qta.95.2017.10.06.16.54.03 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 06 Oct 2017 16:54:06 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Markus Armbruster , Eric Blake , John Snow , Thomas Huth , Laurent Vivier , "Dr. David Alan Gilbert" Date: Fri, 6 Oct 2017 20:49:56 -0300 Message-Id: <20171006235023.11952-62-f4bug@amsat.org> X-Mailer: git-send-email 2.14.2 In-Reply-To: <20171006235023.11952-1-f4bug@amsat.org> References: <20171006235023.11952-1-f4bug@amsat.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c09::244 Subject: [Qemu-devel] [PATCH 61/88] tests: use g_new() family of functions X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , qemu-block@nongnu.org, qemu trival , qemu-devel@nongnu.org, =?utf-8?q?Philippe_?= =?utf-8?q?Mathieu-Daud=C3=A9?= , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Marc-André Lureau Signed-off-by: Marc-André Lureau Signed-off-by: Philippe Mathieu-Daudé [PMD: split of some files in other commits of the same series, add libqtest.c] Reviewed-by: Thomas Huth Acked-by: John Snow --- tests/ahci-test.c | 4 ++-- tests/fw_cfg-test.c | 4 ++-- tests/libqos/ahci.c | 2 +- tests/libqos/libqos.c | 2 +- tests/libqos/malloc.c | 6 +++--- tests/libqtest.c | 2 +- tests/pc-cpu-test.c | 2 +- 7 files changed, 11 insertions(+), 11 deletions(-) diff --git a/tests/ahci-test.c b/tests/ahci-test.c index 999121bb7c..cb84edc8fb 100644 --- a/tests/ahci-test.c +++ b/tests/ahci-test.c @@ -155,7 +155,7 @@ static AHCIQState *ahci_vboot(const char *cli, va_list ap) { AHCIQState *s; - s = g_malloc0(sizeof(AHCIQState)); + s = g_new0(AHCIQState, 1); s->parent = qtest_pc_vboot(cli, ap); alloc_set_flags(s->parent->alloc, ALLOC_LEAK_ASSERT); @@ -1806,7 +1806,7 @@ static void create_ahci_io_test(enum IOMode type, enum AddrMode addr, char *name; AHCIIOTestOptions *opts; - opts = g_malloc(sizeof(AHCIIOTestOptions)); + opts = g_new(AHCIIOTestOptions, 1); opts->length = len; opts->address_type = addr; opts->io_type = type; diff --git a/tests/fw_cfg-test.c b/tests/fw_cfg-test.c index 688342bed5..81f45bdfc8 100644 --- a/tests/fw_cfg-test.c +++ b/tests/fw_cfg-test.c @@ -79,8 +79,8 @@ static void test_fw_cfg_numa(void) g_assert_cmpint(qfw_cfg_get_u64(fw_cfg, FW_CFG_NUMA), ==, nb_nodes); - cpu_mask = g_malloc0(sizeof(uint64_t) * max_cpus); - node_mask = g_malloc0(sizeof(uint64_t) * nb_nodes); + cpu_mask = g_new0(uint64_t, max_cpus); + node_mask = g_new0(uint64_t, nb_nodes); qfw_cfg_read_data(fw_cfg, cpu_mask, sizeof(uint64_t) * max_cpus); qfw_cfg_read_data(fw_cfg, node_mask, sizeof(uint64_t) * nb_nodes); diff --git a/tests/libqos/ahci.c b/tests/libqos/ahci.c index 1ca7f456b5..13c0749582 100644 --- a/tests/libqos/ahci.c +++ b/tests/libqos/ahci.c @@ -843,7 +843,7 @@ AHCICommand *ahci_command_create(uint8_t command_name) AHCICommand *cmd; g_assert(props); - cmd = g_malloc0(sizeof(AHCICommand)); + cmd = g_new0(AHCICommand, 1); g_assert(!(props->dma && props->pio)); g_assert(!(props->lba28 && props->lba48)); g_assert(!(props->read && props->write)); diff --git a/tests/libqos/libqos.c b/tests/libqos/libqos.c index 6226546c28..991bc1aec2 100644 --- a/tests/libqos/libqos.c +++ b/tests/libqos/libqos.c @@ -17,7 +17,7 @@ QOSState *qtest_vboot(QOSOps *ops, const char *cmdline_fmt, va_list ap) { char *cmdline; - struct QOSState *qs = g_malloc(sizeof(QOSState)); + struct QOSState *qs = g_new(QOSState, 1); cmdline = g_strdup_vprintf(cmdline_fmt, ap); qs->qts = qtest_start(cmdline); diff --git a/tests/libqos/malloc.c b/tests/libqos/malloc.c index b8eff5f495..ac05874b0a 100644 --- a/tests/libqos/malloc.c +++ b/tests/libqos/malloc.c @@ -129,7 +129,7 @@ static MemBlock *mlist_new(uint64_t addr, uint64_t size) if (!size) { return NULL; } - block = g_malloc0(sizeof(MemBlock)); + block = g_new0(MemBlock, 1); block->addr = addr; block->size = size; @@ -305,8 +305,8 @@ QGuestAllocator *alloc_init(uint64_t start, uint64_t end) s->start = start; s->end = end; - s->used = g_malloc(sizeof(MemList)); - s->free = g_malloc(sizeof(MemList)); + s->used = g_new(MemList, 1); + s->free = g_new(MemList, 1); QTAILQ_INIT(s->used); QTAILQ_INIT(s->free); diff --git a/tests/libqtest.c b/tests/libqtest.c index cbd709470b..adf71188b6 100644 --- a/tests/libqtest.c +++ b/tests/libqtest.c @@ -171,7 +171,7 @@ QTestState *qtest_init_without_qmp_handshake(const char *extra_args) gchar *command; const char *qemu_binary = qtest_qemu_binary(); - s = g_malloc(sizeof(*s)); + s = g_new(QTestState, 1); socket_path = g_strdup_printf("/tmp/qtest-%d.sock", getpid()); qmp_socket_path = g_strdup_printf("/tmp/qtest-%d.qmp", getpid()); diff --git a/tests/pc-cpu-test.c b/tests/pc-cpu-test.c index c4211a4e85..11d3e810ef 100644 --- a/tests/pc-cpu-test.c +++ b/tests/pc-cpu-test.c @@ -87,7 +87,7 @@ static void add_pc_test_case(const char *mname) if (!g_str_has_prefix(mname, "pc-")) { return; } - data = g_malloc(sizeof(PCTestData)); + data = g_new(PCTestData, 1); data->machine = g_strdup(mname); data->cpu_model = "Haswell"; /* 1.3+ theoretically */ data->sockets = 1; From patchwork Fri Oct 6 23:49:57 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 822829 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="Cf/qJHiH"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3y86wm21F6z9t3v for ; Sat, 7 Oct 2017 11:35:20 +1100 (AEDT) Received: from localhost ([::1]:47776 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e0d5K-000314-AW for incoming@patchwork.ozlabs.org; Fri, 06 Oct 2017 20:35:18 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42955) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e0cRZ-0001Qp-Ku for qemu-devel@nongnu.org; Fri, 06 Oct 2017 19:54:14 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e0cRX-0007G5-1j for qemu-devel@nongnu.org; Fri, 06 Oct 2017 19:54:13 -0400 Received: from mail-qk0-x244.google.com ([2607:f8b0:400d:c09::244]:37994) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1e0cRW-0007Fl-Tw; Fri, 06 Oct 2017 19:54:10 -0400 Received: by mail-qk0-x244.google.com with SMTP id 17so5919960qkq.5; Fri, 06 Oct 2017 16:54:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=pSEuMLb4KNqK4hKyE9WYjo+BhFchDw/spXp+IVECoI4=; b=Cf/qJHiHcjm0PS4+EpKL7ayUhkeYPE3ktphI7As5Hc0y0L7RUUvaPH5Zq3RDqitkNM l9jw4QezsLiSyWxoU77d5fKs2IMShPwhSSvvtNWjQl+MBHiFSJTwVv81D/QN2M+uC2wI AyX5X3gTw9855spDWHRhdWmS3nZVLLJeEkogVe5qwXMUgfdFxn2b8NkDPx1uogtEHc+B Qt68yHv/ou336gR5/QdrdIx+GBDri5IDMXdLtRfrCwF+NFxY0hskC+4yQgavsukqkN+Y zxqFuD+QYtkgeIOxgBNVP5wFCd3ofqaf2RA4zXEHiHZdJSVfi0+eCGt0IQhxv+kStXl9 tLlw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=pSEuMLb4KNqK4hKyE9WYjo+BhFchDw/spXp+IVECoI4=; b=tWkMmh9f5zOFqZgs4kOk5wc0Aae/RCO7hLZTDMuCma5hAGZQ4SPH85AOW0qVSGC/aK 5EZk0K5atlTut6OAh9vJ/fkXS95IuighNHppB00qRE0Vn5GjXfgqx6hjy6jU06h1Upo1 I7AnhOIdADHFSkQqNHyGlVFCzOv7raInL4dEjEc3KCl/oV+0d/bCs3KYkhLL7bECnQRv 3brTFpFnGDLBQD2EihmyzcPYubGB+1ni4DrcOnSPKoTTpjGdbI8nqXBENNonRUvwR+XW Vyppb5kkOSPMVumiboz9IqK3nyrXYjOaA7gIX1MYfDrkTAff8GSx/yd8G2lJoLeHxiOU p3Fg== X-Gm-Message-State: AMCzsaVLZbn2ny2twa1jQivqzAyFz7Htxh/VdLg0AOQG3uH2LAi6g5kR pvJKWnQQH1o64F8ccbdQTL8= X-Google-Smtp-Source: AOwi7QDaxGWjcXIIa1sVjJqT0vTExVfOKEAH+qwT+OIXq0c7+eCJFBZj2Vbfk8LhNBrJ6DGc7nhUpA== X-Received: by 10.55.25.85 with SMTP id k82mr625290qkh.223.1507334050400; Fri, 06 Oct 2017 16:54:10 -0700 (PDT) Received: from yoga.lan ([181.93.89.178]) by smtp.gmail.com with ESMTPSA id g1sm1705226qta.95.2017.10.06.16.54.07 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 06 Oct 2017 16:54:09 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Markus Armbruster , Eric Blake , Riku Voipio , Laurent Vivier Date: Fri, 6 Oct 2017 20:49:57 -0300 Message-Id: <20171006235023.11952-63-f4bug@amsat.org> X-Mailer: git-send-email 2.14.2 In-Reply-To: <20171006235023.11952-1-f4bug@amsat.org> References: <20171006235023.11952-1-f4bug@amsat.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c09::244 Subject: [Qemu-devel] [PATCH 62/88] user: use g_new() family of functions X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , qemu trival , qemu-devel@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Marc-André Lureau Signed-off-by: Marc-André Lureau Signed-off-by: Philippe Mathieu-Daudé [PMD: added linux-user/elfload.c] --- linux-user/elfload.c | 2 +- thunk.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/linux-user/elfload.c b/linux-user/elfload.c index 79062882ba..0a826071e9 100644 --- a/linux-user/elfload.c +++ b/linux-user/elfload.c @@ -3014,7 +3014,7 @@ static void fill_thread_info(struct elf_note_info *info, const CPUArchState *env TaskState *ts = (TaskState *)cpu->opaque; struct elf_thread_status *ets; - ets = g_malloc0(sizeof (*ets)); + ets = g_new0(struct elf_thread_status, 1); ets->num_notes = 1; /* only prstatus is dumped */ fill_prstatus(&ets->prstatus, ts, 0); elf_core_copy_regs(&ets->prstatus.pr_reg, env); diff --git a/thunk.c b/thunk.c index d5d8645cd4..17f3d320bb 100644 --- a/thunk.c +++ b/thunk.c @@ -89,7 +89,7 @@ void thunk_register_struct(int id, const char *name, const argtype *types) for(i = 0;i < 2; i++) { offset = 0; max_align = 1; - se->field_offsets[i] = malloc(nb_fields * sizeof(int)); + se->field_offsets[i] = g_new(int, nb_fields); type_ptr = se->field_types; for(j = 0;j < nb_fields; j++) { size = thunk_type_size(type_ptr, i); From patchwork Fri Oct 6 23:49:58 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 822842 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="DIdnjvtD"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3y87830xrhz9t5C for ; Sat, 7 Oct 2017 11:45:07 +1100 (AEDT) Received: from localhost ([::1]:47837 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e0dEn-00044j-1l for incoming@patchwork.ozlabs.org; Fri, 06 Oct 2017 20:45:05 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42977) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e0cRb-0001Sv-81 for qemu-devel@nongnu.org; Fri, 06 Oct 2017 19:54:16 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e0cRa-0007Hm-J8 for qemu-devel@nongnu.org; Fri, 06 Oct 2017 19:54:15 -0400 Received: from mail-qk0-x243.google.com ([2607:f8b0:400d:c09::243]:34150) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1e0cRa-0007HV-FV; Fri, 06 Oct 2017 19:54:14 -0400 Received: by mail-qk0-x243.google.com with SMTP id b124so10273282qke.1; Fri, 06 Oct 2017 16:54:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=+zuWrVpblRzWFsye7f7a+A4b0twr9QIqjpgKHzFWJOM=; b=DIdnjvtDhhfO/GA4ZiHsmauyQyYSFQSd50ndOTrLabz1WvFxOuCwR5DEZ2hlj5jZrC FKUAYqQoO7eUXXP0JpzxPNJa+y+ZXWBwyeM3vv5TefG9jPyQkwaT1aNj9QTjRyLu9o3S uDbDTL3bo01Z1mRDhrGRmFnV8DFsVRrKiX8lm8ZJUR3kL+lODngIhmG7+tQ9n51CXisu sKMDm7ZqHR1Oh4kSdtOUjh80WBIDROu+bJN3jG0CtBXpfVbLQ+y95hPgPpApKQst6lGR oovCdqeev8j4hLxzDCn+/whX7t8fshKi3tsuZGwF5eS5TD8+meOnArDb+1yPRxVfkgd4 c1Ag== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=+zuWrVpblRzWFsye7f7a+A4b0twr9QIqjpgKHzFWJOM=; b=mrC1WDQuHU89w7c9NmUu6nA4+Wz5X4RrPu+ZCUNLLFM3gmte9jkCK4+jlFQubjakPj 9HeagGuuyfNQYnRHuisNtw7By9tewxoS29TOU+qa/5VSG6hdixBl3YbHCj1Nv4ai2NyU XbopiT4GlDpTrTf76Tahl2xoWSeDk2a09ZsdjO61GJ6ZY2V16xbLft1EtQUxl6D/1jXm OVTbkMEC2HcbdQ9F9JVh9z6g5UMzP9MbY1jPcNavFQep1kAAsHIgaZFZIJd911aiXu1h 8ows4s9VEWLwVp3g3eM0Kb1bbBaxvoDQknn9XlevVex3M8bcA0uS/hlZj8cFHDN4GUOE 0zXA== X-Gm-Message-State: AMCzsaVH1B+ACA2sFb8xSgfz52ZjXxM5S36hchIGrISbFGtWG7D90/p/ pKlBkj8qI5WoHxpsQ6IUJ3s= X-Google-Smtp-Source: AOwi7QAPN2JUdyhR9QvLVH58v0PF2CDlPv4xGEwMXc9aPG3nQi6lIMuYT43ugmbpC/Iwr+XOuVBHEQ== X-Received: by 10.55.56.14 with SMTP id f14mr740256qka.286.1507334053945; Fri, 06 Oct 2017 16:54:13 -0700 (PDT) Received: from yoga.lan ([181.93.89.178]) by smtp.gmail.com with ESMTPSA id g1sm1705226qta.95.2017.10.06.16.54.10 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 06 Oct 2017 16:54:13 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Markus Armbruster , Eric Blake , Riku Voipio , Laurent Vivier , Kamil Rytarowski Date: Fri, 6 Oct 2017 20:49:58 -0300 Message-Id: <20171006235023.11952-64-f4bug@amsat.org> X-Mailer: git-send-email 2.14.2 In-Reply-To: <20171006235023.11952-1-f4bug@amsat.org> References: <20171006235023.11952-1-f4bug@amsat.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c09::243 Subject: [Qemu-devel] [PATCH 63/88] bsd-user/syscall: fix a memory leak on EFAULT, use g_new() X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , qemu trival , =?utf-8?q?Philippe_Mathieu-Dau?= =?utf-8?b?ZMOp?= , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Philippe Mathieu-Daudé --- Kamil are you interested in maintaining bsd-user? :) bsd-user/syscall.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bsd-user/syscall.c b/bsd-user/syscall.c index 66492aaf5d..9120cea61e 100644 --- a/bsd-user/syscall.c +++ b/bsd-user/syscall.c @@ -227,7 +227,7 @@ static abi_long do_freebsd_sysctl(abi_ulong namep, int32_t namelen, abi_ulong ol void *hnamep, *holdp, *hnewp = NULL; size_t holdlen; abi_ulong oldlen = 0; - int32_t *snamep = g_malloc(sizeof(int32_t) * namelen), *p, *q, i; + int32_t *snamep, *p, *q, i; uint32_t kind = 0; if (oldlenp) @@ -239,6 +239,7 @@ static abi_long do_freebsd_sysctl(abi_ulong namep, int32_t namelen, abi_ulong ol if (!(holdp = lock_user(VERIFY_WRITE, oldp, oldlen, 0))) return -TARGET_EFAULT; holdlen = oldlen; + snamep = g_new(int32_t, namelen); for (p = hnamep, q = snamep, i = 0; i < namelen; p++, i++) *q++ = tswap32(*p); oidfmt(snamep, namelen, NULL, &kind); From patchwork Fri Oct 6 23:49:59 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 822841 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="QIrMAbVi"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3y877S2nsWz9t5C for ; Sat, 7 Oct 2017 11:44:36 +1100 (AEDT) Received: from localhost ([::1]:47834 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e0dEI-0003bh-Fv for incoming@patchwork.ozlabs.org; Fri, 06 Oct 2017 20:44:34 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43028) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e0cRe-0001Wv-TG for qemu-devel@nongnu.org; Fri, 06 Oct 2017 19:54:22 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e0cRe-0007Jt-6K for qemu-devel@nongnu.org; Fri, 06 Oct 2017 19:54:18 -0400 Received: from mail-qk0-x244.google.com ([2607:f8b0:400d:c09::244]:36759) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1e0cRe-0007Je-1m; Fri, 06 Oct 2017 19:54:18 -0400 Received: by mail-qk0-x244.google.com with SMTP id z14so12862194qkg.3; Fri, 06 Oct 2017 16:54:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Ojw9HEM77nCTJ0wr1WnMr5fYm5yldE5FoKqI3zTeQUg=; b=QIrMAbViWSO5gZiMb+q4GmbLVG6thsrzPMifvdq3J05sfj988YzrvihJgE0rAwIAXT //LAgzeQdoUxHQwM0IIcU1V+Q9378g2cQm0fSaP5TTjY9wHcl+KJvlc1WMOHSm667wGn VfqhPaH7OZONgshtbUMx3xsRGXqJ7KT67Bio3HaWOSHooZ8cKJ9CtJk1f1siep/foWNU LJxrXy/rRFVThMpxYGNu5XFrqNwFDZyXMyn59N9bakO6xflkbEMyDWdbHgnZlr9wncso p5bBHBcQ9URwn9oHmGj/Mp2u/pGMFGcj0JthivVRkGrokMTla6lvXrq2SJ3BQHLWJMQg nK/w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=Ojw9HEM77nCTJ0wr1WnMr5fYm5yldE5FoKqI3zTeQUg=; b=MXuz9u3F7tfs3PBwHLkhBf1EUqx0+HVIWol2bs1RrB9hD5ATemr8ZGfG31waZwJSN4 0NK15kcpj5zBIMU3UaIIVufjsNIO3wZXcGggn3rCNUDcYWDtB2Q88xrFZHS7ACmOzBB/ pC1Cu1/0SKca5fTL8SF8+4jJlUv3Sdku78uSHWWgEgAMmJT3qT9fE1u20J7NL0tYDT9+ pNilSpTvyVDA/EPNWSnL/WiqDd5MuMNGgN10lw4D7/fYOheAfRKHpcg9+XNDvJvszSVd Gs8XwJ4k9j6f28YKRIJY3uvohJT+HEfbi0nv+bdGYPEzBLiNIiU+udHmpJ/1p5Ev6zly ydww== X-Gm-Message-State: AMCzsaUmJUHdqvBMYGTE4XVSD6lxTPGeiMDzprs+wPyKHgyZirhCfUNl oPWgKi5a3hrvzwsaqfFYv8E= X-Google-Smtp-Source: AOwi7QDXfZ4PiXxASegeEzDtJ21zOzmDJLhVvaBSZzbkbcYq9jIwrauXoNGPf3MWYBP1fEE1QI1wMA== X-Received: by 10.55.100.67 with SMTP id y64mr735735qkb.252.1507334057519; Fri, 06 Oct 2017 16:54:17 -0700 (PDT) Received: from yoga.lan ([181.93.89.178]) by smtp.gmail.com with ESMTPSA id g1sm1705226qta.95.2017.10.06.16.54.14 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 06 Oct 2017 16:54:16 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Markus Armbruster , Eric Blake , Riku Voipio , Laurent Vivier Date: Fri, 6 Oct 2017 20:49:59 -0300 Message-Id: <20171006235023.11952-65-f4bug@amsat.org> X-Mailer: git-send-email 2.14.2 In-Reply-To: <20171006235023.11952-1-f4bug@amsat.org> References: <20171006235023.11952-1-f4bug@amsat.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c09::244 Subject: [Qemu-devel] [PATCH 64/88] user: use g_strfreev() X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , qemu trival , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Marc-André Lureau Signed-off-by: Marc-André Lureau --- bsd-user/main.c | 6 +----- linux-user/main.c | 6 +----- 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/bsd-user/main.c b/bsd-user/main.c index 836daac15c..fb0a4e48cb 100644 --- a/bsd-user/main.c +++ b/bsd-user/main.c @@ -947,11 +947,7 @@ int main(int argc, char **argv) _exit(1); } - for (wrk = target_environ; *wrk; wrk++) { - g_free(*wrk); - } - - g_free(target_environ); + g_strfreev(target_environ); if (qemu_loglevel_mask(CPU_LOG_PAGE)) { qemu_log("guest_base 0x%lx\n", guest_base); diff --git a/linux-user/main.c b/linux-user/main.c index 829f974662..f1e799f570 100644 --- a/linux-user/main.c +++ b/linux-user/main.c @@ -4426,11 +4426,7 @@ int main(int argc, char **argv, char **envp) _exit(EXIT_FAILURE); } - for (wrk = target_environ; *wrk; wrk++) { - g_free(*wrk); - } - - g_free(target_environ); + g_strfreev(target_environ); if (qemu_loglevel_mask(CPU_LOG_PAGE)) { qemu_log("guest_base 0x%lx\n", guest_base); From patchwork Fri Oct 6 23:50:00 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 822832 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="srzq5j0j"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3y86zj0k9kz9t3m for ; Sat, 7 Oct 2017 11:37:53 +1100 (AEDT) Received: from localhost ([::1]:47796 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e0d7n-0005ao-3P for incoming@patchwork.ozlabs.org; Fri, 06 Oct 2017 20:37:51 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43051) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e0cRj-0001cZ-92 for qemu-devel@nongnu.org; Fri, 06 Oct 2017 19:54:24 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e0cRi-0007Na-4N for qemu-devel@nongnu.org; Fri, 06 Oct 2017 19:54:23 -0400 Received: from mail-qk0-x242.google.com ([2607:f8b0:400d:c09::242]:36761) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1e0cRh-0007My-VT; Fri, 06 Oct 2017 19:54:22 -0400 Received: by mail-qk0-x242.google.com with SMTP id z14so12862240qkg.3; Fri, 06 Oct 2017 16:54:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=nq9BCKrICxD9bnF6ixu6+BxmBS0KBKlFFaxPU6YfRjo=; b=srzq5j0j4YuhOSFloTzQ7x/2gRc1xfeARMJxOoj4CztezY8q0Wl6cjkhey1k8OyltR +grh14lyFLBPcJA18Xe7wdMHhvYcTdIjXvF9IP0tiKO6a/1vSHGpGDOzK4MJG6NGQFqk RIzZGNRMGerXzIqWafjDL1NAkoqcVWsCTpzk/R6Uu6HKJZ16sI4LkdwtcVsn5wK/47t3 5w8VHeu9UhmWWQiMh2yFfCbm/DJvhSptEFFB4WShPSemFMA7+VJVafnwoWNInwSDN+Z0 wGCOHcabasuz612aISZw2vRdiwrK4V9vcMC7NSsj/vdl+pOq+GDb7Fr0cbzyr+dRzQcq mmuw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=nq9BCKrICxD9bnF6ixu6+BxmBS0KBKlFFaxPU6YfRjo=; b=Qo+JrRI8PR2Kp0ziOPq+ZaURGp6KIrYsLVseNSX0HZRvEiP3YRFxDEpvyqjc73ySba 3uZSpqRkgoYLPUW7DTtwXGRyNeSlqTZTEhLX04hpZLR6N9zr1fADGzUbeUfEqSHeGgk0 46X/5jN4eN7OL90pxICR87Bnmab2bkyZ2+2MG4gwLcnV80PCWD/uFv01avpyFF0yGG1P Z5Pqtbcz4XcGq8wl+HMtbGiepZAZkIkS6mvLThkZ+LasNJ5/77IS3K93eW+wEP6o1CZ9 ARiqfrnZzh7ijppfqohF4OPkMVOWeY5VpzYPN16CF6sxmq3OagnlfLkeHrNo7MzAtOxi A1Mw== X-Gm-Message-State: AMCzsaUQDImnINOx4MmXULqZFnZozhB++jFBJf209ANObJszjXNN2Z6+ N6cIvHVNlx/K2bMGx5FA8l4= X-Google-Smtp-Source: AOwi7QApzWhqXHKxTHEIhjGxB0E2J10nEXJsph7n5K4TcWwSKBHLPDPugY5S4lqBUKn7GATKx++luw== X-Received: by 10.55.183.134 with SMTP id h128mr712846qkf.96.1507334061380; Fri, 06 Oct 2017 16:54:21 -0700 (PDT) Received: from yoga.lan ([181.93.89.178]) by smtp.gmail.com with ESMTPSA id g1sm1705226qta.95.2017.10.06.16.54.17 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 06 Oct 2017 16:54:20 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Markus Armbruster , Eric Blake , Stefan Hajnoczi , Max Reitz , Fam Zheng Date: Fri, 6 Oct 2017 20:50:00 -0300 Message-Id: <20171006235023.11952-66-f4bug@amsat.org> X-Mailer: git-send-email 2.14.2 In-Reply-To: <20171006235023.11952-1-f4bug@amsat.org> References: <20171006235023.11952-1-f4bug@amsat.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c09::242 Subject: [Qemu-devel] [PATCH 65/88] util: use g_new() family of functions X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , qemu trival , qemu-devel@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Marc-André Lureau Signed-off-by: Marc-André Lureau Signed-off-by: Philippe Mathieu-Daudé [PMD: more changes in util/envlist.c, more files updated] --- util/acl.c | 6 +++--- util/envlist.c | 6 +++--- util/error.c | 2 +- util/iohandler.c | 2 +- util/module.c | 4 ++-- util/qemu-option.c | 8 ++++---- util/qht.c | 2 +- 7 files changed, 15 insertions(+), 15 deletions(-) diff --git a/util/acl.c b/util/acl.c index c105addadc..f5d8295fe2 100644 --- a/util/acl.c +++ b/util/acl.c @@ -56,7 +56,7 @@ qemu_acl *qemu_acl_init(const char *aclname) if (acl) return acl; - acl = g_malloc(sizeof(*acl)); + acl = g_new(qemu_acl, 1); acl->aclname = g_strdup(aclname); /* Deny by default, so there is no window of "open * access" between QEMU starting, and the user setting @@ -117,7 +117,7 @@ int qemu_acl_append(qemu_acl *acl, { qemu_acl_entry *entry; - entry = g_malloc(sizeof(*entry)); + entry = g_new(qemu_acl_entry, 1); entry->match = g_strdup(match); entry->deny = deny; @@ -146,7 +146,7 @@ int qemu_acl_insert(qemu_acl *acl, i++; if (i == index) { qemu_acl_entry *entry; - entry = g_malloc(sizeof(*entry)); + entry = g_new(qemu_acl_entry, 1); entry->match = g_strdup(match); entry->deny = deny; diff --git a/util/envlist.c b/util/envlist.c index 1eeb7fca87..5934095b7d 100644 --- a/util/envlist.c +++ b/util/envlist.c @@ -24,7 +24,7 @@ envlist_create(void) { envlist_t *envlist; - envlist = g_malloc(sizeof(*envlist)); + envlist = g_new(envlist_t, 1); QLIST_INIT(&envlist->el_entries); envlist->el_count = 0; @@ -158,7 +158,7 @@ envlist_setenv(envlist_t *envlist, const char *env) envlist->el_count++; } - entry = g_malloc(sizeof(*entry)); + entry = g_new(struct envlist_entry, 1); entry->ev_var = g_strdup(env); QLIST_INSERT_HEAD(&envlist->el_entries, entry, ev_link); @@ -218,7 +218,7 @@ envlist_to_environ(const envlist_t *envlist, size_t *count) struct envlist_entry *entry; char **env, **penv; - penv = env = g_malloc((envlist->el_count + 1) * sizeof(char *)); + penv = env = g_new(char *, envlist->el_count + 1); for (entry = envlist->el_entries.lh_first; entry != NULL; entry = entry->ev_link.le_next) { diff --git a/util/error.c b/util/error.c index 3efdd69162..cfb829b1f8 100644 --- a/util/error.c +++ b/util/error.c @@ -56,7 +56,7 @@ static void error_setv(Error **errp, } assert(*errp == NULL); - err = g_malloc0(sizeof(*err)); + err = g_new0(Error, 1); err->msg = g_strdup_vprintf(fmt, ap); if (suffix) { char *msg = err->msg; diff --git a/util/iohandler.c b/util/iohandler.c index 623b55b9ec..518922dcea 100644 --- a/util/iohandler.c +++ b/util/iohandler.c @@ -128,7 +128,7 @@ int qemu_add_child_watch(pid_t pid) return 1; } } - rec = g_malloc0(sizeof(ChildProcessRecord)); + rec = g_new0(ChildProcessRecord, 1); rec->pid = pid; QLIST_INSERT_HEAD(&child_watches, rec, next); return 0; diff --git a/util/module.c b/util/module.c index c90973721f..1533dbdc63 100644 --- a/util/module.c +++ b/util/module.c @@ -65,7 +65,7 @@ void register_module_init(void (*fn)(void), module_init_type type) ModuleEntry *e; ModuleTypeList *l; - e = g_malloc0(sizeof(*e)); + e = g_new0(ModuleEntry, 1); e->init = fn; e->type = type; @@ -80,7 +80,7 @@ void register_dso_module_init(void (*fn)(void), module_init_type type) init_lists(); - e = g_malloc0(sizeof(*e)); + e = g_new0(ModuleEntry, 1); e->init = fn; e->type = type; diff --git a/util/qemu-option.c b/util/qemu-option.c index 9b1dc8093b..8a121bfc40 100644 --- a/util/qemu-option.c +++ b/util/qemu-option.c @@ -534,7 +534,7 @@ static void opt_set(QemuOpts *opts, const char *name, const char *value, return; } - opt = g_malloc0(sizeof(*opt)); + opt = g_new0(QemuOpt, 1); opt->name = g_strdup(name); opt->opts = opts; if (prepend) { @@ -564,7 +564,7 @@ void qemu_opt_set_bool(QemuOpts *opts, const char *name, bool val, QemuOpt *opt; const QemuOptDesc *desc = opts->list->desc; - opt = g_malloc0(sizeof(*opt)); + opt = g_new0(QemuOpt, 1); opt->desc = find_desc_by_name(desc, name); if (!opt->desc && !opts_accepts_any(opts)) { error_setg(errp, QERR_INVALID_PARAMETER, name); @@ -585,7 +585,7 @@ void qemu_opt_set_number(QemuOpts *opts, const char *name, int64_t val, QemuOpt *opt; const QemuOptDesc *desc = opts->list->desc; - opt = g_malloc0(sizeof(*opt)); + opt = g_new0(QemuOpt, 1); opt->desc = find_desc_by_name(desc, name); if (!opt->desc && !opts_accepts_any(opts)) { error_setg(errp, QERR_INVALID_PARAMETER, name); @@ -665,7 +665,7 @@ QemuOpts *qemu_opts_create(QemuOptsList *list, const char *id, return opts; } } - opts = g_malloc0(sizeof(*opts)); + opts = g_new0(QemuOpts, 1); opts->id = g_strdup(id); opts->list = list; loc_save(&opts->loc); diff --git a/util/qht.c b/util/qht.c index ff4d2e6974..c5d153d573 100644 --- a/util/qht.c +++ b/util/qht.c @@ -331,7 +331,7 @@ static struct qht_map *qht_map_create(size_t n_buckets) struct qht_map *map; size_t i; - map = g_malloc(sizeof(*map)); + map = g_new(struct qht_map, 1); map->n_buckets = n_buckets; map->n_added_buckets = 0; From patchwork Fri Oct 6 23:50:01 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 822849 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="kgoelH7J"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3y87Bm5z5rz9t5C for ; Sat, 7 Oct 2017 11:47:28 +1100 (AEDT) Received: from localhost ([::1]:47857 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e0dH4-0006D7-Qf for incoming@patchwork.ozlabs.org; Fri, 06 Oct 2017 20:47:26 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43092) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e0cRm-0001fy-Ae for qemu-devel@nongnu.org; Fri, 06 Oct 2017 19:54:27 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e0cRl-0007S8-N9 for qemu-devel@nongnu.org; Fri, 06 Oct 2017 19:54:26 -0400 Received: from mail-qt0-x243.google.com ([2607:f8b0:400d:c0d::243]:49217) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1e0cRl-0007Rr-IY; Fri, 06 Oct 2017 19:54:25 -0400 Received: by mail-qt0-x243.google.com with SMTP id o3so34351066qte.6; Fri, 06 Oct 2017 16:54:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=V6LQStLLjNwrTr4nz30zd9NXMYDu5ss73KTOL73Tm5Q=; b=kgoelH7JZ3ewE9//MNRvtQndgeLlL74GF1i58/nmJmOQeaWrE0xnTnFkJTdrp2Zp+S P3wZZSNKX0RzK+gaCjii5eN72NPurlZA9syXxlB5Slpq4K8o0qE0l0dW8VGfzy/DSs6C PRwlmpepa740CxSwNDzsRV3uPRO2MXc1quStfAMqpqCuHr3IQzkUhQZXJycb/TCq1vjL iQ+XoAoRCnwbyA2nElIVNz9h2Q6/bJJSGbuxnR4+Xw66mWDcx2eLT+mAdXmSTJaNrg02 r3qoh6RgcTENNAC/Ua1x8Ore71hlcxw/BUPS/0D+np2RfOlQJH2RiNp5hF6xs3K6QASv sE8w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=V6LQStLLjNwrTr4nz30zd9NXMYDu5ss73KTOL73Tm5Q=; b=TfpwnvftF/Z+3iluKs0Q6rhuCUk2JIJK6f6e2XiWXlVooqYxP3B5jaLIPC9uu8L1cR CmUnQxp+qgzhtC3eLCjSY9dkOW7RyA/dPIaFd1GD4fbd4sih3qA8y7J7AnZapobk8GoN 9n9UXLsl/bsNzpXonjlStngs6Zw/guMsEHwsyOSTbQRdgXZJcFOeboNbrdzGZEEFMHgd UZ6yuy41oYtSs633D+IrRntzbHQNekfoN4cYZ7wNW0tAHgl+pETvA0c8Uvd6FFzyCrn5 jd9MCZ937ReQSSD4E9QfsscFZOktRQCt26fkeRG9QogBFwzU4wpD+68Ixrbxd3HCWPYW UwvQ== X-Gm-Message-State: AMCzsaWyin46PdtTDpRaetMYwlIhIkOxb2s+fca80KOTCootNnoQbE5o DEm61mpiKlp0DVd9x8ZSc0Q= X-Google-Smtp-Source: AOwi7QBJYabAzNHx5QM3v9SmEK5wJMd4O9Y6O7hTtfEk84D0w5uVW5z16k/VFcCUVuLjNK+qSiCCWQ== X-Received: by 10.200.27.163 with SMTP id z32mr1012073qtj.8.1507334065043; Fri, 06 Oct 2017 16:54:25 -0700 (PDT) Received: from yoga.lan ([181.93.89.178]) by smtp.gmail.com with ESMTPSA id g1sm1705226qta.95.2017.10.06.16.54.21 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 06 Oct 2017 16:54:24 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Markus Armbruster , Eric Blake , Paolo Bonzini , Stefan Weil Date: Fri, 6 Oct 2017 20:50:01 -0300 Message-Id: <20171006235023.11952-67-f4bug@amsat.org> X-Mailer: git-send-email 2.14.2 In-Reply-To: <20171006235023.11952-1-f4bug@amsat.org> References: <20171006235023.11952-1-f4bug@amsat.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c0d::243 Subject: [Qemu-devel] [PATCH 66/88] util/qemu-thread-win32: use g_new() family of functions X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , qemu trival , =?utf-8?q?Philippe_Mathieu-Dau?= =?utf-8?b?ZMOp?= , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Stefan Weil --- util/qemu-thread-win32.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/util/qemu-thread-win32.c b/util/qemu-thread-win32.c index 94f3491a87..098fddb2af 100644 --- a/util/qemu-thread-win32.c +++ b/util/qemu-thread-win32.c @@ -394,7 +394,7 @@ void qemu_thread_create(QemuThread *thread, const char *name, HANDLE hThread; struct QemuThreadData *data; - data = g_malloc(sizeof *data); + data = g_new(struct QemuThreadData, 1); data->start_routine = start_routine; data->arg = arg; data->mode = mode; From patchwork Fri Oct 6 23:50:02 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 822836 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="S5xDx76i"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3y872Y1sTQz9t4X for ; Sat, 7 Oct 2017 11:40:21 +1100 (AEDT) Received: from localhost ([::1]:47804 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e0dAB-00087k-6F for incoming@patchwork.ozlabs.org; Fri, 06 Oct 2017 20:40:19 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43168) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e0cRr-0001ku-DG for qemu-devel@nongnu.org; Fri, 06 Oct 2017 19:54:34 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e0cRp-0007V4-33 for qemu-devel@nongnu.org; Fri, 06 Oct 2017 19:54:31 -0400 Received: from mail-qk0-x244.google.com ([2607:f8b0:400d:c09::244]:37702) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1e0cRo-0007Ui-Ux; Fri, 06 Oct 2017 19:54:29 -0400 Received: by mail-qk0-x244.google.com with SMTP id a12so10183880qka.4; Fri, 06 Oct 2017 16:54:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=6SrTUgrcPIWvRxuO+094cSdZdcC2kM6yMdPdbvsNfaw=; b=S5xDx76iVknmD1CBu6ta7BFcNkEq+o0IsZ0GMLR4/LC5HQiFHi29PerhMpOL8YYrqJ TAxbrqkCYGRA2TSFgL1HbOKpLdrc/s8c0qwzWU0O4U4BCzQobRUo0JszktZDjWFSJoDr t1XiobS/sMlTjxheL9NhGUekjhbWCqm1sHqhq1VkcfzacpeXhjOfkXlj6mR1KyNqyE7j IDBy63n5zaJ/W9be2O6/4FEUQe5N6bkqEG+9McgoQtXEc/UDNpErtAw1yNQwl5ANE2Z7 H9gMwhcJPiBhbr+xIpCWg0LC8nIlElrjq3/72LUR+QSnAERPVM0p48B0FKFjB038PboS xm8Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=6SrTUgrcPIWvRxuO+094cSdZdcC2kM6yMdPdbvsNfaw=; b=lF6093HOWr7aCRk6X/N53HI2lGyZsSegc3NpTH6odvi0OivhAYtodJXJuKj4HVeJff Nm0CprM96NXFurdPtpFj47SPtTHv9K9cNjjOL5vfHOsNEPclfp50Vuf+6PB1aVhECzWe euVdzlBPLCPHh9QYq6xii80O/aUDmiKkbacUNuXcfiuCKQRrucvKcz8rUlYafHeZ0CTe 7d2E4hKrUpOkNcjqPwWN0IMWA4bShqbFgYFy/PrWo3PygrpHO9hgbKKqvUdPh5nNG3UD L8NYBjRoMO1GbB+zjlMjrCe8lyOS9HplnMQtChqRKhxfZEyMhQip2/CA5SuEnqDXpqMp POhQ== X-Gm-Message-State: AMCzsaUMoQm5mqc93vmdPKiC17/sC3/mrdnsObSRX7uarT4f3Dh5/5ma OuNP6Nhf8GaX3pQg7tSN5BA= X-Google-Smtp-Source: AOwi7QBGqdeHt81aSeqWV5ZhKxhi2hPBAvH9HCVv3GXGWcfxXAmuZ7zHCJjd8zTfckKwG1Q71TP4hw== X-Received: by 10.55.95.1 with SMTP id t1mr662489qkb.254.1507334068439; Fri, 06 Oct 2017 16:54:28 -0700 (PDT) Received: from yoga.lan ([181.93.89.178]) by smtp.gmail.com with ESMTPSA id g1sm1705226qta.95.2017.10.06.16.54.25 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 06 Oct 2017 16:54:27 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Markus Armbruster , Eric Blake , Stefan Hajnoczi , Kevin Wolf Date: Fri, 6 Oct 2017 20:50:02 -0300 Message-Id: <20171006235023.11952-68-f4bug@amsat.org> X-Mailer: git-send-email 2.14.2 In-Reply-To: <20171006235023.11952-1-f4bug@amsat.org> References: <20171006235023.11952-1-f4bug@amsat.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c09::244 Subject: [Qemu-devel] [PATCH 67/88] util/coroutine: use g_new() family of functions X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu trival , =?utf-8?q?Marc-Andr=C3=A9_Lurea?= =?utf-8?q?u?= , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Philippe Mathieu-Daudé --- util/coroutine-sigaltstack.c | 2 +- util/coroutine-ucontext.c | 2 +- util/coroutine-win32.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/util/coroutine-sigaltstack.c b/util/coroutine-sigaltstack.c index f6fc49a0e5..4fe4bbf1b5 100644 --- a/util/coroutine-sigaltstack.c +++ b/util/coroutine-sigaltstack.c @@ -163,7 +163,7 @@ Coroutine *qemu_coroutine_new(void) * sigaltstack way of manipulating stacks. */ - co = g_malloc0(sizeof(*co)); + co = g_new0(CoroutineSigAltStack, 1); co->stack_size = COROUTINE_STACK_SIZE; co->stack = qemu_alloc_stack(&co->stack_size); co->base.entry_arg = &old_env; /* stash away our jmp_buf */ diff --git a/util/coroutine-ucontext.c b/util/coroutine-ucontext.c index 6621f3f692..c14dca19b4 100644 --- a/util/coroutine-ucontext.c +++ b/util/coroutine-ucontext.c @@ -100,7 +100,7 @@ Coroutine *qemu_coroutine_new(void) abort(); } - co = g_malloc0(sizeof(*co)); + co = g_new0(CoroutineUContext, 1); co->stack_size = COROUTINE_STACK_SIZE; co->stack = qemu_alloc_stack(&co->stack_size); co->base.entry_arg = &old_env; /* stash away our jmp_buf */ diff --git a/util/coroutine-win32.c b/util/coroutine-win32.c index de6bd4fd3e..6762ff83c2 100644 --- a/util/coroutine-win32.c +++ b/util/coroutine-win32.c @@ -74,7 +74,7 @@ Coroutine *qemu_coroutine_new(void) const size_t stack_size = COROUTINE_STACK_SIZE; CoroutineWin32 *co; - co = g_malloc0(sizeof(*co)); + co = g_new0(CoroutineWin32, 1); co->fiber = CreateFiber(stack_size, coroutine_trampoline, &co->base); return &co->base; } From patchwork Fri Oct 6 23:50:03 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 822851 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="pNoHitU1"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3y87CJ2qp4z9t3v for ; Sat, 7 Oct 2017 11:47:56 +1100 (AEDT) Received: from localhost ([::1]:47859 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e0dHW-0006cJ-EX for incoming@patchwork.ozlabs.org; Fri, 06 Oct 2017 20:47:54 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43229) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e0cRv-0001lx-36 for qemu-devel@nongnu.org; Fri, 06 Oct 2017 19:54:36 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e0cRt-0007Xj-HS for qemu-devel@nongnu.org; Fri, 06 Oct 2017 19:54:34 -0400 Received: from mail-qk0-x242.google.com ([2607:f8b0:400d:c09::242]:37704) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1e0cRt-0007XW-Cb; Fri, 06 Oct 2017 19:54:33 -0400 Received: by mail-qk0-x242.google.com with SMTP id a12so10183927qka.4; Fri, 06 Oct 2017 16:54:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=7FwOxY2SVjDYCoMj43VS/rMEtpwAyOpxf3MzIOU/8yU=; b=pNoHitU1A6yR003P0VhBcoicn3Q7H8EDVaKZxm8xJlE67yVTjS1d1TdcjMrSfDImkp Y6SN0zWZbNBTTp3GQQi5JOHQdqa0+0M6XrB+Qdc1O2Qk90FIfpOImJbOH/QKr6SZf+yE Emhl119aTviqSHDOUZ7Qdxh+07aJbMGdeamyjjZ9kv1tEaYM70h02a6HTSCYvaTKhkQn HswrcXJ3a5FoxYEWhb2um4eI1ZyO/HXsTKjRkerlmujQ1RSS4OpHxg2tZ5Dmmjs2kLAN CjlO2BVjlcyCFlMyrX65jaFwCakckZPN1tF+kFVxzloqbHNG/Nv5+iZeNiohg6TnvS7H ZQ/w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=7FwOxY2SVjDYCoMj43VS/rMEtpwAyOpxf3MzIOU/8yU=; b=fMBhcdBMeAlfxr4m9ErmgnIJANAWY+DLlG4ZDn5xCILpmHpP7NS8jFUIyKnHdy5Mwk sSPn2SzZvFvgPWJnNvKAK/8RUko4Xd/Ug9gRuZPPlBTsv8kIl6Brx4QPS+lcDTSavC2+ 7ug6josjtvBJAhPBgKFs8LyDIAjtvxihrU6BH+cosBw3yrengudsHlVlv4VbgSd0FBqg FByfZZKC8xMa2byqal133jftHWSC592DrjXY4ZhlZ1NREnBHFZmM/osngi0kK4cuiPva dn04RqZI7quQSfV8zdI0ZZJV4vVjWtTffFTRMSYodBiokXVp78eeDXaO1RAGW/vD+5o2 aX6g== X-Gm-Message-State: AMCzsaVi/x64BSwGUhCAWmQhuHpfH1y82NWgLGLA68wCRux/kZCePENW RsHhqcCg4ME8o31MlhrVCsE= X-Google-Smtp-Source: AOwi7QDhbP8+hEdr4WGFxmA0PJtEVOGiOn2r4BDiD6dQ+mQVnJSw6TYYnSGLVoN7JUsSxbXT/m4s+A== X-Received: by 10.55.26.138 with SMTP id l10mr737583qkh.71.1507334072822; Fri, 06 Oct 2017 16:54:32 -0700 (PDT) Received: from yoga.lan ([181.93.89.178]) by smtp.gmail.com with ESMTPSA id g1sm1705226qta.95.2017.10.06.16.54.28 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 06 Oct 2017 16:54:32 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Markus Armbruster , Eric Blake , "Michael S. Tsirkin" , Jason Wang Date: Fri, 6 Oct 2017 20:50:03 -0300 Message-Id: <20171006235023.11952-69-f4bug@amsat.org> X-Mailer: git-send-email 2.14.2 In-Reply-To: <20171006235023.11952-1-f4bug@amsat.org> References: <20171006235023.11952-1-f4bug@amsat.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c09::242 Subject: [Qemu-devel] [PATCH 68/88] virtio: use g_new() family of functions X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , qemu trival , qemu-devel@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Marc-André Lureau Signed-off-by: Marc-André Lureau Signed-off-by: Philippe Mathieu-Daudé [PMD: more changes/files] --- hw/char/virtio-serial-bus.c | 6 ++---- hw/display/virtio-gpu.c | 4 ++-- hw/net/virtio-net.c | 4 ++-- hw/virtio/vhost.c | 2 +- hw/virtio/virtio-crypto.c | 2 +- hw/virtio/virtio.c | 2 +- tests/libqos/virtio-mmio.c | 4 ++-- tests/libqos/virtio-pci.c | 4 ++-- 8 files changed, 13 insertions(+), 15 deletions(-) diff --git a/hw/char/virtio-serial-bus.c b/hw/char/virtio-serial-bus.c index 9470bd7be7..fe739bb773 100644 --- a/hw/char/virtio-serial-bus.c +++ b/hw/char/virtio-serial-bus.c @@ -1054,10 +1054,8 @@ static void virtio_serial_device_realize(DeviceState *dev, Error **errp) QTAILQ_INIT(&vser->ports); vser->bus.max_nr_ports = vser->serial.max_virtserial_ports; - vser->ivqs = g_malloc(vser->serial.max_virtserial_ports - * sizeof(VirtQueue *)); - vser->ovqs = g_malloc(vser->serial.max_virtserial_ports - * sizeof(VirtQueue *)); + vser->ivqs = g_new(VirtQueue *, vser->serial.max_virtserial_ports); + vser->ovqs = g_new(VirtQueue *, vser->serial.max_virtserial_ports); /* Add a queue for host to guest transfers for port 0 (backward compat) */ vser->ivqs[0] = virtio_add_queue(vdev, 128, handle_input); diff --git a/hw/display/virtio-gpu.c b/hw/display/virtio-gpu.c index 43bbe09ea0..fb3884220b 100644 --- a/hw/display/virtio-gpu.c +++ b/hw/display/virtio-gpu.c @@ -676,9 +676,9 @@ int virtio_gpu_create_mapping_iov(struct virtio_gpu_resource_attach_backing *ab, return -1; } - *iov = g_malloc0(sizeof(struct iovec) * ab->nr_entries); + *iov = g_new0(struct iovec, ab->nr_entries); if (addr) { - *addr = g_malloc0(sizeof(uint64_t) * ab->nr_entries); + *addr = g_new0(uint64_t, ab->nr_entries); } for (i = 0; i < ab->nr_entries; i++) { uint64_t a = le64_to_cpu(ents[i].addr); diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c index 150fd0748e..ce488b63d5 100644 --- a/hw/net/virtio-net.c +++ b/hw/net/virtio-net.c @@ -359,7 +359,7 @@ static RxFilterInfo *virtio_net_query_rxfilter(NetClientState *nc) strList *str_list, *entry; int i; - info = g_malloc0(sizeof(*info)); + info = g_new0(RxFilterInfo, 1); info->name = g_strdup(nc->name); info->promiscuous = n->promisc; @@ -1978,7 +1978,7 @@ static void virtio_net_device_realize(DeviceState *dev, Error **errp) virtio_cleanup(vdev); return; } - n->vqs = g_malloc0(sizeof(VirtIONetQueue) * n->max_queues); + n->vqs = g_new0(VirtIONetQueue, n->max_queues); n->curr_queues = 1; n->tx_timeout = n->net_conf.txtimer; diff --git a/hw/virtio/vhost.c b/hw/virtio/vhost.c index 5fd69f0b2e..f4abc1d26d 100644 --- a/hw/virtio/vhost.c +++ b/hw/virtio/vhost.c @@ -742,7 +742,7 @@ static void vhost_iommu_region_add(MemoryListener *listener, return; } - iommu = g_malloc0(sizeof(*iommu)); + iommu = g_new0(struct vhost_iommu, 1); end = int128_add(int128_make64(section->offset_within_region), section->size); end = int128_sub(end, int128_one()); diff --git a/hw/virtio/virtio-crypto.c b/hw/virtio/virtio-crypto.c index 19c82e0432..9544ea92ef 100644 --- a/hw/virtio/virtio-crypto.c +++ b/hw/virtio/virtio-crypto.c @@ -798,7 +798,7 @@ static void virtio_crypto_device_realize(DeviceState *dev, Error **errp) virtio_init(vdev, "virtio-crypto", VIRTIO_ID_CRYPTO, vcrypto->config_size); vcrypto->curr_queues = 1; - vcrypto->vqs = g_malloc0(sizeof(VirtIOCryptoQueue) * vcrypto->max_queues); + vcrypto->vqs = g_new0(VirtIOCryptoQueue, vcrypto->max_queues); for (i = 0; i < vcrypto->max_queues; i++) { vcrypto->vqs[i].dataq = virtio_add_queue(vdev, 1024, virtio_crypto_handle_dataq_bh); diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c index 311929e9df..9a38fe695a 100644 --- a/hw/virtio/virtio.c +++ b/hw/virtio/virtio.c @@ -2245,7 +2245,7 @@ void virtio_init(VirtIODevice *vdev, const char *name, atomic_set(&vdev->isr, 0); vdev->queue_sel = 0; vdev->config_vector = VIRTIO_NO_VECTOR; - vdev->vq = g_malloc0(sizeof(VirtQueue) * VIRTIO_QUEUE_MAX); + vdev->vq = g_new0(VirtQueue, VIRTIO_QUEUE_MAX); vdev->vm_running = runstate_is_running(); vdev->broken = false; for (i = 0; i < VIRTIO_QUEUE_MAX; i++) { diff --git a/tests/libqos/virtio-mmio.c b/tests/libqos/virtio-mmio.c index 7aa8383338..a48fecab63 100644 --- a/tests/libqos/virtio-mmio.c +++ b/tests/libqos/virtio-mmio.c @@ -127,7 +127,7 @@ static QVirtQueue *qvirtio_mmio_virtqueue_setup(QVirtioDevice *d, QVirtQueue *vq; uint64_t addr; - vq = g_malloc0(sizeof(*vq)); + vq = g_new0(QVirtQueue, 1); qvirtio_mmio_queue_select(d, index); writel(dev->addr + QVIRTIO_MMIO_QUEUE_ALIGN, dev->page_size); @@ -191,7 +191,7 @@ QVirtioMMIODevice *qvirtio_mmio_init_device(uint64_t addr, uint32_t page_size) { QVirtioMMIODevice *dev; uint32_t magic; - dev = g_malloc0(sizeof(*dev)); + dev = g_new0(QVirtioMMIODevice, 1); magic = readl(addr + QVIRTIO_MMIO_MAGIC_VALUE); g_assert(magic == ('v' | 'i' << 8 | 'r' << 16 | 't' << 24)); diff --git a/tests/libqos/virtio-pci.c b/tests/libqos/virtio-pci.c index 7ac15c04e1..02d5e0853e 100644 --- a/tests/libqos/virtio-pci.c +++ b/tests/libqos/virtio-pci.c @@ -38,7 +38,7 @@ void qvirtio_pci_device_free(QVirtioPCIDevice *dev) static QVirtioPCIDevice *qpcidevice_to_qvirtiodevice(QPCIDevice *pdev) { QVirtioPCIDevice *vpcidev; - vpcidev = g_malloc0(sizeof(*vpcidev)); + vpcidev = g_new0(QVirtioPCIDevice, 1); if (pdev) { vpcidev->pdev = pdev; @@ -229,7 +229,7 @@ static QVirtQueue *qvirtio_pci_virtqueue_setup(QVirtioDevice *d, uint64_t addr; QVirtQueuePCI *vqpci; - vqpci = g_malloc0(sizeof(*vqpci)); + vqpci = g_new0(QVirtQueuePCI, 1); feat = qvirtio_pci_get_guest_features(d); qvirtio_pci_queue_select(d, index); From patchwork Fri Oct 6 23:50:04 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 822840 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="Qoj5+J6U"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3y875Q2JVxz9t5Y for ; Sat, 7 Oct 2017 11:42:50 +1100 (AEDT) Received: from localhost ([::1]:47822 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e0dCa-00025V-De for incoming@patchwork.ozlabs.org; Fri, 06 Oct 2017 20:42:48 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43283) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e0cRx-0001oW-NH for qemu-devel@nongnu.org; Fri, 06 Oct 2017 19:54:40 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e0cRw-0007Zp-Tw for qemu-devel@nongnu.org; Fri, 06 Oct 2017 19:54:37 -0400 Received: from mail-qk0-x242.google.com ([2607:f8b0:400d:c09::242]:38001) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1e0cRw-0007Za-PN; Fri, 06 Oct 2017 19:54:36 -0400 Received: by mail-qk0-x242.google.com with SMTP id 17so5920308qkq.5; Fri, 06 Oct 2017 16:54:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=dCfaAM0acezQcI245LE9dyOnJRkUYyTmmnx7CBUHFn4=; b=Qoj5+J6UTuLI0+8RuovsBUUXLUr2IdmpcUxmec8/93303cy7ElVHIDpbnCDBkJ8R8o ICktrD8Wv8XI71OiQMhYDlAyca1z3eXtV2lle4IwiFud8GI+iobNpsfYsk88G9gSgbL3 4to9l4R6/ynYbEj7DzFuyTYYfHSYjlYmBkQ4KPoPZ3ud/3RgjRT8xeSd0zPeWUi3ZUsJ yah9kKGUSI0R7ipFXbuh4MPmPN8mXZAWlikN6r19vnMUKrTyoC5uZovgPzcehROBeSZx SZoJCgOqLOJRsUAAfUVoD0Gwg3bGmnMXr0cd3yN/dlKZzNhYxEI0CTpf7SZlJf/xNGHM 7Utg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=dCfaAM0acezQcI245LE9dyOnJRkUYyTmmnx7CBUHFn4=; b=C6kZkzBMZ8krwRoTUOUps7PkmY6SKvCagxwA2MT1YOHDnzhOpdCxdK5aAjpsMAqT6P 3evZubyFibm2Otytg1kfs/hm4LxHCEiil9maPt0SPblf4OF27WfT7KeY/nJIUgpaE9VA Z0UF8010CFoOMP/xoHsn0Esi+ytFAX4XSzrCZln62ty1grWnJFoChe11gTpDx0gQDpmN FICLkTIQbCJkqK4Yhfk0d4K8wftrJs9WhEihk0u/JzkHNJmqeUblHU3WMIBXmOjPJBDJ tbjM8M2VsO0WoUJgNgO6QpEmjqqigvrM+nT5/j5nXqLc0x7GSxnw9V/QqiuTLVpd57cM 94Og== X-Gm-Message-State: AMCzsaWxen/rvS8MAMz/vfzfLmeMyC8shpl+/23qrED1uVNfTBfqOWaT E2WAcJw9NkJ3OssEYn/ltrI= X-Google-Smtp-Source: AOwi7QAKk1nDbEZ9seTW+X+SFPi2oV6PaiEUQmIMavD3sesqObhx3/nGytS8iNg7IDo10wf3sm1aig== X-Received: by 10.55.91.199 with SMTP id p190mr677630qkb.291.1507334076194; Fri, 06 Oct 2017 16:54:36 -0700 (PDT) Received: from yoga.lan ([181.93.89.178]) by smtp.gmail.com with ESMTPSA id g1sm1705226qta.95.2017.10.06.16.54.33 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 06 Oct 2017 16:54:35 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Markus Armbruster , Eric Blake , "Aneesh Kumar K.V" , Greg Kurz Date: Fri, 6 Oct 2017 20:50:04 -0300 Message-Id: <20171006235023.11952-70-f4bug@amsat.org> X-Mailer: git-send-email 2.14.2 In-Reply-To: <20171006235023.11952-1-f4bug@amsat.org> References: <20171006235023.11952-1-f4bug@amsat.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c09::242 Subject: [Qemu-devel] [PATCH 69/88] virtio-9p: use g_new() family of functions X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , qemu trival , qemu-devel@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Marc-André Lureau Signed-off-by: Marc-André Lureau Signed-off-by: Philippe Mathieu-Daudé [PMD: added 2 more uses in hw/9pfs/9p-synth.c] Acked-by: Greg Kurz --- hw/9pfs/9p-handle.c | 2 +- hw/9pfs/9p-proxy.c | 2 +- hw/9pfs/9p-synth.c | 8 ++++---- hw/9pfs/9p.c | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/hw/9pfs/9p-handle.c b/hw/9pfs/9p-handle.c index 9875f1894c..357ced3079 100644 --- a/hw/9pfs/9p-handle.c +++ b/hw/9pfs/9p-handle.c @@ -609,7 +609,7 @@ static int handle_init(FsContext *ctx) int ret, mnt_id; struct statfs stbuf; struct file_handle fh; - struct handle_data *data = g_malloc(sizeof(struct handle_data)); + struct handle_data *data = g_new(struct handle_data, 1); data->mountfd = open(ctx->fs_root, O_DIRECTORY); if (data->mountfd < 0) { diff --git a/hw/9pfs/9p-proxy.c b/hw/9pfs/9p-proxy.c index 28b20a7c3d..2de303d713 100644 --- a/hw/9pfs/9p-proxy.c +++ b/hw/9pfs/9p-proxy.c @@ -1136,7 +1136,7 @@ static int proxy_parse_opts(QemuOpts *opts, struct FsDriverEntry *fs) static int proxy_init(FsContext *ctx) { - V9fsProxy *proxy = g_malloc(sizeof(V9fsProxy)); + V9fsProxy *proxy = g_new(V9fsProxy, 1); int sock_id; if (ctx->export_flags & V9FS_PROXY_SOCK_NAME) { diff --git a/hw/9pfs/9p-synth.c b/hw/9pfs/9p-synth.c index df0a8de08a..3aa69cf465 100644 --- a/hw/9pfs/9p-synth.c +++ b/hw/9pfs/9p-synth.c @@ -43,7 +43,7 @@ static V9fsSynthNode *v9fs_add_dir_node(V9fsSynthNode *parent, int mode, /* Add directory type and remove write bits */ mode = ((mode & 0777) | S_IFDIR) & ~(S_IWUSR | S_IWGRP | S_IWOTH); - node = g_malloc0(sizeof(V9fsSynthNode)); + node = g_new0(V9fsSynthNode, 1); if (attr) { /* We are adding .. or . entries */ node->attr = attr; @@ -124,7 +124,7 @@ int qemu_v9fs_synth_add_file(V9fsSynthNode *parent, int mode, } /* Add file type and remove write bits */ mode = ((mode & 0777) | S_IFREG); - node = g_malloc0(sizeof(V9fsSynthNode)); + node = g_new0(V9fsSynthNode, 1); node->attr = &node->actual_attr; node->attr->inode = synth_node_count++; node->attr->nlink = 1; @@ -180,7 +180,7 @@ static int synth_opendir(FsContext *ctx, V9fsSynthOpenState *synth_open; V9fsSynthNode *node = *(V9fsSynthNode **)fs_path->data; - synth_open = g_malloc(sizeof(*synth_open)); + synth_open = g_new(V9fsSynthOpenState, 1); synth_open->node = node; node->open_count++; fs->private = synth_open; @@ -264,7 +264,7 @@ static int synth_open(FsContext *ctx, V9fsPath *fs_path, V9fsSynthOpenState *synth_open; V9fsSynthNode *node = *(V9fsSynthNode **)fs_path->data; - synth_open = g_malloc(sizeof(*synth_open)); + synth_open = g_new(V9fsSynthOpenState, 1); synth_open->node = node; node->open_count++; fs->private = synth_open; diff --git a/hw/9pfs/9p.c b/hw/9pfs/9p.c index 23ac7bb532..510867b4dc 100644 --- a/hw/9pfs/9p.c +++ b/hw/9pfs/9p.c @@ -298,7 +298,7 @@ static V9fsFidState *alloc_fid(V9fsState *s, int32_t fid) return NULL; } } - f = g_malloc0(sizeof(V9fsFidState)); + f = g_new0(V9fsFidState, 1); f->fid = fid; f->fid_type = P9_FID_NONE; f->ref = 1; From patchwork Fri Oct 6 23:50:05 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 822831 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="Ou2JdHKO"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3y86yZ68QTz9t3m for ; Sat, 7 Oct 2017 11:36:54 +1100 (AEDT) Received: from localhost ([::1]:47792 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e0d6q-0004bG-SB for incoming@patchwork.ozlabs.org; Fri, 06 Oct 2017 20:36:52 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43355) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e0cS3-0001wZ-Er for qemu-devel@nongnu.org; Fri, 06 Oct 2017 19:54:44 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e0cS1-0007f3-V9 for qemu-devel@nongnu.org; Fri, 06 Oct 2017 19:54:43 -0400 Received: from mail-qk0-x242.google.com ([2607:f8b0:400d:c09::242]:38002) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1e0cS1-0007eV-PX; Fri, 06 Oct 2017 19:54:41 -0400 Received: by mail-qk0-x242.google.com with SMTP id 17so5920385qkq.5; Fri, 06 Oct 2017 16:54:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=zbrNxpd/pIWhJ0CPFZVJdm4d3wIqGdRGFMKeWZzx0to=; b=Ou2JdHKOJBnA8633GZVvH8pLqrhoqBQHUhO75J3jLlqZ+TKItD/xvUT6mHQHbSkW+C G4uMXv13R7wAjXZF3TjeD1fgyxVnbfy8qSlUQPZiRGxMlj0MwsomA/SqRrHk4qOisQ7m oP3h1ISdA4S8ianshqGWGVNjQHyQpBQY4SZ8WvtV3PzwEWJW8I2V7eSydub8mqIAxgpf NEOfERktmAZCZ4eYQCjc62xdExI8t7/El6vbQExRrFqKFPsIM3+N2MmGt4wcGVxpgpq/ lMKNjhZwwjplo7rg0nUxJrt/3U+9aiw2D6wxre/zuhOrgKXgwjLcMOvk1IdkPxHCeqW3 Fmxg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=zbrNxpd/pIWhJ0CPFZVJdm4d3wIqGdRGFMKeWZzx0to=; b=rOvLxC+DncBljHCCcb38GAel9K1aTKywx3dBGl2fAHkfYalCeX4iRBcNNn2gFKN/B0 0c9Kaa9Tn37uyeh/F3uDbUNw4FjWcsTCYEBk4tDC+MhMg4eUS07N9UvaLrp1AUyAR7AN A32vB63H2M86CJNiuxgC9418nWPwpTE/K/ywEZTg1/nSn3b1DzdBq0R7CsVqsGxiFIY1 g6Dad0OtNz6xtCkqc+sVjoVa1gNvLHDoe7b+T784PbjNt2WZwQRHEr9I9L2p7MpvpGD1 gdlVdoZARWCLlxZg8k8cy5jEZ0RIl/77CNzPOaiZOUu8wDRTx9ayKKsYUwC684l43g6D 8FQg== X-Gm-Message-State: AMCzsaXiCmaueSNz+wwqVwpawT8aenGAu2CIKGbaL2x6gYhj8SvfoYtz qtFymdM5G75aZXYT4cLzT5g= X-Google-Smtp-Source: AOwi7QAjaN3vp7Tm/FwKstrFELZvZ/tbvFp0iWkeQyifTpxkLFE3fPeNY9h1srPYty1RAVSqRMeYlQ== X-Received: by 10.55.6.149 with SMTP id 143mr674880qkg.231.1507334081136; Fri, 06 Oct 2017 16:54:41 -0700 (PDT) Received: from yoga.lan ([181.93.89.178]) by smtp.gmail.com with ESMTPSA id g1sm1705226qta.95.2017.10.06.16.54.36 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 06 Oct 2017 16:54:40 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Markus Armbruster , Eric Blake , Jeff Cody , Kevin Wolf , Max Reitz Date: Fri, 6 Oct 2017 20:50:05 -0300 Message-Id: <20171006235023.11952-71-f4bug@amsat.org> X-Mailer: git-send-email 2.14.2 In-Reply-To: <20171006235023.11952-1-f4bug@amsat.org> References: <20171006235023.11952-1-f4bug@amsat.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c09::242 Subject: [Qemu-devel] [PATCH 70/88] block: use g_new() family of functions X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu trival , =?utf-8?q?Marc-Andr=C3=A9_Lurea?= =?utf-8?q?u?= , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , qemu-block@nongnu.org, qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Philippe Mathieu-Daudé --- block/backup.c | 2 +- block/blkdebug.c | 4 ++-- block/commit.c | 2 +- block/linux-aio.c | 2 +- block/mirror.c | 2 +- block/qapi.c | 4 ++-- block/qcow2-refcount.c | 12 +++++------- block/qed-l2-cache.c | 2 +- block/sheepdog.c | 2 +- block/stream.c | 2 +- block/vhdx.c | 2 +- block/win32-aio.c | 2 +- 12 files changed, 18 insertions(+), 20 deletions(-) diff --git a/block/backup.c b/block/backup.c index 06ddbfd03d..cd73e7d905 100644 --- a/block/backup.c +++ b/block/backup.c @@ -514,7 +514,7 @@ static void coroutine_fn backup_run(void *opaque) qemu_co_rwlock_unlock(&job->flush_rwlock); g_free(job->done_bitmap); - data = g_malloc(sizeof(*data)); + data = g_new(BackupCompleteData, 1); data->ret = ret; block_job_defer_to_main_loop(&job->common, backup_complete, data); } diff --git a/block/blkdebug.c b/block/blkdebug.c index 46e53f2f09..4d05bcb1d9 100644 --- a/block/blkdebug.c +++ b/block/blkdebug.c @@ -175,7 +175,7 @@ static int add_rule(void *opaque, QemuOpts *opts, Error **errp) } /* Set attributes common for all actions */ - rule = g_malloc0(sizeof(*rule)); + rule = g_new(struct BlkdebugRule, 1); *rule = (struct BlkdebugRule) { .event = event, .action = d->action, @@ -727,7 +727,7 @@ static int blkdebug_debug_breakpoint(BlockDriverState *bs, const char *event, return -ENOENT; } - rule = g_malloc(sizeof(*rule)); + rule = g_new(struct BlkdebugRule, 1); *rule = (struct BlkdebugRule) { .event = blkdebug_event, .action = ACTION_SUSPEND, diff --git a/block/commit.c b/block/commit.c index 5036eec434..e698311d5f 100644 --- a/block/commit.c +++ b/block/commit.c @@ -210,7 +210,7 @@ static void coroutine_fn commit_run(void *opaque) out: qemu_vfree(buf); - data = g_malloc(sizeof(*data)); + data = g_new(CommitCompleteData, 1); data->ret = ret; block_job_defer_to_main_loop(&s->common, commit_complete, data); } diff --git a/block/linux-aio.c b/block/linux-aio.c index 88b8d55ec7..e5a9d7fdeb 100644 --- a/block/linux-aio.c +++ b/block/linux-aio.c @@ -474,7 +474,7 @@ LinuxAioState *laio_init(void) { LinuxAioState *s; - s = g_malloc0(sizeof(*s)); + s = g_new0(LinuxAioState, 1); if (event_notifier_init(&s->e, false) < 0) { goto out_free_state; } diff --git a/block/mirror.c b/block/mirror.c index 153758ca9f..948e5321a7 100644 --- a/block/mirror.c +++ b/block/mirror.c @@ -904,7 +904,7 @@ immediate_exit: g_free(s->in_flight_bitmap); bdrv_dirty_iter_free(s->dbi); - data = g_malloc(sizeof(*data)); + data = g_new(MirrorExitData, 1); data->ret = ret; if (need_drain) { diff --git a/block/qapi.c b/block/qapi.c index 7fa2437923..808246bfc4 100644 --- a/block/qapi.c +++ b/block/qapi.c @@ -455,7 +455,7 @@ static BlockStats *bdrv_query_bds_stats(BlockDriverState *bs, { BlockStats *s = NULL; - s = g_malloc0(sizeof(*s)); + s = g_new0(BlockStats, 1); s->stats = g_malloc0(sizeof(*s->stats)); if (!bs) { @@ -503,7 +503,7 @@ BlockInfoList *qmp_query_block(Error **errp) continue; } - info = g_malloc0(sizeof(*info)); + info = g_new0(BlockInfoList, 1); bdrv_query_info(blk, &info->value, &local_err); if (local_err) { error_propagate(errp, local_err); diff --git a/block/qcow2-refcount.c b/block/qcow2-refcount.c index aa3fd6cf17..dd2387d2bb 100644 --- a/block/qcow2-refcount.c +++ b/block/qcow2-refcount.c @@ -755,7 +755,7 @@ static void update_refcount_discard(BlockDriverState *bs, } } - d = g_malloc(sizeof(*d)); + d = g_new(Qcow2DiscardRegion, 1); *d = (Qcow2DiscardRegion) { .bs = bs, .offset = offset, @@ -2189,9 +2189,8 @@ write_refblocks: reftable_size = ROUND_UP((refblock_index + 1) * sizeof(uint64_t), s->cluster_size) / sizeof(uint64_t); - new_on_disk_reftable = g_try_realloc(on_disk_reftable, - reftable_size * - sizeof(uint64_t)); + new_on_disk_reftable = g_try_renew(uint64_t, on_disk_reftable, + reftable_size); if (!new_on_disk_reftable) { res->check_errors++; ret = -ENOMEM; @@ -2656,8 +2655,7 @@ static int alloc_refblock(BlockDriverState *bs, uint64_t **reftable, return -ENOTSUP; } - new_reftable = g_try_realloc(*reftable, new_reftable_size * - sizeof(uint64_t)); + new_reftable = g_try_renew(uint64_t, *reftable, new_reftable_size); if (!new_reftable) { error_setg(errp, "Failed to increase reftable buffer size"); return -ENOMEM; @@ -3119,7 +3117,7 @@ int qcow2_shrink_reftable(BlockDriverState *bs) { BDRVQcow2State *s = bs->opaque; uint64_t *reftable_tmp = - g_malloc(s->refcount_table_size * sizeof(uint64_t)); + g_new(uint64_t, s->refcount_table_size); int i, ret; for (i = 0; i < s->refcount_table_size; i++) { diff --git a/block/qed-l2-cache.c b/block/qed-l2-cache.c index b548362398..48689a6650 100644 --- a/block/qed-l2-cache.c +++ b/block/qed-l2-cache.c @@ -90,7 +90,7 @@ CachedL2Table *qed_alloc_l2_cache_entry(L2TableCache *l2_cache) { CachedL2Table *entry; - entry = g_malloc0(sizeof(*entry)); + entry = g_new0(CachedL2Table, 1); entry->ref++; trace_qed_alloc_l2_cache_entry(l2_cache, entry); diff --git a/block/sheepdog.c b/block/sheepdog.c index 696a71442a..1f67ed43ca 100644 --- a/block/sheepdog.c +++ b/block/sheepdog.c @@ -467,7 +467,7 @@ static inline AIOReq *alloc_aio_req(BDRVSheepdogState *s, SheepdogAIOCB *acb, { AIOReq *aio_req; - aio_req = g_malloc(sizeof(*aio_req)); + aio_req = g_new(AIOReq, 1); aio_req->aiocb = acb; aio_req->iov_offset = iov_offset; aio_req->oid = oid; diff --git a/block/stream.c b/block/stream.c index e6f72346e5..2b4c67de41 100644 --- a/block/stream.c +++ b/block/stream.c @@ -202,7 +202,7 @@ static void coroutine_fn stream_run(void *opaque) out: /* Modify backing chain and close BDSes in main loop */ - data = g_malloc(sizeof(*data)); + data = g_new(StreamCompleteData, 1); data->ret = ret; block_job_defer_to_main_loop(&s->common, stream_complete, data); } diff --git a/block/vhdx.c b/block/vhdx.c index 7ae4589879..8260fb46cd 100644 --- a/block/vhdx.c +++ b/block/vhdx.c @@ -244,7 +244,7 @@ static void vhdx_region_register(BDRVVHDXState *s, { VHDXRegionEntry *r; - r = g_malloc0(sizeof(*r)); + r = g_new0(VHDXRegionEntry, 1); r->start = start; r->end = start + length; diff --git a/block/win32-aio.c b/block/win32-aio.c index 3be8f458fa..dfa062562f 100644 --- a/block/win32-aio.c +++ b/block/win32-aio.c @@ -190,7 +190,7 @@ QEMUWin32AIOState *win32_aio_init(void) { QEMUWin32AIOState *s; - s = g_malloc0(sizeof(*s)); + s = g_new0(QEMUWin32AIOState, 1); if (event_notifier_init(&s->e, false) < 0) { goto out_free_state; } From patchwork Fri Oct 6 23:50:06 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 822846 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="N0I8MhVx"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3y87982ZP0z9t5C for ; Sat, 7 Oct 2017 11:46:04 +1100 (AEDT) Received: from localhost ([::1]:47851 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e0dFi-00050j-Ai for incoming@patchwork.ozlabs.org; Fri, 06 Oct 2017 20:46:02 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43390) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e0cS6-00020o-GH for qemu-devel@nongnu.org; Fri, 06 Oct 2017 19:54:51 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e0cS5-0007he-P0 for qemu-devel@nongnu.org; Fri, 06 Oct 2017 19:54:46 -0400 Received: from mail-qt0-x242.google.com ([2607:f8b0:400d:c0d::242]:52774) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1e0cS5-0007hU-KW; Fri, 06 Oct 2017 19:54:45 -0400 Received: by mail-qt0-x242.google.com with SMTP id o52so34329318qtc.9; Fri, 06 Oct 2017 16:54:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=gs1hp8s1gqzQW6gjNwbpFvPx+RGl0n1rIJqAJMqnj3Q=; b=N0I8MhVxgemTbAOOQMzDkRTuFWJefUZqY30MaNuCvjlOlou3hLBooswvo0jEIINm7M 99c0Z2QKT7EK7pyS3jxOd+2u7qMuNTHb8swcxwEY5fHR0YCE4WoK2MdmVqMt7QCnyVc5 YMq9Y3dhuE8y8JSLM9+ELwOJGZEN9jmKumMegpW0LrbY52jNO4VvGBCqFgquwa1TmYQb /Q98tO4712ZCtW6LDgml2+aBR3sPGJsvv6uM2LA8NrYAYqyBsaekgXq7f/YCiQF8/Rog R4ZzsQs/2Tmj+Zx028EgZE+DSs8MRSdn68nVV2Frb+CD1pqkHT1vDLbMc4474IWYfqM2 kU/g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=gs1hp8s1gqzQW6gjNwbpFvPx+RGl0n1rIJqAJMqnj3Q=; b=HZA1SFogPIYpyEDcrh6kRVg2V8gDkIyChyBKLL7i/fUU0h/oox1W7wZsYEru5Bcm++ AHK19/mbdN2sLvlvyaxZ29kUJzp+WG8oyoUmtiOmQtuQqbhoTXKWIPQAPM3qGA4U9EBZ BLDIWP636xxQxRV6HHLTf99Sq40807Ypd04cdJHABxtgMB6K4rNWHwYenkqyFsKNQ4BM cuLVlPOHLsJxURSYNIJxP3eYSgrLSMlk5xRbXfvUKXhWVgcQKgrdT+N6229UOqCro1WA J5gughun8PfnkNethuZ1+n56aadE5DAX88xW2WTqxwfvDUP7y/sEew6ncsY+dcwNEMBF Mr5Q== X-Gm-Message-State: AMCzsaVrUKD7ubbfqLEIOtdjWACMv3TVvBkkAui1IdL03hwonSFAuGL6 ZIcIz+7tfPhwemMDXgPBC2E= X-Google-Smtp-Source: AOwi7QD61hxWpokzFtk394fZxjJocBNS8jx4jSP2rqHhwKsROuClu20QvXkl2AmWphmCFk/0CSFczQ== X-Received: by 10.237.36.145 with SMTP id t17mr5210353qtc.162.1507334085064; Fri, 06 Oct 2017 16:54:45 -0700 (PDT) Received: from yoga.lan ([181.93.89.178]) by smtp.gmail.com with ESMTPSA id g1sm1705226qta.95.2017.10.06.16.54.41 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 06 Oct 2017 16:54:44 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Markus Armbruster , Eric Blake , Jeff Cody , Kevin Wolf , Max Reitz Date: Fri, 6 Oct 2017 20:50:06 -0300 Message-Id: <20171006235023.11952-72-f4bug@amsat.org> X-Mailer: git-send-email 2.14.2 In-Reply-To: <20171006235023.11952-1-f4bug@amsat.org> References: <20171006235023.11952-1-f4bug@amsat.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c0d::242 Subject: [Qemu-devel] [PATCH 71/88] block: avoid use of g_new0() X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu trival , =?utf-8?q?Marc-Andr=C3=A9_Lurea?= =?utf-8?q?u?= , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , qemu-block@nongnu.org, qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Philippe Mathieu-Daudé --- block/qcow2.c | 2 +- block/vhdx.c | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/block/qcow2.c b/block/qcow2.c index f63d1831f8..3e7d6c81be 100644 --- a/block/qcow2.c +++ b/block/qcow2.c @@ -2738,7 +2738,7 @@ static int qcow2_create2(const char *filename, int64_t total_size, /* Write the header */ QEMU_BUILD_BUG_ON((1 << MIN_CLUSTER_BITS) < sizeof(*header)); - header = g_malloc0(cluster_size); + header = g_malloc(cluster_size); *header = (QCowHeader) { .magic = cpu_to_be32(QCOW_MAGIC), .version = cpu_to_be32(version), diff --git a/block/vhdx.c b/block/vhdx.c index 8260fb46cd..91e532df8a 100644 --- a/block/vhdx.c +++ b/block/vhdx.c @@ -244,10 +244,11 @@ static void vhdx_region_register(BDRVVHDXState *s, { VHDXRegionEntry *r; - r = g_new0(VHDXRegionEntry, 1); - - r->start = start; - r->end = start + length; + r = g_new(VHDXRegionEntry, 1); + *r = (VHDXRegionEntry) { + .start = start, + .end = start + length, + }; QLIST_INSERT_HEAD(&s->regions, r, entries); } From patchwork Fri Oct 6 23:50:07 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 822835 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="Tmb8ujB1"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3y871X3YMFz9t4X for ; Sat, 7 Oct 2017 11:39:28 +1100 (AEDT) Received: from localhost ([::1]:47802 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e0d9K-0007Kn-H2 for incoming@patchwork.ozlabs.org; Fri, 06 Oct 2017 20:39:26 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43442) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e0cSA-00023S-0j for qemu-devel@nongnu.org; Fri, 06 Oct 2017 19:54:51 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e0cS9-0007lv-Ch for qemu-devel@nongnu.org; Fri, 06 Oct 2017 19:54:50 -0400 Received: from mail-qt0-x244.google.com ([2607:f8b0:400d:c0d::244]:45336) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1e0cS9-0007lV-8L; Fri, 06 Oct 2017 19:54:49 -0400 Received: by mail-qt0-x244.google.com with SMTP id k1so23357071qti.2; Fri, 06 Oct 2017 16:54:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=0SlLnLJcX/VNhTn/Pv3q2kxSYf9mux0RFGXK0zBZWdQ=; b=Tmb8ujB10YBqr/RXE8wmggLeSAfCmR/GV9GnGJUzvz76PbYw5VlGzG9/Zuj6ywd3Hv BROdJ67ISn4ZYFFXAJGiuZnEluABZie6Ua+avmNd9aYQ+02oPc4ebFSrn8sLSkRsBTVL r0sOkq/W+QfVSE9f3dPl4xxOin3Kfb+GfCL+n09H9H7nGjVOZ3mz8jwGhvDQwZW9KBxO FyKk7mhIn2WCcpaReJmJxEY82fHqaLwspzitR55Ps6FxTHB8XtNk53ko+zDAfIyjNfiB SpxQamnK4WAJ3pwIv4Ge+GomyLBbMyxfbZJ44Wlv8EOae3PLfRiQ/+LqQ4ZCBrVYJkSu 7WaQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=0SlLnLJcX/VNhTn/Pv3q2kxSYf9mux0RFGXK0zBZWdQ=; b=pmHFfQEZG+NG0kofPzhML1IIjJVrfeCwAibtsuokpvoPJ835bbuFilp71f+GIfSLv6 DiLq5P4Gi3b7iJ5l4cioO3fQHT41HzTSUAgtgfwvPUdkjBy3eN0F0lWNk/N2tOyHkrBV /avOxY/KSH8LJq3+SoXTcU15H21+EU+7rUwRTI9wpymEHim5HVtF9PpRmD+y/y/RJnVo JAEedYcba8fCnH0ah0tJWkB423RTzANnyoyk5wCgnvR498WRfvmh+hjFlWxMy8ZY/DyL uuatomSw79qRETVFmm/8d5cr3EdZmoHM5CJ+XrCkgH+1UB0NL22aYEX73JVnB7MNJfO7 XtBA== X-Gm-Message-State: AMCzsaWqTPZ+D88XF11XkDisGf6eFSMKlpqq7EQUlhpfaH+0syh2dyMJ 4mXGhRhV79dRKz3uN1XHwbQ= X-Google-Smtp-Source: AOwi7QCMY3BkpVqvaSK1RjfDhhCAvr3Zrtbv3DNwjzMAsbquAXcBuKI2ND8GRyHCrA9c6fe5JTLC3Q== X-Received: by 10.237.34.118 with SMTP id o51mr5156020qtc.36.1507334088700; Fri, 06 Oct 2017 16:54:48 -0700 (PDT) Received: from yoga.lan ([181.93.89.178]) by smtp.gmail.com with ESMTPSA id g1sm1705226qta.95.2017.10.06.16.54.45 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 06 Oct 2017 16:54:48 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Markus Armbruster , Eric Blake , Jeff Cody , Kevin Wolf , Max Reitz Date: Fri, 6 Oct 2017 20:50:07 -0300 Message-Id: <20171006235023.11952-73-f4bug@amsat.org> X-Mailer: git-send-email 2.14.2 In-Reply-To: <20171006235023.11952-1-f4bug@amsat.org> References: <20171006235023.11952-1-f4bug@amsat.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c0d::244 Subject: [Qemu-devel] [PATCH 72/88] hw/block/nvme: use g_new() family of functions X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu trival , =?utf-8?q?Marc-Andr=C3=A9_Lurea?= =?utf-8?q?u?= , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , qemu-block@nongnu.org, qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Philippe Mathieu-Daudé --- hw/block/nvme.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/block/nvme.c b/hw/block/nvme.c index 9aa32692a3..ff712fa8cc 100644 --- a/hw/block/nvme.c +++ b/hw/block/nvme.c @@ -454,7 +454,7 @@ static uint16_t nvme_create_sq(NvmeCtrl *n, NvmeCmd *cmd) if (!(NVME_SQ_FLAGS_PC(qflags))) { return NVME_INVALID_FIELD | NVME_DNR; } - sq = g_malloc0(sizeof(*sq)); + sq = g_new0(NvmeSQueue, 1); nvme_init_sq(sq, n, prp1, sqid, cqid, qsize + 1); return NVME_SUCCESS; } @@ -532,7 +532,7 @@ static uint16_t nvme_create_cq(NvmeCtrl *n, NvmeCmd *cmd) return NVME_INVALID_FIELD | NVME_DNR; } - cq = g_malloc0(sizeof(*cq)); + cq = g_new0(NvmeCQueue, 1); nvme_init_cq(cq, n, prp1, cqid, vector, qsize + 1, NVME_CQ_FLAGS_IEN(qflags)); return NVME_SUCCESS; From patchwork Fri Oct 6 23:50:08 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 822854 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="Z2R2VpTL"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3y87DG6mHbz9t4X for ; Sat, 7 Oct 2017 11:48:45 +1100 (AEDT) Received: from localhost ([::1]:47866 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e0dIJ-0007Kj-DX for incoming@patchwork.ozlabs.org; Fri, 06 Oct 2017 20:48:43 -0400 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 Received: from mail-qt0-x241.google.com ([2607:f8b0:400d:c0d::241]:48156) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1e0cSD-0007qI-Bi; Fri, 06 Oct 2017 19:54:53 -0400 Received: by mail-qt0-x241.google.com with SMTP id d13so33663634qta.5; Fri, 06 Oct 2017 16:54:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=k2Vi1Bv+CSnDlN/GqBVXgQT24hAmoOQo6hWaGCQbWSg=; b=Z2R2VpTLQQR4vQma8rLCVSMqzIsI3f9ghDqoSZ3+1zP5H3cCtGGlCN5cJ89EJXIfgT PxWn9rZ4RSkjwyTz4i7gagqUYNV0aVFcpLWvmGtlajQLI3vOTqJbIfS6+Ri0M+2Z/W/C HoB4G1RiLHYbrqfM51QPmHpjdfTc5dhF7/KzM2en8caSXwWuQ8yNpSztja9D95cS59+4 QjGkWrHQyGJZsRr/kgbj4vp4xl31lIVRTHlpXFFhcW54UkH19hVl2P0E0qd8Y2jA78IG mGpSX7568nidmdKbZmzhb34e6Ju7iG711yQOk2fX5MCoU0sBDRokm8pckeP8tmlTCOL8 Gm8A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=k2Vi1Bv+CSnDlN/GqBVXgQT24hAmoOQo6hWaGCQbWSg=; b=TMZ8IERjt8KBHK9G+jM1mI+JeOhzqOrL1W/dfXt7GVJ8l0iqiuBLZ/YIm1cWbY5PwX Uxb9QQ8aayoXB2jpTmSiwpb9jftijkmEc1x2O8lD6WyP5n1DfjXp8o4pfDs9P8Cbufss uoJyjguFCSJ4/NZJgK9sx/jKS3p4SJCc7+Z0XOMQewg/+LrtfbEM0ImlFTSn1/rpkVrX VSc4LwO/q9qb6P6L5lW5XkQfXq7NURn403l7vEEyae03QRAIKU2XOgIkacHA17ZzUjF1 qSF4Ns/h14L/Oyj8yxuqWxxWWbHMh63v64tYEfwJ+0bfJ45YXG8+4cur+4T5dL6WPEyY ac2Q== X-Gm-Message-State: AMCzsaXFHJZUcRudyJCxPOSbkZhM8pRbCGQJAuOlKK2nhXIW0oZUZMoR Jzi9xKKHhDxwe/gBXUrhq3s= X-Google-Smtp-Source: AOwi7QBg2rh6AWlX8NBOKIwboSyFpaIm9jTe7ZXke+7eecUEoqHGdte7EGD/iW51XCxlMVpaypat6A== X-Received: by 10.200.8.109 with SMTP id x42mr5782429qth.54.1507334092820; Fri, 06 Oct 2017 16:54:52 -0700 (PDT) Received: from yoga.lan ([181.93.89.178]) by smtp.gmail.com with ESMTPSA id g1sm1705226qta.95.2017.10.06.16.54.48 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 06 Oct 2017 16:54:52 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Markus Armbruster , Eric Blake , Jeff Cody , Kevin Wolf , Max Reitz , Jan Beulich Date: Fri, 6 Oct 2017 20:50:08 -0300 Message-Id: <20171006235023.11952-74-f4bug@amsat.org> X-Mailer: git-send-email 2.14.2 In-Reply-To: <20171006235023.11952-1-f4bug@amsat.org> References: <20171006235023.11952-1-f4bug@amsat.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c0d::241 Subject: [Qemu-devel] [PATCH 73/88] hw/block/xen_disk: avoid use of g_new0() X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-block@nongnu.org, qemu trival , qemu-devel@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Paul Durrant , Anthony Perard , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" 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; } From patchwork Fri Oct 6 23:50:09 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 822859 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="uI5HCHYx"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3y87GS5dcwz9sDB for ; Sat, 7 Oct 2017 11:50:40 +1100 (AEDT) Received: from localhost ([::1]:47877 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e0dKA-0000XH-P8 for incoming@patchwork.ozlabs.org; Fri, 06 Oct 2017 20:50:38 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43616) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e0cSI-0002BT-2k for qemu-devel@nongnu.org; Fri, 06 Oct 2017 19:54:58 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e0cSH-0007wt-2Y for qemu-devel@nongnu.org; Fri, 06 Oct 2017 19:54:58 -0400 Received: from mail-qt0-x244.google.com ([2607:f8b0:400d:c0d::244]:47289) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1e0cSG-0007wh-VF; Fri, 06 Oct 2017 19:54:57 -0400 Received: by mail-qt0-x244.google.com with SMTP id z50so29317584qtj.4; Fri, 06 Oct 2017 16:54:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=sF5UHJotnEoBCp34Be3hjw7Ud6Krvr/9RbpLjCV0RJI=; b=uI5HCHYx+XvD6/2seoYsJo2FeGRSUcc9GHCmAQFR/9cqEyHS4whG0h/Lo+3/Xfa6Zx y5Wb5imzjxhC/wpHoQ9sKhgGzWcQMjOOzmSUciJVo2Vkh7HSR+rlXNqgKhIsNEce/R0H Z4I0HUfayitR7AoPzKCsN+4Dyk5HMfFqdzHqtmaRG7u+51p5HYkDAP9qtu0tTx9e66Fa Ky3PzMgtgxnuIjQqtI3BRNPIorB6pQX02ObwRFrcb3+KkZ/Vv8kGnDYccgGEMzDsc/4r v0VKJIqpOaDSSqYl97u6sujKnPp1piAOlmgKN//wG4yf5nJHdjhM3IUx0NyXqiscIbeo dcPw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=sF5UHJotnEoBCp34Be3hjw7Ud6Krvr/9RbpLjCV0RJI=; b=gWvgPp16nx7kH/Rp7/Ll9/BQ7ZDEeToEj3HxBDYe24ePswwgNj0Gd2HHIr8S0PeCTI ftzpqfaSoAaNY6XPP6mPF1ZaGKdUjm7fG1RKRvJtrTzGG3nbAx01sgK2eo4+gBNK/bfe EEubZ/rt3Tcm4KH0I/COBZo0tdK+gsmGLhOKfrIVPTBGGO9BL49en2r0OKHLDEFey9+7 PLBhfQQ2ZVuDBr9OmqQLwwxrTvCsproyfNrUstxIccdRKBupLyqJZ6fizVJb9nYgpaDp F+06klDbhEFzndGMdWiWcO53hfHCdWtCfljcgct2leKD3HxgWzZc9qeZAGv8xcrQ6eCq muvQ== X-Gm-Message-State: AMCzsaV93GzduZYcho1ctZ9EaMqGWND17c1w9BdTGA1Nuv+g0U76F9/U 1yLb0C25Duwu4ntNDE9wX7Q= X-Google-Smtp-Source: AOwi7QDOeEnHWtuD8GRCF2DPpGJFnPXBJXrG2lzMsc6X58VKL4m+YO15nJxRxeS0XlUESnoWVIK5bg== X-Received: by 10.200.22.231 with SMTP id y36mr5546807qtk.31.1507334096461; Fri, 06 Oct 2017 16:54:56 -0700 (PDT) Received: from yoga.lan ([181.93.89.178]) by smtp.gmail.com with ESMTPSA id g1sm1705226qta.95.2017.10.06.16.54.53 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 06 Oct 2017 16:54:55 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Markus Armbruster , Eric Blake , Stefan Hajnoczi , "Daniel P. Berrange" Date: Fri, 6 Oct 2017 20:50:09 -0300 Message-Id: <20171006235023.11952-75-f4bug@amsat.org> X-Mailer: git-send-email 2.14.2 In-Reply-To: <20171006235023.11952-1-f4bug@amsat.org> References: <20171006235023.11952-1-f4bug@amsat.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c0d::244 Subject: [Qemu-devel] [PATCH 74/88] balloon: use g_new() family of functions X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , qemu trival , =?utf-8?q?Philippe_Mathieu-Dau?= =?utf-8?b?ZMOp?= , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Philippe Mathieu-Daudé --- balloon.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/balloon.c b/balloon.c index 1d720fff81..d77918fd37 100644 --- a/balloon.c +++ b/balloon.c @@ -97,7 +97,7 @@ BalloonInfo *qmp_query_balloon(Error **errp) return NULL; } - info = g_malloc0(sizeof(*info)); + info = g_new0(BalloonInfo, 1); balloon_stat_fn(balloon_opaque, info); return info; } From patchwork Fri Oct 6 23:50:10 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 822839 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="T+O7vVAW"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3y875C0Wmsz9t5C for ; Sat, 7 Oct 2017 11:42:39 +1100 (AEDT) Received: from localhost ([::1]:47821 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e0dCP-0001sI-3D for incoming@patchwork.ozlabs.org; Fri, 06 Oct 2017 20:42:37 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43670) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e0cSL-0002GO-Ax for qemu-devel@nongnu.org; Fri, 06 Oct 2017 19:55:02 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e0cSK-00081C-IQ for qemu-devel@nongnu.org; Fri, 06 Oct 2017 19:55:01 -0400 Received: from mail-qk0-x241.google.com ([2607:f8b0:400d:c09::241]:33116) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1e0cSK-00080T-Ew; Fri, 06 Oct 2017 19:55:00 -0400 Received: by mail-qk0-x241.google.com with SMTP id z12so9701918qkb.0; Fri, 06 Oct 2017 16:55:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=emUG2b4ULg5F7e9jN8IRLpYzrBPuTHK8wTyzKxPYH/8=; b=T+O7vVAWHcPzVVMID0+My53YVan82+I/GpVbRIHHcZ869VzdpATf8ezMCR/omFMoJu EB8HHxyLjwSYl+Ud/KthI8Ce9+1TGTV43FX5lcr4zsuS6xZYAnAcPW4fKl159oUFouWj KN/PRz1Wd7hEG0BXFrLaGvUehG5LKUUx+OpUHFQ/sbOi+RpgIcbK0pmLrEDMsUX5xkLu yHlZzL/CdErcSOH5UO6SIhEBCSOm+ZT/s303vbY0BzDcefSPfCAsD4TNs93XdbpK0jEv /pW6XOxpX79Y9GiE8P8a8Y+lqhdjv2PuX/5L7PQBnp/tE2KpUZR+IqP5/+iVRewmOZE0 Kgmw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=emUG2b4ULg5F7e9jN8IRLpYzrBPuTHK8wTyzKxPYH/8=; b=JyNLNuUK/VxTaAY1TnhQIUAaNMkZg8S/Q+plWtYvs4aRhwMh0w5RTLGMYPbjTHmCjM GdOJKiMRo99tkAvX7dGuExHhZNZU5tLXF2U0a6/JQHiNl3jNniWm/rDmPEBxyUvseDVM S96cIq/z/OYT7r05qw/luc65nwMcvqOtKrL+lT3Mwt1lz+0w3KUPtuVzdyWCGt/FEIEE ffgTsKlA7/88cPcTfDPJf8JHDVUkW13JDZY8MyKl8x5ZEuKzJ99TuT0+jbVJNMi6HFdn 63lV4IMra0uFnLMQL9Hg2WgXUDgdHLE+u4ZLkdddGoP4eZv+vXxoeVZfh9sGMTjRhner SqZg== X-Gm-Message-State: AMCzsaVPeEQn+N2teBFwdUzZi/e2w/TxBPgcEyRi6Nb+mksi7K/Lbw45 1s23agVUyItibndLJlPiY50= X-Google-Smtp-Source: AOwi7QDocsCzq3qA9ETQ6TWXAl/mZrRUwfhuelNn5KytXRayT3Y80dIEY/gFQCziLaaaUk05aOl03A== X-Received: by 10.55.140.68 with SMTP id o65mr731060qkd.293.1507334099847; Fri, 06 Oct 2017 16:54:59 -0700 (PDT) Received: from yoga.lan ([181.93.89.178]) by smtp.gmail.com with ESMTPSA id g1sm1705226qta.95.2017.10.06.16.54.56 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 06 Oct 2017 16:54:58 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Markus Armbruster , Eric Blake , Richard Henderson Date: Fri, 6 Oct 2017 20:50:10 -0300 Message-Id: <20171006235023.11952-76-f4bug@amsat.org> X-Mailer: git-send-email 2.14.2 In-Reply-To: <20171006235023.11952-1-f4bug@amsat.org> References: <20171006235023.11952-1-f4bug@amsat.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c09::241 Subject: [Qemu-devel] [PATCH 75/88] decnumber: use g_new() family of functions X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , qemu trival , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Marc-André Lureau Signed-off-by: Marc-André Lureau --- libdecnumber/decNumber.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/libdecnumber/decNumber.c b/libdecnumber/decNumber.c index 8c197023f4..2d13198730 100644 --- a/libdecnumber/decNumber.c +++ b/libdecnumber/decNumber.c @@ -4089,7 +4089,7 @@ static decNumber * decAddOp(decNumber *res, const decNumber *lhs, acc=accbuff; /* assume use local buffer */ if (need*sizeof(Unit)>sizeof(accbuff)) { /* printf("malloc add %ld %ld\n", need, sizeof(accbuff)); */ - allocacc=(Unit *)malloc(need*sizeof(Unit)); + allocacc=g_new(uint16_t, need); if (allocacc==NULL) { /* hopeless -- abandon */ *status|=DEC_Insufficient_storage; break;} @@ -4452,7 +4452,7 @@ static decNumber * decDivideOp(decNumber *res, acclength=D2U(reqdigits+DECDPUN); /* in Units */ if (acclength*sizeof(Unit)>sizeof(accbuff)) { /* printf("malloc dvacc %ld units\n", acclength); */ - allocacc=(Unit *)malloc(acclength*sizeof(Unit)); + allocacc=g_new(uint16_t, acclength); if (allocacc==NULL) { /* hopeless -- abandon */ *status|=DEC_Insufficient_storage; break;} @@ -4477,7 +4477,7 @@ static decNumber * decDivideOp(decNumber *res, if (!(op&DIVIDE)) var1units++; if ((var1units+1)*sizeof(Unit)>sizeof(varbuff)) { /* printf("malloc dvvar %ld units\n", var1units+1); */ - varalloc=(Unit *)malloc((var1units+1)*sizeof(Unit)); + varalloc=g_new(uint16_t, (var1units+1)); if (varalloc==NULL) { /* hopeless -- abandon */ *status|=DEC_Insufficient_storage; break;} @@ -6314,7 +6314,7 @@ static Int decUnitCompare(const Unit *a, Int alength, need+=2; acc=accbuff; /* assume use local buffer */ if (need*sizeof(Unit)>sizeof(accbuff)) { - allocacc=(Unit *)malloc(need*sizeof(Unit)); + allocacc=g_new(uint16_t, need); if (allocacc==NULL) return BADINT; /* hopeless -- abandon */ acc=allocacc; } From patchwork Fri Oct 6 23:50:11 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 822865 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="ddgwKw1C"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3y87K55Qfjz9t2m for ; Sat, 7 Oct 2017 11:52:57 +1100 (AEDT) Received: from localhost ([::1]:47899 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e0dMN-0002aG-S0 for incoming@patchwork.ozlabs.org; Fri, 06 Oct 2017 20:52:55 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43701) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e0cSO-0002Jw-Er for qemu-devel@nongnu.org; Fri, 06 Oct 2017 19:55:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e0cSN-00085j-Na for qemu-devel@nongnu.org; Fri, 06 Oct 2017 19:55:04 -0400 Received: from mail-qt0-x241.google.com ([2607:f8b0:400d:c0d::241]:52775) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1e0cSN-00084x-Je; Fri, 06 Oct 2017 19:55:03 -0400 Received: by mail-qt0-x241.google.com with SMTP id o52so34330014qtc.9; Fri, 06 Oct 2017 16:55:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=rR36fwBv7mScxAVZSpIrXHl8/e30rqjRXFK308/5Kd8=; b=ddgwKw1Cm5XMP/a13chBsQYTR9Y9t+yvvAqd65R+tZaTRyzLoWkhtmY/85gn5NAILN 6eSQJZWZRDqGwId4KTu/VxJKUhqS724YHgv97qBe/MXg9SjCKvk/lrfqw0gCLwcDn+MK AJbIkCNUQJdxOAUhilavgVDQad1ipsbbllLzUv14MNOQnIOr1U/OxOXBhCe0iN+THSKy LMj8P0PGOiQlp3oiQyripAw71U1YRGp3rjwQztmV5Xk10RSt2r4OW1B+FfNjfZqblsFZ 5YWFu4aJN46qHZUILYViozuQfeM+wr/lsz7tsHOn23syOSV6zAg3ZSg7stzEdb7u+flQ wNZw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=rR36fwBv7mScxAVZSpIrXHl8/e30rqjRXFK308/5Kd8=; b=G//QWC/Tm8Um3+5TDcmr9Po+Y53EQX68gDwNloqQF5a/LjVX6lHOdI11JUBLYTS6Tq R1rY47JhF5Eah6RGO6L6/ewxXLWl2N8x0wQNU4mYANDfjctyGNEEjJyuJO3zjeANibFh XPsW2iw53bttKQBz750TnZYSZ69O4bexJljXcPJhzg1yeC73JWCyA2cn8Pt0cALBrr6R DoLli5VDKN4RhVKBCklVHcgA8UafRjhedhf/FpvCjBPEoOq+WZfxs3imJ2tNaIgai8G6 EpDIC1ZT4Q4Ml2poPnfCGXdbG3vMZIm7LSWQcxopufMciF3/muRmzD+k/IN7GRinfWtd Vfsg== X-Gm-Message-State: AMCzsaU9NICRJJY1KvykUA1a5RSsEdLnwuRybis7D8Ji+2M+Qa3URT3w /P9YO/y0WCNOGIgT4r+UfPk= X-Google-Smtp-Source: AOwi7QCbwU3hNN7FEa0ntcxezQ7sS1QoBNLfSkVkRO3RH7TjN5WrYzWtUVRvt1I9RF7hvvs6/uu93A== X-Received: by 10.200.56.108 with SMTP id r41mr5071728qtb.143.1507334103062; Fri, 06 Oct 2017 16:55:03 -0700 (PDT) Received: from yoga.lan ([181.93.89.178]) by smtp.gmail.com with ESMTPSA id g1sm1705226qta.95.2017.10.06.16.55.00 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 06 Oct 2017 16:55:02 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Markus Armbruster , Eric Blake , Stefan Hajnoczi , "Edgar E. Iglesias" Date: Fri, 6 Oct 2017 20:50:11 -0300 Message-Id: <20171006235023.11952-77-f4bug@amsat.org> X-Mailer: git-send-email 2.14.2 In-Reply-To: <20171006235023.11952-1-f4bug@amsat.org> References: <20171006235023.11952-1-f4bug@amsat.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c0d::241 Subject: [Qemu-devel] [PATCH 76/88] dma: use g_new() family of functions X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , qemu trival , qemu-devel@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Marc-André Lureau Signed-off-by: Marc-André Lureau Signed-off-by: Philippe Mathieu-Daudé [PMD: added hw/dma/etraxfs_dma.c] --- dma-helpers.c | 4 ++-- hw/dma/etraxfs_dma.c | 2 +- hw/dma/rc4030.c | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/dma-helpers.c b/dma-helpers.c index 2d7e02d35e..e327fc21c4 100644 --- a/dma-helpers.c +++ b/dma-helpers.c @@ -40,7 +40,7 @@ int dma_memory_set(AddressSpace *as, dma_addr_t addr, uint8_t c, dma_addr_t len) void qemu_sglist_init(QEMUSGList *qsg, DeviceState *dev, int alloc_hint, AddressSpace *as) { - qsg->sg = g_malloc(alloc_hint * sizeof(ScatterGatherEntry)); + qsg->sg = g_new(ScatterGatherEntry, alloc_hint); qsg->nsg = 0; qsg->nalloc = alloc_hint; qsg->size = 0; @@ -53,7 +53,7 @@ void qemu_sglist_add(QEMUSGList *qsg, dma_addr_t base, dma_addr_t len) { if (qsg->nsg == qsg->nalloc) { qsg->nalloc = 2 * qsg->nalloc + 1; - qsg->sg = g_realloc(qsg->sg, qsg->nalloc * sizeof(ScatterGatherEntry)); + qsg->sg = g_renew(ScatterGatherEntry, qsg->sg, qsg->nalloc); } qsg->sg[qsg->nsg].base = base; qsg->sg[qsg->nsg].len = len; diff --git a/hw/dma/etraxfs_dma.c b/hw/dma/etraxfs_dma.c index d5650eb885..97951a2abe 100644 --- a/hw/dma/etraxfs_dma.c +++ b/hw/dma/etraxfs_dma.c @@ -768,7 +768,7 @@ void *etraxfs_dmac_init(hwaddr base, int nr_channels) { struct fs_dma_ctrl *ctrl = NULL; - ctrl = g_malloc0(sizeof *ctrl); + ctrl = g_new0(struct fs_dma_ctrl, 1); ctrl->bh = qemu_bh_new(DMA_run, ctrl); diff --git a/hw/dma/rc4030.c b/hw/dma/rc4030.c index 5d4833eeca..14bcab9fb3 100644 --- a/hw/dma/rc4030.c +++ b/hw/dma/rc4030.c @@ -636,8 +636,8 @@ static rc4030_dma *rc4030_allocate_dmas(void *opaque, int n) struct rc4030DMAState *p; int i; - s = (rc4030_dma *)g_malloc0(sizeof(rc4030_dma) * n); - p = (struct rc4030DMAState *)g_malloc0(sizeof(struct rc4030DMAState) * n); + s = g_new0(rc4030_dma, n); + p = g_new0(struct rc4030DMAState, n); for (i = 0; i < n; i++) { p->opaque = opaque; p->n = i; From patchwork Fri Oct 6 23:50:12 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 822861 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="iIrTMF3c"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3y87HM2Tp3z9sDB for ; Sat, 7 Oct 2017 11:51:27 +1100 (AEDT) Received: from localhost ([::1]:47891 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e0dKv-0001IY-F5 for incoming@patchwork.ozlabs.org; Fri, 06 Oct 2017 20:51:25 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43727) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e0cSR-0002NH-Lf for qemu-devel@nongnu.org; Fri, 06 Oct 2017 19:55:08 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e0cSQ-000873-Un for qemu-devel@nongnu.org; Fri, 06 Oct 2017 19:55:07 -0400 Received: from mail-qt0-x242.google.com ([2607:f8b0:400d:c0d::242]:56020) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1e0cSQ-00086y-Q9; Fri, 06 Oct 2017 19:55:06 -0400 Received: by mail-qt0-x242.google.com with SMTP id x54so34282319qth.12; Fri, 06 Oct 2017 16:55:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=mbPzHoE9CW3Im1xwfRsfkRXPgnRHAU2qMoJkZNG+VaE=; b=iIrTMF3cr9p0AqRIL+dD4PlqDIrP4UXEp4K/N+CVQt3/6j3qM5+jYD0gfTKCkFaHWt 2bF60bMr4X/OQNwpXyIHKztmsK9V7jKiWgYolZP8ZiVFQC0NPR0WQ6U7lRZ5sL3pd8nl YIeH5LFzQg1TARN+ZucBlWlbqONC0K8ZJFhcR2nJjXqtKF3Dq9t5MMBRcwW5pkcL6cKD ihZvsy2VHFnLCZrXLxFAiFqewjfBDhU9CGBKrh4GcSex9WcdwEf1ba1yrDbGUK6NMchy eYKltori08OXLja24g+brJI+79XBrKxvgUhoY2UPWxQqSygNBaOkUPR92J/8QKKXrr1B /V3w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=mbPzHoE9CW3Im1xwfRsfkRXPgnRHAU2qMoJkZNG+VaE=; b=t5n5kEgmJRkhroANtdJAZB7E4HYo2A/aWFTzAYLuqAHBHlAfxDi7VSQpJ7mcTXPL18 kijaotG6vGe6veI3Vhz0yjfn9tGLbeapOOp+av36blM33sBR/pi5WPMM1u+h4vSdJla9 TsUhHr1wsVNJhB9m8+nZngiNYREG+V17oRNZ8yhgAC2lCV13yqS2vJiM0lSNOB7okiej BXqK9vl04K3zNluvZ56g9Q75eIg7t/d9E1j/Qv+qY+gS8lMFosaKfgTuG1UTvcxFPxqt 4T8jbtAJco/kffQU9aSFAZre2xNhHay3r14rNbYtrV4PZGJ5TEO77zDKbE8VvTf898l3 08ig== X-Gm-Message-State: AMCzsaWmR9zTtFbdjf7CKDymSB+QoXTbC8TLJAJta2M5f5Ucmyy0MQxN 0jBbr0ZoGwK5hPr2+8p3IRCY83Ma4pQ= X-Google-Smtp-Source: AOwi7QB5Op2pdeUSL/FdrqjkUANCpiSjQU7RAVrEIDNrzTBV+XZnFWRrHl5E8/8DqU2jz5kOAqnNKw== X-Received: by 10.200.8.53 with SMTP id u50mr5641466qth.260.1507334106176; Fri, 06 Oct 2017 16:55:06 -0700 (PDT) Received: from yoga.lan ([181.93.89.178]) by smtp.gmail.com with ESMTPSA id g1sm1705226qta.95.2017.10.06.16.55.03 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 06 Oct 2017 16:55:05 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Markus Armbruster , Eric Blake , Cornelia Huck , Laurent Vivier Date: Fri, 6 Oct 2017 20:50:12 -0300 Message-Id: <20171006235023.11952-78-f4bug@amsat.org> X-Mailer: git-send-email 2.14.2 In-Reply-To: <20171006235023.11952-1-f4bug@amsat.org> References: <20171006235023.11952-1-f4bug@amsat.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c0d::242 Subject: [Qemu-devel] [PATCH 77/88] dump: use g_new() family of functions X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , qemu trival , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Marc-André Lureau Signed-off-by: Marc-André Lureau Acked-by: Cornelia Huck --- dump.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/dump.c b/dump.c index 7ebcf553b2..884221a904 100644 --- a/dump.c +++ b/dump.c @@ -1825,29 +1825,28 @@ void qmp_dump_guest_memory(bool paging, const char *file, DumpGuestMemoryCapability *qmp_query_dump_guest_memory_capability(Error **errp) { DumpGuestMemoryFormatList *item; - DumpGuestMemoryCapability *cap = - g_malloc0(sizeof(DumpGuestMemoryCapability)); + DumpGuestMemoryCapability *cap = g_new0(DumpGuestMemoryCapability, 1); /* elf is always available */ - item = g_malloc0(sizeof(DumpGuestMemoryFormatList)); + item = g_new0(DumpGuestMemoryFormatList, 1); cap->formats = item; item->value = DUMP_GUEST_MEMORY_FORMAT_ELF; /* kdump-zlib is always available */ - item->next = g_malloc0(sizeof(DumpGuestMemoryFormatList)); + item->next = g_new0(DumpGuestMemoryFormatList, 1); item = item->next; item->value = DUMP_GUEST_MEMORY_FORMAT_KDUMP_ZLIB; /* add new item if kdump-lzo is available */ #ifdef CONFIG_LZO - item->next = g_malloc0(sizeof(DumpGuestMemoryFormatList)); + item->next = g_new0(DumpGuestMemoryFormatList, 1); item = item->next; item->value = DUMP_GUEST_MEMORY_FORMAT_KDUMP_LZO; #endif /* add new item if kdump-snappy is available */ #ifdef CONFIG_SNAPPY - item->next = g_malloc0(sizeof(DumpGuestMemoryFormatList)); + item->next = g_new0(DumpGuestMemoryFormatList, 1); item = item->next; item->value = DUMP_GUEST_MEMORY_FORMAT_KDUMP_SNAPPY; #endif From patchwork Fri Oct 6 23:50:13 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 822868 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="feDxnGyv"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3y87MV097Hz9t2m for ; Sat, 7 Oct 2017 11:55:02 +1100 (AEDT) Received: from localhost ([::1]:47909 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e0dOO-0004Fr-3a for incoming@patchwork.ozlabs.org; Fri, 06 Oct 2017 20:55:00 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43781) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e0cSV-0002Tn-1i for qemu-devel@nongnu.org; Fri, 06 Oct 2017 19:55:13 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e0cSU-00088w-Do for qemu-devel@nongnu.org; Fri, 06 Oct 2017 19:55:11 -0400 Received: from mail-qk0-x244.google.com ([2607:f8b0:400d:c09::244]:37709) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1e0cST-00088d-ML; Fri, 06 Oct 2017 19:55:09 -0400 Received: by mail-qk0-x244.google.com with SMTP id a12so10184558qka.4; Fri, 06 Oct 2017 16:55:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=E9QAonZdxIIAc9ONzCRJ49sOsao4lPdhwqHRuykkNvw=; b=feDxnGyvipqnDSTHdYjVLBaX67+u3A9pylDVZ/dqD/msYXfY1DSY3HhU18qcvso3+e ejXY4X0KKBBrihDhV2S6A+2YebfO341m06YjC0TNZFI5f61yUmxvuRzK7o0fepjhOrR0 1QEi+8SnXGVWQJBwZIPrbZgYCkeZ8hGo9JEI5RLI2YBtpyRkqcmCYZuEvjqO30Ngl5Sn X+krLkB0rcfB9HmFqeRfQIe5Og2KF3xaTdfhndsRy+eTZK6YjfJdG/cmb9DetxMddRGK V5fVzY/ikWUKoFSEI/vRJItTqxmyW7OWwaTOhLUjrC97MZS24hA6ev5HDj6EosliDkYR U6lQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=E9QAonZdxIIAc9ONzCRJ49sOsao4lPdhwqHRuykkNvw=; b=ZiW5rQMAnpkkBoVbUsideCQ8rnuyppbPDLOeU2RUPxvYEG0j2sNEoRo2Q1DjWO+jYK zv1bewP9H+pT2HBlWK4utZAhujoTswBbXWuSj4iCJ7RQoE7Dc/Xf0lZNMmZAfEkOH1iC ssjyRiV4qdKDxD2H+EN3pkLH2Xn0WjtcO9laxbJCAohUDi/dnJpmWuwmniwvOJXGSXRa nv9FIQPpiTOs3k0BvYzmI+oSlIqwYs7yEuGRuL47pjultVUpMkCODbxEqsMtZqel7Mxi kL55LPK2JNX8/W3BDruISnM2xU7Cu1KQGjhwE+yue3K/efJ3usN+PZkuzDPb9OLx4dKA MBUg== X-Gm-Message-State: AMCzsaWuOrwX4XyeaxbwvZxxCvNwFwu2AZOds03J4VcCaHV+KfeeiYrl 9AQ23TtDObDbForS5iL3CTw= X-Google-Smtp-Source: AOwi7QD7kxo0Kc+RgyHcBobUvL98BgVe6HVWWSLgylyB6JPEufr+jTLzdkOcAlXEgJEvGc7+kk2pDA== X-Received: by 10.55.207.11 with SMTP id e11mr709700qkj.89.1507334109183; Fri, 06 Oct 2017 16:55:09 -0700 (PDT) Received: from yoga.lan ([181.93.89.178]) by smtp.gmail.com with ESMTPSA id g1sm1705226qta.95.2017.10.06.16.55.06 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 06 Oct 2017 16:55:08 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Markus Armbruster , Eric Blake , Paolo Bonzini , =?utf-8?q?Alex_Benn=C3=A9e?= Date: Fri, 6 Oct 2017 20:50:13 -0300 Message-Id: <20171006235023.11952-79-f4bug@amsat.org> X-Mailer: git-send-email 2.14.2 In-Reply-To: <20171006235023.11952-1-f4bug@amsat.org> References: <20171006235023.11952-1-f4bug@amsat.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c09::244 Subject: [Qemu-devel] [PATCH 78/88] gdb: use g_new() family of functions X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , qemu trival , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Marc-André Lureau Signed-off-by: Marc-André Lureau Reviewed-by: Alex Bennée --- gdbstub.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gdbstub.c b/gdbstub.c index 2a94030d3b..5f0d8af1c0 100644 --- a/gdbstub.c +++ b/gdbstub.c @@ -1786,7 +1786,7 @@ static void gdb_accept(void) /* set short latency */ socket_set_nodelay(fd); - s = g_malloc0(sizeof(GDBState)); + s = g_new0(GDBState, 1); s->c_cpu = first_cpu; s->g_cpu = first_cpu; s->fd = fd; @@ -1980,7 +1980,7 @@ int gdbserver_start(const char *device) s = gdbserver_state; if (!s) { - s = g_malloc0(sizeof(GDBState)); + s = g_new0(GDBState, 1); gdbserver_state = s; qemu_add_vm_change_state_handler(gdb_vm_state_change, NULL); From patchwork Fri Oct 6 23:50:14 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 822863 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="DeM1FfWw"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3y87Hd6WVwz9sDB for ; Sat, 7 Oct 2017 11:51:41 +1100 (AEDT) Received: from localhost ([::1]:47893 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e0dL9-0001Yn-VK for incoming@patchwork.ozlabs.org; Fri, 06 Oct 2017 20:51:39 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43819) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e0cSX-0002UM-Mc for qemu-devel@nongnu.org; Fri, 06 Oct 2017 19:55:16 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e0cSW-0008Bh-Ui for qemu-devel@nongnu.org; Fri, 06 Oct 2017 19:55:13 -0400 Received: from mail-qk0-x242.google.com ([2607:f8b0:400d:c09::242]:33118) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1e0cSW-0008BC-Py; Fri, 06 Oct 2017 19:55:12 -0400 Received: by mail-qk0-x242.google.com with SMTP id z12so9702077qkb.0; Fri, 06 Oct 2017 16:55:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=QDhExuv91uGcfDqPHtmFjgHyFpyHZRvwh51gJawyys0=; b=DeM1FfWw7nU8VjwQB768p3WC8ZhcBT8GnjFwDAJHcSDUyMb4/JBzQAGwqqJzng7Z1S t7C0KZTjRfZn0W6KmYv6SIlcLhoFt9T93JLu6kzfo3aE6m8swI9Lf+RcUwiZZ7GMLDlS /nMNv3A7Kb9z+7T/dFbwb6qhCAKZKv5TUedhu+6AClqZcb/u4ufxAndzGVwncOKuJiV0 X0rksMm1K/A6zaHlKWxGNLV0cMR2ThVecDNxaHKI5R0SCvz/AvHjjRktM8shYLMO8a9q IWdDzzlEe5T6wkGRrZKAQgu2lUGNtsANwr0bAoEqjpTesU5xdBPl2emsYge+YFAgSZ5t NVcA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=QDhExuv91uGcfDqPHtmFjgHyFpyHZRvwh51gJawyys0=; b=UW8GyVehIcm9sU9afsoXyykUJ37PJCQAe9/haNRuzM/izb0XIvi2HTkEoTEjwefG4N /a8K2al23fzZVXviWHstNhKD2uiTzXXtBIBEqk+ywEEZQ/Kmf26VJbveL2SO2z44PB6H IHRzlb23Ug8WOGjJLRL9ThrItzVvASJ+t/Hr+58Hm9m+9hhPuZ5UIbe1dOUBUv+sLHBp BbG4BkPSuzooa/EXdGtsuQdKtjj98Hh4zBwEPJRqlaKa0p7sYP3nSWHz8YzguFmfnm3B 8vZJv/U5NQy0ImjPKS+rHQPnBIP6nQAwpSg9C9V5N4TlD4r3k8jg82dLL8AZPs/mmPMJ kZxA== X-Gm-Message-State: AMCzsaXP8yePk4ShWohQLcXSe+2rBL5LgOr0RAmvYLpK7M591NVYezMl TPtwiasgxQ+VlamsOjM/IgY= X-Google-Smtp-Source: AOwi7QC+XCeUkW3ZI0w2UdI6q7j5Qix1j+Pd0p5cKAoRGtAOUiPLZjgbUkUYB6iwSvHY2XuG6dsKxQ== X-Received: by 10.55.56.14 with SMTP id f14mr742809qka.286.1507334112273; Fri, 06 Oct 2017 16:55:12 -0700 (PDT) Received: from yoga.lan ([181.93.89.178]) by smtp.gmail.com with ESMTPSA id g1sm1705226qta.95.2017.10.06.16.55.09 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 06 Oct 2017 16:55:11 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Markus Armbruster , Eric Blake , "Dr. David Alan Gilbert" Date: Fri, 6 Oct 2017 20:50:14 -0300 Message-Id: <20171006235023.11952-80-f4bug@amsat.org> X-Mailer: git-send-email 2.14.2 In-Reply-To: <20171006235023.11952-1-f4bug@amsat.org> References: <20171006235023.11952-1-f4bug@amsat.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c09::242 Subject: [Qemu-devel] [PATCH 79/88] hmp: use g_new() family of functions X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , qemu trival , =?utf-8?q?Philippe_Mathieu-Dau?= =?utf-8?b?ZMOp?= , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Philippe Mathieu-Daudé --- hmp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hmp.c b/hmp.c index 739d330f4e..5157ac4223 100644 --- a/hmp.c +++ b/hmp.c @@ -1917,7 +1917,7 @@ void hmp_migrate(Monitor *mon, const QDict *qdict) return; } - status = g_malloc0(sizeof(*status)); + status = g_new0(HMPMigrationStatus, 1); status->mon = mon; status->is_block_migration = blk || inc; status->timer = timer_new_ms(QEMU_CLOCK_REALTIME, hmp_migrate_status_cb, From patchwork Fri Oct 6 23:50:15 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 822844 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="BtGUvHEx"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3y878T0xkNz9t5C for ; Sat, 7 Oct 2017 11:45:29 +1100 (AEDT) Received: from localhost ([::1]:47840 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e0dF9-0004Q8-4v for incoming@patchwork.ozlabs.org; Fri, 06 Oct 2017 20:45:27 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43863) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e0cSa-0002Wk-S9 for qemu-devel@nongnu.org; Fri, 06 Oct 2017 19:55:17 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e0cSZ-0008G6-Uu for qemu-devel@nongnu.org; Fri, 06 Oct 2017 19:55:16 -0400 Received: from mail-qt0-x242.google.com ([2607:f8b0:400d:c0d::242]:56451) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1e0cSZ-0008F1-Qs; Fri, 06 Oct 2017 19:55:15 -0400 Received: by mail-qt0-x242.google.com with SMTP id 34so17244413qtb.13; Fri, 06 Oct 2017 16:55:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=jUgAq/rANFUl3pqOXoOpjdwp9+jJcKT99eGcyhEwxm8=; b=BtGUvHExTVbLYWrJzcp9bVKk56AiZpTULOBc4TVOAQD0eJeX3fMcpcn/2xo1GEByFx m06uiOMK8yswvgSY3KbP/xGwi/WCmDbotfX575khazW5cgvd+HEoUbzylrQrafopioT6 Y2Ih2nM5fR67xUs0ugMafVwBFc+LUST4+sfE4iPXu371Buz+EBQLjbmhVuiVLwR/H+KB PQETeloYzLbsstdcw2sQqLXNYFM5awF7RsGvDxdJee0tgA+lEoJXLInOMt3XbZXbUvjH c8ylBF4BWb63aIy40izfb3pk9Q4A5I72pCnVBVYEg/30YPaVRTMpJIqhyWrgW0iVGd74 AJSg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=jUgAq/rANFUl3pqOXoOpjdwp9+jJcKT99eGcyhEwxm8=; b=rGLRp0wGP0cEtQrgYJ4pKXygdvnA4chWxUvmnYqtWpsK0bzus4W8Lyl0Ofah6QXZCw YpQ714N7ATbB4ex5owZ6fP+nvHdbJgdrL2rCQIZ03bAlcUwjxBP5cnh2bAtg7gRUzt5M ZCl5TZ8K/QoU1xiVA014WiX6WiFRk/qJDx1GWGPuLVGIKwowkAmuVq0k85xd9KhOz93x +/5dovEtpxmvdE6uVBMF1mjp65UiY2jZtPsQRi0fX2ctEVnII8mCFQYYyP3pDHd+89mG H6tvWyh+aMnXnD8ov1BdshlSUkETPAyTaiF0JVzvyMrH23C4RkbhQYUBI12ZDj5GsqTa MTQw== X-Gm-Message-State: AMCzsaUIez2p3mcbEQyftLtGD1SlJy0Lfe/mcyQvTKwYo7LHA6+SC/4G RaCTvi2U/ytn2iEMRm7Uzm4= X-Google-Smtp-Source: AOwi7QCWTQYa+sSQEr2u/SAq6t97ArTIGBKBR+0SOdyK0u1mfdagxi9392p6INBjU4aIbwUsGg6r0g== X-Received: by 10.237.33.203 with SMTP id m11mr5557180qtc.123.1507334115336; Fri, 06 Oct 2017 16:55:15 -0700 (PDT) Received: from yoga.lan ([181.93.89.178]) by smtp.gmail.com with ESMTPSA id g1sm1705226qta.95.2017.10.06.16.55.12 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 06 Oct 2017 16:55:14 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Markus Armbruster , Eric Blake , Eduardo Habkost Date: Fri, 6 Oct 2017 20:50:15 -0300 Message-Id: <20171006235023.11952-81-f4bug@amsat.org> X-Mailer: git-send-email 2.14.2 In-Reply-To: <20171006235023.11952-1-f4bug@amsat.org> References: <20171006235023.11952-1-f4bug@amsat.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c0d::242 Subject: [Qemu-devel] [PATCH 80/88] numa: use g_new() family of functions X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , qemu trival , =?utf-8?q?Philippe_Mathieu-Dau?= =?utf-8?b?ZMOp?= , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Philippe Mathieu-Daudé --- numa.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/numa.c b/numa.c index 100a67febf..35df996738 100644 --- a/numa.c +++ b/numa.c @@ -66,7 +66,7 @@ void numa_set_mem_node_id(ram_addr_t addr, uint64_t size, uint32_t node) return; } - range = g_malloc0(sizeof(*range)); + range = g_new0(struct numa_addr_range, 1); range->mem_start = addr; range->mem_end = addr + size - 1; QLIST_INSERT_HEAD(&numa_info[node].addr, range, entry); From patchwork Fri Oct 6 23:50:16 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 822867 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="GlfAbG8e"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3y87LW1k9Pz9t2m for ; Sat, 7 Oct 2017 11:54:05 +1100 (AEDT) Received: from localhost ([::1]:47906 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e0dNS-0003Vd-NN for incoming@patchwork.ozlabs.org; Fri, 06 Oct 2017 20:54:02 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43915) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e0cSe-0002ae-8j for qemu-devel@nongnu.org; Fri, 06 Oct 2017 19:55:21 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e0cSd-0008M4-JF for qemu-devel@nongnu.org; Fri, 06 Oct 2017 19:55:20 -0400 Received: from mail-qt0-x244.google.com ([2607:f8b0:400d:c0d::244]:53663) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1e0cSd-0008L5-Dq; Fri, 06 Oct 2017 19:55:19 -0400 Received: by mail-qt0-x244.google.com with SMTP id n61so6370467qte.10; Fri, 06 Oct 2017 16:55:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=DyQ8Lj0Q3s/8TCexwZm2h7X6AHnaZ4A4DHRwz9DHO0g=; b=GlfAbG8eXWYaYS6IDYy5AfVMqInVmVSAzHTFfqwXCyrB1U7ObzF5Q2pQRdvZ1fa+cZ u1hnG7S4Qe/d7MhUcX6rf/2tnuJQyxSch2Zv459Dy1Xnrmi1TJWSdYquWmastaUx02Rh eYXLhh3ykjwPmxnaOvVM/q0lwQ6kgmkjvbD41/wGs2f2AJUHlUxwTqVs+5rTLNJJz2u7 NOuZGASMsgz6r2Mn/J710YqsBPO6EcVVjPArYhJODCdmWldqNku0EIVU15ZkILkx3B4r jDKybZb06hjsxVDpyOmwlpTDyVveM7fZzTAyMBGIOZeCKbEl8rBRsArXhMTXH+wdG8b2 B+EA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=DyQ8Lj0Q3s/8TCexwZm2h7X6AHnaZ4A4DHRwz9DHO0g=; b=rS1i0OGoLZbe9mBNFeLQDGYd0FMGMXvlIOFXBju8ip5nuKde8wro+5sFUbB37UZoTa QcbLlfFb3d4u5PEtfXRbEq9yTIuqbZ86Y4pm3xV1DPL2ZlLIkALZtsoQEvxxg/G5frSK TJ0kMdUH/criVuZ83zVQ8YLQPWCua+iJFUzyNiQWTXp7R1XdeeHk08VLYG+uTBFY0RQi MUWNGCHrRN6b5+JG+5OzCFgbTu9o9hr5fCXV14a06rDMohadp2ozRO+wjUsmQX9pb7FK Z05AVRoBssd9/HTXOuEKcRKwlUUbVGpuefZ8f33AnI1bXX1dE2ahGtEuOh61RnGaambB CTDw== X-Gm-Message-State: AMCzsaWsjH3qeQJ9rjj1CN8WRFXkH9iIWe5nQINmt09FsC/haDYJnU/b fizXqPLolElt844dLAeYvhg= X-Google-Smtp-Source: AOwi7QDn5iB7Uc2E6kc7FshfHKC0w4UCA3ONKClwpJ7KTdBUs0xYcwD8/NqDyivHmnxRLISQV32ilg== X-Received: by 10.200.43.228 with SMTP id n33mr5728374qtn.241.1507334118775; Fri, 06 Oct 2017 16:55:18 -0700 (PDT) Received: from yoga.lan ([181.93.89.178]) by smtp.gmail.com with ESMTPSA id g1sm1705226qta.95.2017.10.06.16.55.15 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 06 Oct 2017 16:55:18 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Markus Armbruster , Eric Blake , Ben Warren , "Michael S. Tsirkin" , Igor Mammedov Date: Fri, 6 Oct 2017 20:50:16 -0300 Message-Id: <20171006235023.11952-82-f4bug@amsat.org> X-Mailer: git-send-email 2.14.2 In-Reply-To: <20171006235023.11952-1-f4bug@amsat.org> References: <20171006235023.11952-1-f4bug@amsat.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c0d::244 Subject: [Qemu-devel] [PATCH 81/88] hw/acpi: use g_new() family of functions X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , qemu trival , =?utf-8?q?Philippe_Mathieu-Dau?= =?utf-8?b?ZMOp?= , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Ben Warren --- hw/acpi/vmgenid.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/acpi/vmgenid.c b/hw/acpi/vmgenid.c index 2876d8a639..ced507d218 100644 --- a/hw/acpi/vmgenid.c +++ b/hw/acpi/vmgenid.c @@ -269,7 +269,7 @@ GuidInfo *qmp_query_vm_generation_id(Error **errp) } vms = VMGENID(obj); - info = g_malloc0(sizeof(*info)); + info = g_new0(GuidInfo, 1); info->guid = qemu_uuid_unparse_strdup(&vms->guid); return info; } From patchwork Fri Oct 6 23:50:17 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 822869 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="LMJBrP94"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3y87Nn3tnDz9t2m for ; Sat, 7 Oct 2017 11:56:09 +1100 (AEDT) Received: from localhost ([::1]:47919 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e0dPT-0005ER-Jy for incoming@patchwork.ozlabs.org; Fri, 06 Oct 2017 20:56:07 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43953) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e0cSj-0002g3-SF for qemu-devel@nongnu.org; Fri, 06 Oct 2017 19:55:26 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e0cSh-0008Rl-A1 for qemu-devel@nongnu.org; Fri, 06 Oct 2017 19:55:25 -0400 Received: from mail-qk0-x242.google.com ([2607:f8b0:400d:c09::242]:36775) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1e0cSh-0008R4-4j; Fri, 06 Oct 2017 19:55:23 -0400 Received: by mail-qk0-x242.google.com with SMTP id z14so12863130qkg.3; Fri, 06 Oct 2017 16:55:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=zI2BI8ooaDuOU0ve7WrrbMgxy5q7lqPyUpUsHSIPo2o=; b=LMJBrP945Kp2XYozDtEmIBhqmmTn5sATSVfIinEcZLj1Sxaipn5M+gD2Dj4XtXlQxw F1Oigun2Oh+bxyu4+saGl9AS6+xo4uvRMMkvN0wgWF5lsM5lPG7SEEU93v5AN52J9zTh jd0Z8X8Ssl581YxIvS+3Ppr1vFwzd0fPmB3csJKTPK4lfVJz1cp4YcF5emYMPLVRVm9d DErzNmJr+YbZC5W0J+gRKOlgPuD7gOSeeC6q3+jzbfpWl8HZcORBkA+erULc3LLRzsqs 2FX2FmBzUv2My0e8rEpyXaXPi8Uo5coBdb5x1CMWUJWqUAHqfslX6FO3cs4mj7zAfNSU yQ3Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=zI2BI8ooaDuOU0ve7WrrbMgxy5q7lqPyUpUsHSIPo2o=; b=AVZlKZoYk+s1BsYJQYoIwL9LUDxpfP4osNn31BWglW9oP2boJcBWq21Fr3zUPXh9gT rTNMDdAGRjVVB3wwoSArwC8coeFk1R8pUErmbhS9igV5wGCOOen7gHFC1px/QtJvcn8m oRBgYKyPkaEsa/gCpbI88WzwMsF0W29B5p0Y+yaZC8jtEQCjcbGFFKYNSytBd/38s6rI 8N2HICOCJ7vn2DRaqctaf9lxWrwHGm/AVx1XqJ/bb7LAUSxqzJhSepPivqVpLgyFAJ9e JhDumnl9XQ8SGMhBaBVZWqVeX+Gol1Nz/umL5bUwc+WK2OYALjIIxtsYF9iJ/GfMF1+Y sI8w== X-Gm-Message-State: AMCzsaUp8Hor6mDXmsMt7aheD8IDADXKcqa8tgANyBt2OID4gfJHCokx 0aI7Oji70ixjgLomAN8skpA= X-Google-Smtp-Source: AOwi7QA0UWLgYwoey5ZGxFS5JpjfuxwpcWKnsMPvUWvowy6e+MXdE0D+aCwkqIQ/IMdSjYtYoUarww== X-Received: by 10.55.91.199 with SMTP id p190mr679660qkb.291.1507334122594; Fri, 06 Oct 2017 16:55:22 -0700 (PDT) Received: from yoga.lan ([181.93.89.178]) by smtp.gmail.com with ESMTPSA id g1sm1705226qta.95.2017.10.06.16.55.18 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 06 Oct 2017 16:55:22 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Markus Armbruster , Eric Blake , Corey Minyard , =?utf-8?q?C=C3=A9dric_Le_Goater?= , David Gibson , Alexander Graf Date: Fri, 6 Oct 2017 20:50:17 -0300 Message-Id: <20171006235023.11952-83-f4bug@amsat.org> X-Mailer: git-send-email 2.14.2 In-Reply-To: <20171006235023.11952-1-f4bug@amsat.org> References: <20171006235023.11952-1-f4bug@amsat.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c09::242 Subject: [Qemu-devel] [PATCH 82/88] hw/ipmi: use g_new() family of functions X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , qemu trival , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , qemu-devel@nongnu.org, qemu-ppc@nongnu.org, =?utf-8?q?Marc-Andr=C3=A9?= =?utf-8?q?_Lureau?= Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Philippe Mathieu-Daudé --- Shouldn't this file be under the PowerPC section of MAINTAINERS? hw/ipmi/ipmi_bmc_sim.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/ipmi/ipmi_bmc_sim.c b/hw/ipmi/ipmi_bmc_sim.c index 277c28cb40..a68792a2cb 100644 --- a/hw/ipmi/ipmi_bmc_sim.c +++ b/hw/ipmi/ipmi_bmc_sim.c @@ -1073,7 +1073,7 @@ static void send_msg(IPMIBmcSim *ibs, return; } - msg = g_malloc(sizeof(*msg)); + msg = g_new(IPMIRcvBufEntry, 1); msg->buf[0] = ((netfn | 1) << 2) | rqLun; /* NetFN, and make a response */ msg->buf[1] = ipmb_checksum(msg->buf, 1, 0); msg->buf[2] = cmd[0]; /* rsSA */ From patchwork Fri Oct 6 23:50:18 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 822866 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="H+IQ1+FL"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3y87LW1kBHz9t5Y for ; Sat, 7 Oct 2017 11:54:07 +1100 (AEDT) Received: from localhost ([::1]:47907 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e0dNV-0003XR-DK for incoming@patchwork.ozlabs.org; Fri, 06 Oct 2017 20:54:05 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43980) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e0cSl-0002hf-F0 for qemu-devel@nongnu.org; Fri, 06 Oct 2017 19:55:28 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e0cSk-0008V5-OU for qemu-devel@nongnu.org; Fri, 06 Oct 2017 19:55:27 -0400 Received: from mail-qt0-x244.google.com ([2607:f8b0:400d:c0d::244]:52776) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1e0cSk-0008UH-8X; Fri, 06 Oct 2017 19:55:26 -0400 Received: by mail-qt0-x244.google.com with SMTP id o52so34330922qtc.9; Fri, 06 Oct 2017 16:55:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=era+XnocuyRf561qAOJ7vKj2ffEpWucxQRSEif3klIs=; b=H+IQ1+FLPi7lu3IV9dMpBpagN/UTM2fRIM5dVs0kHvZv2CgB8gMJT+pfLJSZxOCKeN 2/VmaT1GghgnVBrJLGlNhzw9U944ishdYG1U4cwQCBupRJvA2qrUgIdt7j+3iOqUJ3VT fhFc46W9uTPAYcuxVNp+RHBWO6KYcPXJ7ZMay7F6o+S7FXRlXoGCE05moBGESt00m6B7 1vX+Ppp9NZ6ALFF7Db9JobQB08+mDVaCVjoNrmxHGoXaunJcusXAYYtNzRRd4dQ8E0Cu W/xCM4exe7eIqq7bR3ed3kwTQpjta4ZNR7qBRg33Dho94hAVJIKq4ftf+Z6JCs+Ini2C YNsw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=era+XnocuyRf561qAOJ7vKj2ffEpWucxQRSEif3klIs=; b=ku6KtYKbPmmzuGWxPGUVhPrEuLfB6WeNZIqQEHmXaD2NxMBP/1Rhmw3JS9GYxg0jz+ KNzQrXTb/4ebqHoRIdH7v2CQnnYEiP6nJRWqNqtgX7rGzNIc6C9U95k52TwuGhDIEjlA FynrJu8lnx9dZczWSPEGt1Fo1eMzvLemSUn223BgF+fGASfEMJMIQAe3nbamXfYeIjai sEyKOBW387i+45Yzr3nmwRG2VWeBlNcCkFN0M4sfF4duhjBqOj5wu3SDjDxEQWnKA0AA IqajpHlJM7IAge2V1qDh8mcTid7csXnyLmSa18UpcnQGvf6Z010dA3IDpPCotR7pg7UI ZZqw== X-Gm-Message-State: AMCzsaV93nadLMsZ/Yx+NA/bUOuj/rOyZdnUJo6b0U085o8BQSntaJsf 3eSoAcrFvYCsvp9JmeeYREAVd/Rpv4A= X-Google-Smtp-Source: AOwi7QCXlpJ52klj9OMIdhPY7fIlLAfpBMPu17jWCCDaeAO/+Bz7nNWeRIwrn3tqWCgoFOJSd26lfw== X-Received: by 10.200.22.231 with SMTP id y36mr5548078qtk.31.1507334125755; Fri, 06 Oct 2017 16:55:25 -0700 (PDT) Received: from yoga.lan ([181.93.89.178]) by smtp.gmail.com with ESMTPSA id g1sm1705226qta.95.2017.10.06.16.55.22 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 06 Oct 2017 16:55:25 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Markus Armbruster , Eric Blake , "Michael S. Tsirkin" , Marcel Apfelbaum Date: Fri, 6 Oct 2017 20:50:18 -0300 Message-Id: <20171006235023.11952-84-f4bug@amsat.org> X-Mailer: git-send-email 2.14.2 In-Reply-To: <20171006235023.11952-1-f4bug@amsat.org> References: <20171006235023.11952-1-f4bug@amsat.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c0d::244 Subject: [Qemu-devel] [PATCH 83/88] hw/pci: use g_new() family of functions X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , qemu trival , =?utf-8?q?Philippe_Mathieu-Dau?= =?utf-8?b?ZMOp?= , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Philippe Mathieu-Daudé --- hw/pci/pci.c | 2 +- hw/pci/pcie_port.c | 2 +- tests/libqos/pci-pc.c | 2 +- tests/libqos/pci.c | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/hw/pci/pci.c b/hw/pci/pci.c index 1e6fb88eba..32625d9fcc 100644 --- a/hw/pci/pci.c +++ b/hw/pci/pci.c @@ -1644,7 +1644,7 @@ static PciMemoryRegionList *qmp_query_pci_regions(const PCIDevice *dev) continue; } - region = g_malloc0(sizeof(*region)); + region = g_new0(PciMemoryRegionList, 1); region->value = g_malloc0(sizeof(*region->value)); if (r->type & PCI_BASE_ADDRESS_SPACE_IO) { diff --git a/hw/pci/pcie_port.c b/hw/pci/pcie_port.c index 6432b9ac1f..236d8bc4db 100644 --- a/hw/pci/pcie_port.c +++ b/hw/pci/pcie_port.c @@ -72,7 +72,7 @@ void pcie_chassis_create(uint8_t chassis_number) if (c) { return; } - c = g_malloc0(sizeof(*c)); + c = g_new0(struct PCIEChassis, 1); c->number = chassis_number; QLIST_INIT(&c->slots); QLIST_INSERT_HEAD(&chassis, c, next); diff --git a/tests/libqos/pci-pc.c b/tests/libqos/pci-pc.c index ded1c54c06..cde5e0a627 100644 --- a/tests/libqos/pci-pc.c +++ b/tests/libqos/pci-pc.c @@ -119,7 +119,7 @@ QPCIBus *qpci_init_pc(QGuestAllocator *alloc) { QPCIBusPC *ret; - ret = g_malloc(sizeof(*ret)); + ret = g_new(QPCIBusPC, 1); ret->bus.pio_readb = qpci_pc_pio_readb; ret->bus.pio_readw = qpci_pc_pio_readw; diff --git a/tests/libqos/pci.c b/tests/libqos/pci.c index 0b73cb23d0..9dd689c7b5 100644 --- a/tests/libqos/pci.c +++ b/tests/libqos/pci.c @@ -54,7 +54,7 @@ QPCIDevice *qpci_device_find(QPCIBus *bus, int devfn) { QPCIDevice *dev; - dev = g_malloc0(sizeof(*dev)); + dev = g_new0(QPCIDevice, 1); dev->bus = bus; dev->devfn = devfn; From patchwork Fri Oct 6 23:50:19 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 822872 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="heXu39vr"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3y87RB64Pmz9t5c for ; Sat, 7 Oct 2017 11:58:14 +1100 (AEDT) Received: from localhost ([::1]:47931 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e0dRU-0006v9-Tg for incoming@patchwork.ozlabs.org; Fri, 06 Oct 2017 20:58:12 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44027) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e0cSo-0002il-Ag for qemu-devel@nongnu.org; Fri, 06 Oct 2017 19:55:31 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e0cSn-00006H-Ma for qemu-devel@nongnu.org; Fri, 06 Oct 2017 19:55:30 -0400 Received: from mail-qk0-x242.google.com ([2607:f8b0:400d:c09::242]:33120) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1e0cSn-00005n-I4; Fri, 06 Oct 2017 19:55:29 -0400 Received: by mail-qk0-x242.google.com with SMTP id z12so9702355qkb.0; Fri, 06 Oct 2017 16:55:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=kOG8ryxXrQud/PCmZtEGVImSDwBRP+LfkGt7dShvAMQ=; b=heXu39vrBfgUyW5q6QznqO7R7pfxbn7YNla2UsmytGC2Myjlsjpokhq4XGKatDjOjV opeyYxYTAgQcL8BM10IVl4+jo7abIE40TbgZdqh09Gy8Lcc+5OfEP9gGo6m1EIKDzJM6 aGm7hUAN1lK1+550DCvd8K/TKtt84kD9yOiFrSzogTFqX5RLYQbSTDtijr7HVlDVt+QH 3j8PhJjX76yzTWWIXRNmfOfLa51USocd1Ly98sS6HQ2E8YoRF/st3iLG5Upj5SyNMURo +oRlLQQXirfCKTQbDqekPV/+Qn4y1qFLdq6DGNTLJnuLFfDFRSJfa0GxwXe/R5hZgxHZ 9x0w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=kOG8ryxXrQud/PCmZtEGVImSDwBRP+LfkGt7dShvAMQ=; b=ZxAdoT/5/xho5zWoe5SwRHbiPSr1i0voz6ZPd71r57ix6s1J8aKOWWDUctuuSJAHRm QNakT6C62uBjSY/tifks+TTtFmM1fUcnG+74ISgbrks0QRO/jduaN8wtDNmMo5kURa4t uEOsyksgpeqriQh2QLdW/E5I2dtnL3LGWNxDTzeGdjgU5NemCBYNiLaJmyPGZ+99Cv2S BpgNLEkcIukeYDetfdUlkisqI1aDYdrmHuonKYMjqS1jCjR6w1SiTuU2On/e/PX2q4gl 4n9iYGvpuRVIKJbYJNMn4rr3yLto8u0yStfmPpDzkGB9gNZ8rIvRch6J8tt+nDBP0Xzx RKBg== X-Gm-Message-State: AMCzsaXpg0iv2T9TxKTinHobGPKEMeGOFMX7KtZhTmvciShsvu6rjXbN s0JG0Njjv5dQkHMD6MlzJEo= X-Google-Smtp-Source: AOwi7QCzHr04GohSPF7I3w3El0Rb/4i2xziDnze703kXLiTIzl5/L4S7zQtGT+W26iaw/xMo1OKNWw== X-Received: by 10.55.162.7 with SMTP id l7mr771285qke.74.1507334128872; Fri, 06 Oct 2017 16:55:28 -0700 (PDT) Received: from yoga.lan ([181.93.89.178]) by smtp.gmail.com with ESMTPSA id g1sm1705226qta.95.2017.10.06.16.55.25 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 06 Oct 2017 16:55:28 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Markus Armbruster , Eric Blake , Paolo Bonzini , Dmitry Fleytman Date: Fri, 6 Oct 2017 20:50:19 -0300 Message-Id: <20171006235023.11952-85-f4bug@amsat.org> X-Mailer: git-send-email 2.14.2 In-Reply-To: <20171006235023.11952-1-f4bug@amsat.org> References: <20171006235023.11952-1-f4bug@amsat.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c09::242 Subject: [Qemu-devel] [PATCH 84/88] hw/scsi: use g_new() family of functions X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , qemu trival , =?utf-8?q?Philippe_Mathieu-Dau?= =?utf-8?b?ZMOp?= , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Philippe Mathieu-Daudé --- hw/scsi/vmw_pvscsi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/scsi/vmw_pvscsi.c b/hw/scsi/vmw_pvscsi.c index d8079158ac..24d0306ede 100644 --- a/hw/scsi/vmw_pvscsi.c +++ b/hw/scsi/vmw_pvscsi.c @@ -616,7 +616,7 @@ pvscsi_queue_pending_descriptor(PVSCSIState *s, SCSIDevice **d, PVSCSIRequest *pvscsi_req; uint8_t lun; - pvscsi_req = g_malloc0(sizeof(*pvscsi_req)); + pvscsi_req = g_new0(PVSCSIRequest, 1); pvscsi_req->dev = s; pvscsi_req->req = *descr; pvscsi_req->cmp.context = pvscsi_req->req.context; From patchwork Fri Oct 6 23:50:20 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 822871 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="fK3HQ90O"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3y87Qq69nRz9t5c for ; Sat, 7 Oct 2017 11:57:55 +1100 (AEDT) Received: from localhost ([::1]:47929 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e0dRC-0006gj-15 for incoming@patchwork.ozlabs.org; Fri, 06 Oct 2017 20:57:54 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44103) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e0cSs-0002nO-DM for qemu-devel@nongnu.org; Fri, 06 Oct 2017 19:55:35 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e0cSq-000089-OC for qemu-devel@nongnu.org; Fri, 06 Oct 2017 19:55:34 -0400 Received: from mail-qk0-x242.google.com ([2607:f8b0:400d:c09::242]:38011) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1e0cSq-00007l-JV; Fri, 06 Oct 2017 19:55:32 -0400 Received: by mail-qk0-x242.google.com with SMTP id 17so5921155qkq.5; Fri, 06 Oct 2017 16:55:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=j9cp+Fg3IAnoTZ4V34vSGc1owpDbeDPUDxiTyMLzb74=; b=fK3HQ90Oph8ujz1P9SxFObS07MK9fQoQFLtm3AkI7qVDVO3GAp06YkSTQRfdcZVHbB kKtteF2U1K2ZiW1c7uqvlwoTJDSgqQYgXqQirlrDgrbS5UQjg9Bpgu5QG0H1txLjSe3w 7rjYN9/m8GcoVtv3sBakzgyR8rwUOz4z7Fzt+iLZA6uVuy/BKFhdNLJxDyh46MwaoocR cxglq9jgOIDdoOgB0HGX2GywYFV0LzIZaZL2IRYGdnYkVnm8JLYtyj7Ca7e7MyNSRSfO VMbCsrzgjCvSNG4dP4qatSjfHJ0qOnQZJMYxFU+wjjL/HfRPc7vHQJTfYRCDLCjHNTte +76A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=j9cp+Fg3IAnoTZ4V34vSGc1owpDbeDPUDxiTyMLzb74=; b=i6Ff+97kX73cRHDFRijkVgpkpUbgXnKujR8LC38GrgUVLy8PujunUYrpfMC6lkQBMx 9I9DWbPbTUmkUfljOd1I/gZqhyzSN3Ea5Ys5ilklFQSQpgoeRw2MMaTUk0PPamsTCUY7 lybiF1yX3SSzkSpzSRijNW0bi56S2IQPvgcZcDaXtvn/mff6SmF92ebryi9pzCzd96yp vvjNbP0dfh+t11YShw6/crHH12EUWO45bKLskgoFwowE7kFy+LcP6r1qqh1aDbaNLEF7 5y3Gbay514rg6FBWguOqRanyLjmHkidyn6zSUxmx+kXYGWZVBUEauvu93El21KZPvQC7 8e6A== X-Gm-Message-State: AMCzsaXKwHzrqo0OQr8bpDacLzv0zSBbLnqqgw1Sof2X6XyV73LVcIrS esBbvaOclhNyJYm78/oF/OA= X-Google-Smtp-Source: AOwi7QDnnDJ8ULjraKNRJpW5ClTIuKIZ+01BvSidJJHBuwkh1urqUtSAUZN281j9KcoXepq49q+eaw== X-Received: by 10.55.195.11 with SMTP id a11mr670429qkj.222.1507334132058; Fri, 06 Oct 2017 16:55:32 -0700 (PDT) Received: from yoga.lan ([181.93.89.178]) by smtp.gmail.com with ESMTPSA id g1sm1705226qta.95.2017.10.06.16.55.29 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 06 Oct 2017 16:55:31 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Markus Armbruster , Eric Blake , Gerd Hoffmann Date: Fri, 6 Oct 2017 20:50:20 -0300 Message-Id: <20171006235023.11952-86-f4bug@amsat.org> X-Mailer: git-send-email 2.14.2 In-Reply-To: <20171006235023.11952-1-f4bug@amsat.org> References: <20171006235023.11952-1-f4bug@amsat.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c09::242 Subject: [Qemu-devel] [PATCH 85/88] hw/usb: use g_new() family of functions X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , qemu trival , =?utf-8?q?Philippe_Mathieu-Dau?= =?utf-8?b?ZMOp?= , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Philippe Mathieu-Daudé --- hw/usb/hcd-ehci.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/usb/hcd-ehci.c b/hw/usb/hcd-ehci.c index 0134232627..34785923f3 100644 --- a/hw/usb/hcd-ehci.c +++ b/hw/usb/hcd-ehci.c @@ -545,7 +545,7 @@ static EHCIQueue *ehci_alloc_queue(EHCIState *ehci, uint32_t addr, int async) EHCIQueueHead *head = async ? &ehci->aqueues : &ehci->pqueues; EHCIQueue *q; - q = g_malloc0(sizeof(*q)); + q = g_new0(EHCIQueue, 1); q->ehci = ehci; q->qhaddr = addr; q->async = async; From patchwork Fri Oct 6 23:50:21 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 822870 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="MAjy37BH"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3y87PF0DZXz9t2m for ; Sat, 7 Oct 2017 11:56:33 +1100 (AEDT) Received: from localhost ([::1]:47922 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e0dPr-0005Wi-3T for incoming@patchwork.ozlabs.org; Fri, 06 Oct 2017 20:56:31 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44132) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e0cSu-0002pg-HV for qemu-devel@nongnu.org; Fri, 06 Oct 2017 19:55:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e0cSt-0000C9-PU for qemu-devel@nongnu.org; Fri, 06 Oct 2017 19:55:36 -0400 Received: from mail-qk0-x243.google.com ([2607:f8b0:400d:c09::243]:33121) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1e0cSt-0000Ba-L5; Fri, 06 Oct 2017 19:55:35 -0400 Received: by mail-qk0-x243.google.com with SMTP id z12so9702454qkb.0; Fri, 06 Oct 2017 16:55:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=zx9Yv1rXev8ni/gFyCEvG5EolqzbzAdH4XpesCfpiZI=; b=MAjy37BHYEn8l3Bn6jKIO8Jk1Bh5HAZQ9jF34V9yPZDeanG49+DwB+WRG4clTYuBxi jpevIC+DY6X6SEXuTzf5LXCqYSLX/RjiindPppfD6BpEH/+tvabGypEFW2nTDQf883f3 WWgo5Mr3RCIj2ffnRjnB30h6wNtUO8CDFY767pS7IBJJloQDkI6KM0Ff49lr4/z7BdVs B4Uqa3k9TRg5HbfViZRa5kUsffl/xyvgcKX3j2X+UeThPdVYOyStV7H/jRFS9unjaX36 YXlmZxEfHOAy7aFgl9NCch9JHRmlsWwov1WyJCbVyuJWQdXKaT44+zootD49ijK1NByl crng== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=zx9Yv1rXev8ni/gFyCEvG5EolqzbzAdH4XpesCfpiZI=; b=UkCgClgCsS669BQgc7M/xx9ui7R1mFF25vSwzDVI4QMJ2FI9OeTjJseaV9RxyrL6iO E9RwGO/yKRcNJIvGxmaRYL6PZ9g5ykiYRgMgg7PNYewssKkEvAZboIFtSTE9mEEGd5vS VN+mjzs6jSTTUtaansXGXC7SAGMqoBh7Cr5KSLdnHp7Hr47XE/MPqxTr/Ef7pa35wCG/ v1OwlhMM7/uB7W3ct/RqwpqWqZwcyGU/uxO4+pOH+nWPkWRZL9CLBDBV64MVESV5iC1k yGNIdkBUK2JHl6i0reqAGEVRVeY2YZDuEpLxwhXXoF3IDO4iQXKBAMErCvO0Vw4BXfJy Tc1Q== X-Gm-Message-State: AMCzsaWGzWehu72W59jS0g+lF6TPgCKvts5g7Mgjydw7vSWUmPSu67SG 6sP7uXJY90kywCNGSWkqD6c= X-Google-Smtp-Source: AOwi7QBeui9q774tQc8bRbCbPQWwpcZWLf+k2MEQKcYu8VJev3V1r/jgCy3jkPJfWM1aqT3gSifDGw== X-Received: by 10.55.181.129 with SMTP id e123mr771327qkf.128.1507334135133; Fri, 06 Oct 2017 16:55:35 -0700 (PDT) Received: from yoga.lan ([181.93.89.178]) by smtp.gmail.com with ESMTPSA id g1sm1705226qta.95.2017.10.06.16.55.32 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 06 Oct 2017 16:55:34 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Markus Armbruster , Eric Blake , Jason Wang Date: Fri, 6 Oct 2017 20:50:21 -0300 Message-Id: <20171006235023.11952-87-f4bug@amsat.org> X-Mailer: git-send-email 2.14.2 In-Reply-To: <20171006235023.11952-1-f4bug@amsat.org> References: <20171006235023.11952-1-f4bug@amsat.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c09::243 Subject: [Qemu-devel] [PATCH 86/88] net/hub: use g_new() family of functions X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , qemu trival , =?utf-8?q?Philippe_Mathieu-Dau?= =?utf-8?b?ZMOp?= , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Philippe Mathieu-Daudé --- net/hub.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/hub.c b/net/hub.c index 14b4eec68f..1c403859c6 100644 --- a/net/hub.c +++ b/net/hub.c @@ -79,7 +79,7 @@ static NetHub *net_hub_new(int id) { NetHub *hub; - hub = g_malloc(sizeof(*hub)); + hub = g_new(NetHub, 1); hub->id = id; hub->num_ports = 0; QLIST_INIT(&hub->ports); From patchwork Fri Oct 6 23:50:22 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 822873 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="L/UnPKNW"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3y87Tf3cLgz9t5c for ; Sat, 7 Oct 2017 12:00:22 +1100 (AEDT) Received: from localhost ([::1]:47942 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e0dTY-0000Bs-GK for incoming@patchwork.ozlabs.org; Fri, 06 Oct 2017 21:00:20 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44170) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e0cSy-0002tT-0t for qemu-devel@nongnu.org; Fri, 06 Oct 2017 19:55:43 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e0cSw-0000FJ-W8 for qemu-devel@nongnu.org; Fri, 06 Oct 2017 19:55:39 -0400 Received: from mail-qk0-x244.google.com ([2607:f8b0:400d:c09::244]:38012) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1e0cSw-0000F3-Rp; Fri, 06 Oct 2017 19:55:38 -0400 Received: by mail-qk0-x244.google.com with SMTP id 17so5921231qkq.5; Fri, 06 Oct 2017 16:55:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=8c7UQTAh9LncmhfNgIt240iZOVslV3OpF0A8DvzglnQ=; b=L/UnPKNWFARH8mk7+zBDwc4zXwkN+ytvg2sbrFluO5CZsvMpkWrDC/lISxZN1eMW/Z LfhtVoyujHRbFS5aURkEEWCX0um9ZOJLDS51iw2YlJgMUaojpju6df5WfF3QAwbP25jk ga6uGZNWBU/fBBCaosZ3g+kkL55qnZSkk2eqeURImw5VoYb1fTbFGei5ICUZGJ9C9o6Z +tTky19UXhebQHQqZEIXSN5H6J7fARsrUIo5EiU6ACAYmMSOqi64QanbSYKiBKcjDBRi DgPOjgehqI0BMhQXQB3EzD5J77pca7FrpcYRD1Y+3/iFtA1kEV5PX0lbiyJBXEv7D0Kx 2h8g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=8c7UQTAh9LncmhfNgIt240iZOVslV3OpF0A8DvzglnQ=; b=g7vtUy/aJ0cT9QSy4vPDNVgF3zEAwN6xOaFJ6DdHdX7I331jVnaA6DP1TSdxzVuHFF Oyi3F3tTWIgrGA2QqBobFGFo47q2PAuj/jyyzdvzJxhLGnUlDDPV0VxcazG6tkI04eef BUu6yo43InDzhmGKbtBJzN+FXU2WP73n4Pa3kF4zDslaQde0C+MVM+M15GBzn1d0ekGx y4VruQTcdRabWPOXZO+MAAQcqvrp4PdHA5JHabZxG9X8QuAObIdVn4Y8TB3wjHpmbxZJ twyD6GcZg2Dk9Oj1dpVqQSYk4qppMhm15rWJlNF2fZnqbkvYch5csvYmgg8HkmkHRSav iBPw== X-Gm-Message-State: AMCzsaUsmZzmgSyEm85NscltI2GWemRTsc01uK5kVIcJYmY3ATZMieEK q6RSBRVx7r0fGX1pC75Cmns= X-Google-Smtp-Source: AOwi7QC+mZ397n0gMeBeTQjOk0icVgGnBjiN5U2mK/n9A6ybvWAiK8077V/4eHjk07jzmht+PfXDVA== X-Received: by 10.55.22.38 with SMTP id g38mr735669qkh.98.1507334138316; Fri, 06 Oct 2017 16:55:38 -0700 (PDT) Received: from yoga.lan ([181.93.89.178]) by smtp.gmail.com with ESMTPSA id g1sm1705226qta.95.2017.10.06.16.55.35 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 06 Oct 2017 16:55:37 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Markus Armbruster , Eric Blake , Jiri Pirko , Jason Wang Date: Fri, 6 Oct 2017 20:50:22 -0300 Message-Id: <20171006235023.11952-88-f4bug@amsat.org> X-Mailer: git-send-email 2.14.2 In-Reply-To: <20171006235023.11952-1-f4bug@amsat.org> References: <20171006235023.11952-1-f4bug@amsat.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c09::244 Subject: [Qemu-devel] [PATCH 87/88] hw/net/rocker: use g_new() family of functions X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , qemu trival , =?utf-8?q?Philippe_Mathieu-Dau?= =?utf-8?b?ZMOp?= , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Philippe Mathieu-Daudé --- hw/net/rocker/rocker_of_dpa.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/net/rocker/rocker_of_dpa.c b/hw/net/rocker/rocker_of_dpa.c index 191a58e0a7..990f4157a0 100644 --- a/hw/net/rocker/rocker_of_dpa.c +++ b/hw/net/rocker/rocker_of_dpa.c @@ -2306,7 +2306,7 @@ static void of_dpa_flow_fill(void *cookie, void *value, void *user_data) return; } - new = g_malloc0(sizeof(*new)); + new = g_new0(RockerOfDpaFlowList, 1); nflow = new->value = g_malloc0(sizeof(*nflow)); nkey = nflow->key = g_malloc0(sizeof(*nkey)); nmask = nflow->mask = g_malloc0(sizeof(*nmask)); @@ -2478,7 +2478,7 @@ static void of_dpa_group_fill(void *key, void *value, void *user_data) return; } - new = g_malloc0(sizeof(*new)); + new = g_new0(RockerOfDpaGroupList, 1); ngroup = new->value = g_malloc0(sizeof(*ngroup)); ngroup->id = group->id; From patchwork Fri Oct 6 23:50:23 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 822874 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="DVxtH/xi"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3y87Wn0hsKz9t6D for ; Sat, 7 Oct 2017 12:02:13 +1100 (AEDT) Received: from localhost ([::1]:47962 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e0dVL-0001rE-8V for incoming@patchwork.ozlabs.org; Fri, 06 Oct 2017 21:02:11 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44198) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e0cT1-0002wS-7D for qemu-devel@nongnu.org; Fri, 06 Oct 2017 19:55:44 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e0cSz-0000HK-NL for qemu-devel@nongnu.org; Fri, 06 Oct 2017 19:55:43 -0400 Received: from mail-qt0-x244.google.com ([2607:f8b0:400d:c0d::244]:56021) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1e0cSz-0000Gw-J0; Fri, 06 Oct 2017 19:55:41 -0400 Received: by mail-qt0-x244.google.com with SMTP id x54so34283607qth.12; Fri, 06 Oct 2017 16:55:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=i/6EaQU2DazTGsvn8FNKLl7F6RqsZbNvTIFrOmOr+EA=; b=DVxtH/xiU5Dznj7amLB6z0IbMAVQn2YDqTE3B2S95ekFanJxgeoAYqlglpYgsI+a3s Yo/R9bYnHXeOgcwm4mByU7/Qdq923403+nrSLuGhQwXptG/wmnB0GRFAqyih3y51FAQt 22x6TLORJw3WuTdUvwvr0IvfH/pR8rZzxXJNpReLSaEI8S3UE4+cjjiVeiWgY+XNtme+ zyp2lT6L9nMaXIn6YuAzYW+cli0ds10bkcYGNwMxFNboIWJ/ybiJULCUcUBnxZ6lgG2w rx9pZAgevf+vZhKHGWVUcsZvJNv/NxMDVLNhjFLgjcUfQMb3IYwLb7Ql/WHTxrmKInE1 Nqeg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=i/6EaQU2DazTGsvn8FNKLl7F6RqsZbNvTIFrOmOr+EA=; b=C28Hvh++pZIMX5vzVfu15dn9w6fgPd68Z5YODBCD3QiDZWPWbQqSg7qPZO329uOwK0 7qHkrNf+Rnd4L55RafEf3Qj3OAQtjpFFqWVHN7GTv2q/mNw7+fmuFZAvjRj0B5BZ2LhI n4A0IgHg8bgkupRYQ2d2fE+sshg6KHgZZyej65bGbmxOPU8DDjB2mBObLuCuqdF+Wlrd xuvjZZ8MhyTk7UpRAPkPCtJ/8gSTiCtEP51b1+UTses+8xOqxE+kGgk1OVdp4MmM5pjB 2KNe5qppzfP2SJNq9THayUwaTfE+YwaTdJeUuXjkTv56zbtfIc0wGqAUqS0Ns2xHSfOI gPYg== X-Gm-Message-State: AMCzsaUbq3LxW8nHhN/91iTWFV3g476m11xbnGUMOzAycEoJDZ3fRPAu XjE+S0akoMrB316uhnUrjWw= X-Google-Smtp-Source: AOwi7QAI8uqct77/jThLrx9NW9BUALSl9HIU8yyzuIQqjXdzELTSlXlWes2jHz8CeYAUaBDsHS4lbw== X-Received: by 10.200.33.235 with SMTP id 40mr5333862qtz.185.1507334141090; Fri, 06 Oct 2017 16:55:41 -0700 (PDT) Received: from yoga.lan ([181.93.89.178]) by smtp.gmail.com with ESMTPSA id g1sm1705226qta.95.2017.10.06.16.55.38 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 06 Oct 2017 16:55:40 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Markus Armbruster , Eric Blake Date: Fri, 6 Oct 2017 20:50:23 -0300 Message-Id: <20171006235023.11952-89-f4bug@amsat.org> X-Mailer: git-send-email 2.14.2 In-Reply-To: <20171006235023.11952-1-f4bug@amsat.org> References: <20171006235023.11952-1-f4bug@amsat.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c0d::244 Subject: [Qemu-devel] [PATCH 88/88] scripts/coverity-model: use g_new() family of functions X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , qemu trival , =?utf-8?q?Philippe_Mathieu-Dau?= =?utf-8?b?ZMOp?= , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Philippe Mathieu-Daudé --- scripts/coverity-model.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/coverity-model.c b/scripts/coverity-model.c index c702804f41..de07bffb57 100644 --- a/scripts/coverity-model.c +++ b/scripts/coverity-model.c @@ -363,7 +363,7 @@ int g_poll (GPollFD *fds, unsigned nfds, int timeout) typedef struct _GIOChannel GIOChannel; GIOChannel *g_io_channel_unix_new(int fd) { - GIOChannel *c = g_malloc0(sizeof(GIOChannel)); + GIOChannel *c = g_new0(GIOChannel, 1); __coverity_escape__(fd); return c; }