From nobody Tue Feb 10 02:42:49 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) 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=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1545371531640215.4176284711947; Thu, 20 Dec 2018 21:52:11 -0800 (PST) Received: from localhost ([::1]:42399 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gaDjG-0004SM-3t for importer@patchew.org; Fri, 21 Dec 2018 00:52:10 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59996) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gaDdi-0000Wd-MP for qemu-devel@nongnu.org; Fri, 21 Dec 2018 00:46:27 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gaDdg-000719-Iz for qemu-devel@nongnu.org; Fri, 21 Dec 2018 00:46:26 -0500 Received: from ozlabs.org ([203.11.71.1]:58301) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gaDdf-0006t1-E9; Fri, 21 Dec 2018 00:46:24 -0500 Received: by ozlabs.org (Postfix, from userid 1007) id 43Ld0M2MbXz9sDL; Fri, 21 Dec 2018 16:46:11 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gibson.dropbear.id.au; s=201602; t=1545371171; bh=uNrC3hXh5GRmyW6N42jjC9H9t5B9xyZuF5WeV8dzi9I=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=lRw/3ZPiBNCxe1nu7qU87ZvsAVAyZh0Hm7AuMJY4GSiGejO5BsimSxYE3aVy/+mlg RdKq16Sn2Me2rKTgdhrML8xawJu942BOlLN2RVYxsyFBeDpQyU56eJdCUhDM2tyNd8 6ftO4XQx0yydOeZ0ZrKMB5VWAw/oxsPP/DcxhCgA= From: David Gibson To: peter.maydell@linaro.org Date: Fri, 21 Dec 2018 16:45:32 +1100 Message-Id: <20181221054606.22007-7-david@gibson.dropbear.id.au> X-Mailer: git-send-email 2.19.2 In-Reply-To: <20181221054606.22007-1-david@gibson.dropbear.id.au> References: <20181221054606.22007-1-david@gibson.dropbear.id.au> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 203.11.71.1 Subject: [Qemu-devel] [PULL 06/40] 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: gkurz@redhat.com, lvivier@redhat.com, Greg Kurz , qemu-devel@nongnu.org, 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