From patchwork Thu Sep 19 04:46:13 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pierrick Bouvier X-Patchwork-Id: 13807332 Received: from mail-pf1-f175.google.com (mail-pf1-f175.google.com [209.85.210.175]) (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 49E401DA5F for ; Thu, 19 Sep 2024 04:46:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.175 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1726721220; cv=none; b=kKvXbjd8evGvE4//QVdOfKwRKcqph2icCKwUH7eMDogLdMXHM63rV8OnfRm6no8NUU054Mf/crVX/5ojLhaajnDsAQTIAjUel8lz7pFwZZu2vdRseg2nVcPkj5v5Bu2QMX7p2dRaL8vCZPZ7AurZ1uQFtPMbucgXkPA7gLb4UTU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1726721220; c=relaxed/simple; bh=TvBkxl3sPyM3OkZIVOPBq7un0pBRgonA2CllyHWAgfg=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=mhCSCGisqwASsbxeZ76JclMAWoBSrfbIi/Yr1NZG/MWAqWIavaSUbb6CAi/pUuT+9ZyqB4TBeFVfBFjhWgxDAS1wr9X48Bp4XbRM8N2VpMnos6kemg+X+3WhIJ+CjuPwtKIsUcdeaXA1DGXTtdKQdd4R9UDLE9JtvTB46DI5QYw= 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=iSkOo2ce; arc=none smtp.client-ip=209.85.210.175 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="iSkOo2ce" Received: by mail-pf1-f175.google.com with SMTP id d2e1a72fcca58-718e11e4186so381548b3a.2 for ; Wed, 18 Sep 2024 21:46:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1726721218; x=1727326018; 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=qqlshtAdWrkwK7VFTA+7O6AV+UQemh0VvOj30SlF0fo=; b=iSkOo2cexh8ntC+NjUkudjt2EU5iRJHSz2topYUtNjP8bbcgzC6qaDZBbG4U4Dwro8 zB9XRjNws+Q6VWa9/G5mPTkI2xdyEIYNmVOQ3EUh1WUW6cWZ8itybD/9AA9eecPp1F0+ GPia5xJCARHK/RkGnpG6sy/P3w6Q7Fvgm99c25UMQiLlhddJBF+MjmLk9X3hikd8akeP 7soeS7vhGADV6BhKzS46tXfH3QLxgfuV+IZ4pfo6P2ZbX+UbHJumKdL/PbIVZF82TcRj 4KR4Yrt02K8jonovg9r6ENa4/ihcF8IlTnXMfSWwcuvTkY6KN+nZqcsg3pvAHc8lxptz H94Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1726721218; x=1727326018; 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=qqlshtAdWrkwK7VFTA+7O6AV+UQemh0VvOj30SlF0fo=; b=raur8Dp1dewYvPLC4QwTwgQML+vXLjM1NutT18nWgMhoIxEBjv59rkwm3g8HzL3P8Y P4BgiJaVMOOW15YH6gd7mCKvVvqe1zkdUAIuUZIagQajBbsUWf7XwsEkvrJZKOpzKXBX LkkOy8G7HeaZVR1LMoosmIIWflImIhHlBmBRuxvhLcG7XueVMiAAe8CbY5Gv9udSn6p+ InrE1MMf8ZX87GPJP5VXrhwWMzQlHVRkrqgU9du1WcMv1AgMCABb6cTIqChKRdPyTVyy jCRcsioewvV+qRHBj5AOaxOkVkQwkF+QUI/QG+WLwAZvZKjs88hFDO1HJwB3x4WeThWk kxBQ== X-Forwarded-Encrypted: i=1; AJvYcCUQfibZ+vCduTDwlTlEPRha6zqUaNNqivZD5nMWu1s+Fk958h9+37UJSKMJ9em0TVeRflQ=@vger.kernel.org X-Gm-Message-State: AOJu0YyteFfmcqcKK7dA42wB0h3hS3raHgbRM+IGRjSpcppmp4PtmvqV hquzu2ufiDAv5MtbVhbHrpbTsAkXQFqyCpVVD/zh5Bc4a3gqqFokNTiOycVQi5w= X-Google-Smtp-Source: AGHT+IG0bmr1+1NNMTp9lkGEAqdgH7QtfGqFeAcXE6p0/9GQ6ISEzkrmQKWYgaOl03thN+dHJUIl8w== X-Received: by 2002:a05:6a00:2d11:b0:714:2198:26a1 with SMTP id d2e1a72fcca58-7192620d8d3mr36118214b3a.27.1726721218493; Wed, 18 Sep 2024 21:46:58 -0700 (PDT) Received: from linaro.. (216-180-64-156.dyn.novuscom.net. [216.180.64.156]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-71944bc279csm7478601b3a.188.2024.09.18.21.46.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Sep 2024 21:46:58 -0700 (PDT) From: Pierrick Bouvier To: qemu-devel@nongnu.org Cc: Palmer Dabbelt , Alistair Francis , Hyman Huang , Halil Pasic , kvm@vger.kernel.org, Bin Meng , Peter Xu , Liu Zhiwei , David Gibson , Daniel Henrique Barboza , qemu-s390x@nongnu.org, Dmitry Fleytman , Hanna Reitz , Klaus Jensen , Corey Minyard , Laurent Vivier , WANG Xuerui , Thomas Huth , Rob Herring , Eduardo Habkost , Nicholas Piggin , "Michael S. Tsirkin" , Harsh Prateek Bora , "Maciej S. Szmigiero" , Ani Sinha , Stefan Berger , Fam Zheng , Laurent Vivier , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Richard Henderson , =?utf-8?q?Philippe_Mathie?= =?utf-8?q?u-Daud=C3=A9?= , Keith Busch , Jean-Christophe Dubois , qemu-riscv@nongnu.org, Igor Mammedov , Akihiko Odaki , Sriram Yagnaraman , Jason Wang , Eric Farman , "Richard W.M. Jones" , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Nina Schoetterl-Glausch , Aurelien Jarno , Markus Armbruster , =?utf-8?q?Alex_Benn=C3=A9e?= , Fabiano Rosas , Marcel Apfelbaum , qemu-arm@nongnu.org, Christian Borntraeger , qemu-ppc@nongnu.org, Zhao Liu , Daniel Henrique Barboza , qemu-block@nongnu.org, Joel Stanley , Weiwei Li , Kevin Wolf , Helge Deller , Yanan Wang , Michael Rolnik , Jesper Devantier , Marcelo Tosatti , Peter Maydell , Pierrick Bouvier Subject: [PATCH v3 06/34] target/ppc: replace assert(0) with g_assert_not_reached() Date: Wed, 18 Sep 2024 21:46:13 -0700 Message-Id: <20240919044641.386068-7-pierrick.bouvier@linaro.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20240919044641.386068-1-pierrick.bouvier@linaro.org> References: <20240919044641.386068-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);