From nobody Mon Feb 9 17:24:10 2026 Delivered-To: importer@patchew.org Received-SPF: temperror (zoho.com: Error in retrieving data from DNS) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=temperror (zoho.com: Error in retrieving data from DNS) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (208.118.235.17 [208.118.235.17]) by mx.zohomail.com with SMTPS id 1544673842999309.9606816304679; Wed, 12 Dec 2018 20:04:02 -0800 (PST) Received: from localhost ([::1]:50183 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gXIDy-0005P9-3D for importer@patchew.org; Wed, 12 Dec 2018 23:03:46 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50482) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gXIBz-0003Yr-EU for qemu-devel@nongnu.org; Wed, 12 Dec 2018 23:01:44 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gXIBv-0001uf-G9 for qemu-devel@nongnu.org; Wed, 12 Dec 2018 23:01:41 -0500 Received: from ozlabs.org ([2401:3900:2:1::2]:34413) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gXIBr-0001p8-Ip; Wed, 12 Dec 2018 23:01:37 -0500 Received: by ozlabs.org (Postfix, from userid 1007) id 43Fg3H365mz9sBZ; Thu, 13 Dec 2018 15:01:31 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gibson.dropbear.id.au; s=201602; t=1544673691; bh=uNrC3hXh5GRmyW6N42jjC9H9t5B9xyZuF5WeV8dzi9I=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=VkfdBY4bgGtbTdaRZyl4Hxr3hnUia53G4zkB7rmw09rT6fqug673eiqgd/JZWCyCt 9I0W2feMyh0AEOp/52pyv90Z99wFNXgnwSKIf0+TUrzCIaZtDrLd/aa5c5lOH9edY9 Xa/ENH2DZrpNZVddVYIhXD1ntwcFG3AKkuRVirB8= From: David Gibson To: peter.maydell@linaro.org Date: Thu, 13 Dec 2018 15:01:03 +1100 Message-Id: <20181213040126.6768-5-david@gibson.dropbear.id.au> X-Mailer: git-send-email 2.19.2 In-Reply-To: <20181213040126.6768-1-david@gibson.dropbear.id.au> References: <20181213040126.6768-1-david@gibson.dropbear.id.au> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2401:3900:2:1::2 Subject: [Qemu-devel] [PULL 04/27] target/ppc: use g_new(T, n) instead of g_malloc(sizeof(T) * n) 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: lvivier@redhat.com, gkurz@kaod.org, qemu-devel@nongnu.org, Greg Kurz , spopovyc@redhat.com, qemu-ppc@nongnu.org, clg@kaod.org, David Gibson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" From: Greg Kurz Because it is a recommended coding practice (see HACKING). Signed-off-by: Greg Kurz Reviewed-by: Philippe Mathieu-Daud=C3=A9 Signed-off-by: David Gibson --- target/ppc/translate_init.inc.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/target/ppc/translate_init.inc.c b/target/ppc/translate_init.in= c.c index 168d0cec28..03f1d34a97 100644 --- a/target/ppc/translate_init.inc.c +++ b/target/ppc/translate_init.inc.c @@ -9081,13 +9081,13 @@ static void init_ppc_proc(PowerPCCPU *cpu) nb_tlb *=3D 2; switch (env->tlb_type) { case TLB_6XX: - env->tlb.tlb6 =3D g_malloc0(nb_tlb * sizeof(ppc6xx_tlb_t)); + env->tlb.tlb6 =3D g_new0(ppc6xx_tlb_t, nb_tlb); break; case TLB_EMB: - env->tlb.tlbe =3D g_malloc0(nb_tlb * sizeof(ppcemb_tlb_t)); + env->tlb.tlbe =3D g_new0(ppcemb_tlb_t, nb_tlb); break; case TLB_MAS: - env->tlb.tlbm =3D g_malloc0(nb_tlb * sizeof(ppcmas_tlb_t)); + env->tlb.tlbm =3D g_new0(ppcmas_tlb_t, nb_tlb); break; } /* Pre-compute some useful values */ --=20 2.19.2