From patchwork Thu Sep 12 07:38:44 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pierrick Bouvier X-Patchwork-Id: 13801589 Received: from mail-il1-f177.google.com (mail-il1-f177.google.com [209.85.166.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 05B261922E3 for ; Thu, 12 Sep 2024 07:39:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.177 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1726126797; cv=none; b=IzjqKDFOKeRbRX5ACJFeZnrv6ZnwVwhfHuPfifb5CWnE319INgBJAhHYlOKvvE2pHQ7wER2Of2iFgmgyKElMXXLdfdP0dD1ypl91rBXXYXPHafiuEAyAhEdbrsqK1Dvse0ekFBUkW9S0RdaBNuhfHzf8efV+qmvNLfFc4BG3xqg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1726126797; c=relaxed/simple; bh=pj3bjl3Vf5F9ih6rboeaqBqp2b5Xf0xp4CoCS2JVczo=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=CRJoiXKTZlcjZj/zACyKaNs6x7eo5taBTvtUXi6ntpUTmDvv/vvd9oajN0m5eQKt1NEPKndKSnWR2IW7AvAf2kQcaLtn1qnBDkoGUH28OH4i/lkEn2tvBiYejSoXsObnZ6/WMiS26NCgrUsPA08PFmlyWnU3oNI2VZ7ooWkOuuM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=VFMqX8sz; arc=none smtp.client-ip=209.85.166.177 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="VFMqX8sz" Received: by mail-il1-f177.google.com with SMTP id e9e14a558f8ab-3a043496fdeso2521505ab.3 for ; Thu, 12 Sep 2024 00:39:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1726126795; x=1726731595; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=gl+JcJWeB9n4U9owGQI4EbvNVAnzvdcJPjSOFH/LTqM=; b=VFMqX8szMpbxOfvzQM7ClVOsJN8XTTvrzJZXxwn+8mRPYmzIoFUJjw2ErznswgfJZ5 6Wm1X3k7VKLhRZxLaG//U2YYpOnqmnnJN8AKej2mRpQKgupl4OgOeC9ANAtc5ae3D1+F j0OuWE60MdsGB6EhCOidV4HiUjzLQyUYyHvriS8LwX2uKMiYMpxqSnMjI8f59F8fzarW CyI12CTD33KeENnFPIl/C2z4LLsrrJR/ZA7qKkODgF2cI0sBzujZBjx0fPKHQqiEJIFP +lurbUKGCiMbQufFAD8pQJmbIYrFb6G6doStIm4/3RZNGxc5WwJYHkOGcYzAeJS0Gsa2 RTIQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1726126795; x=1726731595; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=gl+JcJWeB9n4U9owGQI4EbvNVAnzvdcJPjSOFH/LTqM=; b=aJ9i1/rAey8AfTaEc9V54nRY+OpZqbxoUtR49+Bg8qqQIDo/ZfYFBVLYuRn9MyMK4k 5UZCHhhlorwHuxy3bKEUCf+1ldVjHF0zgNOtoIPcILXk2PrrtJHQjBYLm20e/Qkm7u4d yx+lVhp994MFb1iZjnT2iMjnq26RDaCUCVfZwh25HXYJxxOkGekD/KkayhbahtwLkcs/ frCX2fLkH5RFXuE0A2spuTdwhUVDMYSjSNUzvS7dJ7R3Gw8z2HLniO5JeBMY/3EzDNCa dvPOtH17buKEVF0zq+qjwWGNPCuIa0W7Bd9Dfdg5RR8RDXC1KQ/s8OeMSrwYM7BmbbXz 1I2g== X-Forwarded-Encrypted: i=1; AJvYcCXw4BTT7INKB/07BiILU5+BxwOZgS+liDYQOnp/5ol2w4zUbd2uaCBftn45M0Dju7dFCNM=@vger.kernel.org X-Gm-Message-State: AOJu0Yzj4EOEat9BHrzR/cmhfZlw43MdGyjhD6tlI+/9IHtsjdjrVg6v UUPH7xViTffvp5EpxYP3aZ/yzu8mo/4A0dOEVJAdWGXnovWwVbcASApKcxQP68g= X-Google-Smtp-Source: AGHT+IFc2U5w+P2/p0zo+AVbvStN+97kW37ZvG1bComHgG1CrEqJE1viLz5YY6RVesmsw9//+xNbnQ== X-Received: by 2002:a05:6e02:1806:b0:3a0:1828:31d9 with SMTP id e9e14a558f8ab-3a0849736d4mr17121295ab.24.1726126795091; Thu, 12 Sep 2024 00:39:55 -0700 (PDT) Received: from linaro.vn.shawcable.net ([2604:3d08:9384:1d00::9633]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-7db1fb9ad87sm983458a12.6.2024.09.12.00.39.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 Sep 2024 00:39:54 -0700 (PDT) From: Pierrick Bouvier To: qemu-devel@nongnu.org Cc: Jason Wang , =?utf-8?q?Alex_Benn=C3=A9e?= , Laurent Vivier , Marcelo Tosatti , Nicholas Piggin , Klaus Jensen , WANG Xuerui , Halil Pasic , Rob Herring , Michael Rolnik , Zhao Liu , Peter Maydell , Richard Henderson , Fabiano Rosas , Corey Minyard , Keith Busch , Thomas Huth , "Maciej S. Szmigiero" , Harsh Prateek Bora , Kevin Wolf , Paolo Bonzini , Jesper Devantier , Hyman Huang , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Palmer Dabbelt , qemu-s390x@nongnu.org, Laurent Vivier , qemu-riscv@nongnu.org, "Richard W.M. Jones" , Liu Zhiwei , Aurelien Jarno , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Marcel Apfelbaum , kvm@vger.kernel.org, Christian Borntraeger , Akihiko Odaki , Daniel Henrique Barboza , Hanna Reitz , Ani Sinha , qemu-ppc@nongnu.org, =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Alistair Francis , Bin Meng , "Michael S. Tsirkin" , Helge Deller , Peter Xu , Daniel Henrique Barboza , Dmitry Fleytman , Nina Schoetterl-Glausch , Yanan Wang , qemu-arm@nongnu.org, Igor Mammedov , Jean-Christophe Dubois , Eric Farman , Sriram Yagnaraman , qemu-block@nongnu.org, Stefan Berger , Joel Stanley , Eduardo Habkost , David Gibson , Fam Zheng , Weiwei Li , Markus Armbruster , Pierrick Bouvier Subject: [PATCH v2 11/48] target/ppc: replace assert(0) with g_assert_not_reached() Date: Thu, 12 Sep 2024 00:38:44 -0700 Message-Id: <20240912073921.453203-12-pierrick.bouvier@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240912073921.453203-1-pierrick.bouvier@linaro.org> References: <20240912073921.453203-1-pierrick.bouvier@linaro.org> Precedence: bulk X-Mailing-List: kvm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 This patch is part of a series that moves towards a consistent use of g_assert_not_reached() rather than an ad hoc mix of different assertion mechanisms. Reviewed-by: Richard Henderson Reviewed-by: Daniel Henrique Barboza Signed-off-by: Pierrick Bouvier --- target/ppc/dfp_helper.c | 8 ++++---- target/ppc/mmu_helper.c | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/target/ppc/dfp_helper.c b/target/ppc/dfp_helper.c index 5967ea07a92..ecc3f793267 100644 --- a/target/ppc/dfp_helper.c +++ b/target/ppc/dfp_helper.c @@ -249,7 +249,7 @@ static void dfp_set_FPRF_from_FRT_with_context(struct PPC_DFP *dfp, fprf = 0x05; break; default: - assert(0); /* should never get here */ + g_assert_not_reached(); } dfp->env->fpscr &= ~FP_FPRF; dfp->env->fpscr |= (fprf << FPSCR_FPRF); @@ -1243,7 +1243,7 @@ void helper_##op(CPUPPCState *env, ppc_fprp_t *t, ppc_fprp_t *b) \ } else if (decNumberIsQNaN(&dfp.b)) { \ vt.VsrD(1) = -2; \ } else { \ - assert(0); \ + g_assert_not_reached(); \ } \ set_dfp64(t, &vt); \ } else { \ @@ -1252,7 +1252,7 @@ void helper_##op(CPUPPCState *env, ppc_fprp_t *t, ppc_fprp_t *b) \ } else if ((size) == 128) { \ vt.VsrD(1) = dfp.b.exponent + 6176; \ } else { \ - assert(0); \ + g_assert_not_reached(); \ } \ set_dfp64(t, &vt); \ } \ @@ -1300,7 +1300,7 @@ void helper_##op(CPUPPCState *env, ppc_fprp_t *t, ppc_fprp_t *a, \ raw_inf = 0x1e000; \ bias = 6176; \ } else { \ - assert(0); \ + g_assert_not_reached(); \ } \ \ if (unlikely((exp < 0) || (exp > max_exp))) { \ diff --git a/target/ppc/mmu_helper.c b/target/ppc/mmu_helper.c index b0a0676beba..b167b37e0ab 100644 --- a/target/ppc/mmu_helper.c +++ b/target/ppc/mmu_helper.c @@ -316,7 +316,7 @@ void ppc_tlb_invalidate_one(CPUPPCState *env, target_ulong addr) break; default: /* Should never reach here with other MMU models */ - assert(0); + g_assert_not_reached(); } #else ppc_tlb_invalidate_all(env);