From: Pierrick Bouvier <pierrick.bouvier@linaro.org>
To: qemu-devel@nongnu.org
Cc: "Palmer Dabbelt" <palmer@dabbelt.com>,
"Alistair Francis" <alistair.francis@wdc.com>,
"Hyman Huang" <yong.huang@smartx.com>,
"Halil Pasic" <pasic@linux.ibm.com>,
kvm@vger.kernel.org, "Bin Meng" <bmeng.cn@gmail.com>,
"Peter Xu" <peterx@redhat.com>,
"Liu Zhiwei" <zhiwei_liu@linux.alibaba.com>,
"David Gibson" <david@gibson.dropbear.id.au>,
"Daniel Henrique Barboza" <dbarboza@ventanamicro.com>,
qemu-s390x@nongnu.org,
"Dmitry Fleytman" <dmitry.fleytman@gmail.com>,
"Hanna Reitz" <hreitz@redhat.com>,
"Klaus Jensen" <its@irrelevant.dk>,
"Corey Minyard" <minyard@acm.org>,
"Laurent Vivier" <laurent@vivier.eu>,
"WANG Xuerui" <git@xen0n.name>, "Thomas Huth" <thuth@redhat.com>,
"Rob Herring" <robh@kernel.org>,
"Eduardo Habkost" <eduardo@habkost.net>,
"Nicholas Piggin" <npiggin@gmail.com>,
"Michael S. Tsirkin" <mst@redhat.com>,
"Harsh Prateek Bora" <harshpb@linux.ibm.com>,
"Maciej S. Szmigiero" <maciej.szmigiero@oracle.com>,
"Ani Sinha" <anisinha@redhat.com>,
"Stefan Berger" <stefanb@linux.vnet.ibm.com>,
"Fam Zheng" <fam@euphon.net>,
"Laurent Vivier" <lvivier@redhat.com>,
"Paolo Bonzini" <pbonzini@redhat.com>,
"Daniel P. Berrangé" <berrange@redhat.com>,
"Richard Henderson" <richard.henderson@linaro.org>,
"Philippe Mathieu-Daudé" <philmd@linaro.org>,
"Keith Busch" <kbusch@kernel.org>,
"Jean-Christophe Dubois" <jcd@tribudubois.net>,
qemu-riscv@nongnu.org, "Igor Mammedov" <imammedo@redhat.com>,
"Akihiko Odaki" <akihiko.odaki@daynix.com>,
"Sriram Yagnaraman" <sriram.yagnaraman@ericsson.com>,
"Jason Wang" <jasowang@redhat.com>,
"Eric Farman" <farman@linux.ibm.com>,
"Richard W.M. Jones" <rjones@redhat.com>,
"Marc-André Lureau" <marcandre.lureau@redhat.com>,
"Nina Schoetterl-Glausch" <nsg@linux.ibm.com>,
"Aurelien Jarno" <aurelien@aurel32.net>,
"Markus Armbruster" <armbru@redhat.com>,
"Alex Bennée" <alex.bennee@linaro.org>,
"Fabiano Rosas" <farosas@suse.de>,
"Marcel Apfelbaum" <marcel.apfelbaum@gmail.com>,
qemu-arm@nongnu.org,
"Christian Borntraeger" <borntraeger@linux.ibm.com>,
qemu-ppc@nongnu.org, "Zhao Liu" <zhao1.liu@intel.com>,
"Daniel Henrique Barboza" <danielhb413@gmail.com>,
qemu-block@nongnu.org, "Joel Stanley" <joel@jms.id.au>,
"Weiwei Li" <liwei1518@gmail.com>,
"Kevin Wolf" <kwolf@redhat.com>, "Helge Deller" <deller@gmx.de>,
"Yanan Wang" <wangyanan55@huawei.com>,
"Michael Rolnik" <mrolnik@gmail.com>,
"Jesper Devantier" <foss@defmacro.it>,
"Marcelo Tosatti" <mtosatti@redhat.com>,
"Peter Maydell" <peter.maydell@linaro.org>,
"Pierrick Bouvier" <pierrick.bouvier@linaro.org>
Subject: [PATCH v3 06/34] target/ppc: replace assert(0) with g_assert_not_reached()
Date: Wed, 18 Sep 2024 21:46:13 -0700 [thread overview]
Message-ID: <20240919044641.386068-7-pierrick.bouvier@linaro.org> (raw)
In-Reply-To: <20240919044641.386068-1-pierrick.bouvier@linaro.org>
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 <richard.henderson@linaro.org>
Reviewed-by: Daniel Henrique Barboza <dbarboza@ventanamicro.com>
Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
---
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);
--
2.39.5
next prev parent reply other threads:[~2024-09-19 4:55 UTC|newest]
Thread overview: 36+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-09-19 4:46 [PATCH v3 00/34] Use g_assert_not_reached instead of (g_)assert(0, false) Pierrick Bouvier
2024-09-19 4:46 ` [PATCH v3 01/34] hw/acpi: replace assert(0) with g_assert_not_reached() Pierrick Bouvier
2024-09-19 4:46 ` [PATCH v3 02/34] hw/arm: " Pierrick Bouvier
2024-09-19 4:46 ` [PATCH v3 03/34] hw/net: " Pierrick Bouvier
2024-09-19 4:46 ` [PATCH v3 04/34] migration: " Pierrick Bouvier
2024-09-19 4:46 ` [PATCH v3 05/34] qobject: " Pierrick Bouvier
2024-09-19 4:46 ` Pierrick Bouvier [this message]
2024-09-19 4:46 ` [PATCH v3 07/34] block: replace assert(false) " Pierrick Bouvier
2024-09-19 4:46 ` [PATCH v3 08/34] hw/hyperv: " Pierrick Bouvier
2024-09-19 4:46 ` [PATCH v3 09/34] hw/net: " Pierrick Bouvier
2024-09-19 4:46 ` [PATCH v3 10/34] hw/nvme: " Pierrick Bouvier
2024-09-19 4:46 ` [PATCH v3 11/34] hw/pci: " Pierrick Bouvier
2024-09-19 4:46 ` [PATCH v3 12/34] hw/ppc: " Pierrick Bouvier
2024-09-19 4:46 ` [PATCH v3 13/34] migration: " Pierrick Bouvier
2024-09-19 4:46 ` [PATCH v3 14/34] target/i386/kvm: " Pierrick Bouvier
2024-09-19 4:46 ` [PATCH v3 15/34] accel/tcg: remove break after g_assert_not_reached() Pierrick Bouvier
2024-09-19 4:46 ` [PATCH v3 16/34] block: " Pierrick Bouvier
2024-09-19 4:46 ` [PATCH v3 17/34] hw/acpi: " Pierrick Bouvier
2024-09-19 4:46 ` [PATCH v3 18/34] hw/net: " Pierrick Bouvier
2024-09-19 4:46 ` [PATCH v3 19/34] hw/scsi: " Pierrick Bouvier
2024-09-19 4:46 ` [PATCH v3 20/34] hw/tpm: " Pierrick Bouvier
2024-09-19 4:46 ` [PATCH v3 21/34] target/arm: " Pierrick Bouvier
2024-09-19 4:46 ` [PATCH v3 22/34] target/riscv: " Pierrick Bouvier
2024-09-19 4:46 ` [PATCH v3 23/34] fpu: " Pierrick Bouvier
2024-09-19 4:46 ` [PATCH v3 24/34] tcg/loongarch64: " Pierrick Bouvier
2024-09-19 4:46 ` [PATCH v3 25/34] include/qemu: remove return " Pierrick Bouvier
2024-09-19 4:46 ` [PATCH v3 26/34] hw/hyperv: " Pierrick Bouvier
2024-09-19 4:46 ` [PATCH v3 27/34] hw/net: " Pierrick Bouvier
2024-09-19 4:46 ` [PATCH v3 28/34] hw/pci: " Pierrick Bouvier
2024-09-19 4:46 ` [PATCH v3 29/34] hw/ppc: " Pierrick Bouvier
2024-09-19 4:46 ` [PATCH v3 30/34] migration: " Pierrick Bouvier
2024-09-24 11:52 ` Thomas Huth
2024-09-19 4:46 ` [PATCH v3 31/34] qobject: " Pierrick Bouvier
2024-09-19 4:46 ` [PATCH v3 32/34] qom: " Pierrick Bouvier
2024-09-19 4:46 ` [PATCH v3 33/34] tests/qtest: " Pierrick Bouvier
2024-09-19 4:46 ` [PATCH v3 34/34] scripts/checkpatch.pl: emit error when using assert(false) Pierrick Bouvier
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240919044641.386068-7-pierrick.bouvier@linaro.org \
--to=pierrick.bouvier@linaro.org \
--cc=akihiko.odaki@daynix.com \
--cc=alex.bennee@linaro.org \
--cc=alistair.francis@wdc.com \
--cc=anisinha@redhat.com \
--cc=armbru@redhat.com \
--cc=aurelien@aurel32.net \
--cc=berrange@redhat.com \
--cc=bmeng.cn@gmail.com \
--cc=borntraeger@linux.ibm.com \
--cc=danielhb413@gmail.com \
--cc=david@gibson.dropbear.id.au \
--cc=dbarboza@ventanamicro.com \
--cc=deller@gmx.de \
--cc=dmitry.fleytman@gmail.com \
--cc=eduardo@habkost.net \
--cc=fam@euphon.net \
--cc=farman@linux.ibm.com \
--cc=farosas@suse.de \
--cc=foss@defmacro.it \
--cc=git@xen0n.name \
--cc=harshpb@linux.ibm.com \
--cc=hreitz@redhat.com \
--cc=imammedo@redhat.com \
--cc=its@irrelevant.dk \
--cc=jasowang@redhat.com \
--cc=jcd@tribudubois.net \
--cc=joel@jms.id.au \
--cc=kbusch@kernel.org \
--cc=kvm@vger.kernel.org \
--cc=kwolf@redhat.com \
--cc=laurent@vivier.eu \
--cc=liwei1518@gmail.com \
--cc=lvivier@redhat.com \
--cc=maciej.szmigiero@oracle.com \
--cc=marcandre.lureau@redhat.com \
--cc=marcel.apfelbaum@gmail.com \
--cc=minyard@acm.org \
--cc=mrolnik@gmail.com \
--cc=mst@redhat.com \
--cc=mtosatti@redhat.com \
--cc=npiggin@gmail.com \
--cc=nsg@linux.ibm.com \
--cc=palmer@dabbelt.com \
--cc=pasic@linux.ibm.com \
--cc=pbonzini@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=peterx@redhat.com \
--cc=philmd@linaro.org \
--cc=qemu-arm@nongnu.org \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=qemu-ppc@nongnu.org \
--cc=qemu-riscv@nongnu.org \
--cc=qemu-s390x@nongnu.org \
--cc=richard.henderson@linaro.org \
--cc=rjones@redhat.com \
--cc=robh@kernel.org \
--cc=sriram.yagnaraman@ericsson.com \
--cc=stefanb@linux.vnet.ibm.com \
--cc=thuth@redhat.com \
--cc=wangyanan55@huawei.com \
--cc=yong.huang@smartx.com \
--cc=zhao1.liu@intel.com \
--cc=zhiwei_liu@linux.alibaba.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).