From nobody Tue Feb 10 23:00:51 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 1507336889590754.7683949320761; Fri, 6 Oct 2017 17:41:29 -0700 (PDT) Received: from localhost ([::1]:47815 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e0dBI-0000xS-PZ for importer@patchew.org; Fri, 06 Oct 2017 20:41:28 -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) 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) 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) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , 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 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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=20Mathieu-Daud=C3=A9?= , qemu-ppc@nongnu.org, =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 From: Marc-Andr=C3=A9 Lureau Signed-off-by: Marc-Andr=C3=A9 Lureau Signed-off-by: Philippe Mathieu-Daud=C3=A9 [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 =3D ppc_env_get_cpu(env); ppc_tb_t *tb_env; =20 - tb_env =3D g_malloc0(sizeof(ppc_tb_t)); + tb_env =3D g_new0(ppc_tb_t, 1); env->tb_env =3D tb_env; tb_env->flags =3D 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; =20 - tb_env =3D g_malloc0(sizeof(ppc_tb_t)); + tb_env =3D g_new0(ppc_tb_t, 1); env->tb_env =3D tb_env; tb_env->flags =3D PPC_DECR_UNDERFLOW_TRIGGERED; - ppc40x_timer =3D g_malloc0(sizeof(ppc40x_timer_t)); + ppc40x_timer =3D g_new0(ppc40x_timer_t, 1); tb_env->tb_freq =3D freq; tb_env->decr_freq =3D freq; tb_env->opaque =3D ppc40x_timer; @@ -1332,7 +1332,7 @@ int ppc_dcr_init (CPUPPCState *env, int (*read_error)= (int dcrn), { ppc_dcr_t *dcr_env; =20 - dcr_env =3D g_malloc0(sizeof(ppc_dcr_t)); + dcr_env =3D g_new0(ppc_dcr_t, 1); dcr_env->read_error =3D read_error; dcr_env->write_error =3D write_error; env->dcr_env =3D 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 fr= eq, uint32_t flags) booke_timer_t *booke_timer; int ret =3D 0; =20 - tb_env =3D g_malloc0(sizeof(ppc_tb_t)); - booke_timer =3D g_malloc0(sizeof(booke_timer_t)); + tb_env =3D g_new0(ppc_tb_t, 1); + booke_timer =3D g_new0(booke_timer_t, 1); =20 cpu->env.tb_env =3D tb_env; tb_env->flags =3D 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(voi= d) if (kvm_vm_ioctl(s, KVM_PPC_GET_RMMU_INFO, &rmmu_info)) { return NULL; } - radix_page_info =3D g_malloc0(sizeof(*radix_page_info)); + radix_page_info =3D g_new0(struct ppc_radix_page_info, 1); radix_page_info->count =3D 0; for (i =3D 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 *=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 */ @@ -10442,11 +10442,11 @@ static void ppc_cpu_defs_entry(gpointer data, gpo= inter user_data) } =20 typename =3D object_class_get_name(oc); - info =3D g_malloc0(sizeof(*info)); + info =3D g_new0(CpuDefinitionInfo, 1); info->name =3D g_strndup(typename, strlen(typename) - strlen(POWERPC_CPU_TYPE_SUFF= IX)); =20 - entry =3D g_malloc0(sizeof(*entry)); + entry =3D g_new0(CpuDefinitionInfoList, 1); entry->value =3D info; entry->next =3D *first; *first =3D entry; @@ -10473,11 +10473,11 @@ CpuDefinitionInfoList *arch_query_cpu_definitions= (Error **errp) continue; } =20 - info =3D g_malloc0(sizeof(*info)); + info =3D g_new0(CpuDefinitionInfo, 1); info->name =3D g_strdup(alias->alias); info->q_typename =3D g_strdup(object_class_get_name(oc)); =20 - entry =3D g_malloc0(sizeof(*entry)); + entry =3D g_new0(CpuDefinitionInfoList, 1); entry->value =3D info; entry->next =3D cpu_list; cpu_list =3D entry; --=20 2.14.2