From patchwork Wed Sep 25 11:09:55 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Huth X-Patchwork-Id: 830463 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:1374:b0:367:895a:4699 with SMTP id q20csp686039wrz; Wed, 25 Sep 2024 04:16:19 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCXNig5kky49JngDiYfuSWmNBpdrT1ihDaU7nGK9Jwh3lQes6BLIIyIjIzP0He2bBuSlY8dgDw==@linaro.org X-Google-Smtp-Source: AGHT+IGutrnJl1mFuIab/Whwvysgjv3bLowAgYP2eauvY1udFDhME+UnP4S4o4mckQfD9YPd6uup X-Received: by 2002:a05:620a:f0d:b0:7a9:bb10:e072 with SMTP id af79cd13be357-7ace7401bc2mr333851285a.23.1727262979588; Wed, 25 Sep 2024 04:16:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1727262979; cv=none; d=google.com; s=arc-20240605; b=dyx8bJ4S/3s7uf2IcUF7vvCsv8kAJahzF6AJp5WtS1WH3TEWVc4Dq0oPU6Sjh+Z0qJ 6b4uC/LRfukG1obIrN/kQxIIQExHwJT3nTShb3JuOCEA7wrlV5aahTDar5/1mpnfmmy6 p6quZIjQR+WzVajfVYqtysu+h4tIG47iJAx54o1cnn7iL9xaJIpzvAg/BypXjoolD6BB iotb9obtQFL0B0toATnUN7YZ2JHP5jc6KNMSKPHOtuCx8/pWAY9O9dz53n41t1od9lLD 9EmPuplODDt7nUhN1Sc5hnXp74RMO6LofFaIFBvGWXpFlYNmuBX0tUHP/E/lLRGHCHZM hrlA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=FIaPitvZwBfLvSiAb1b7GqbCUaofsa86VJPizr+59Y4=; fh=W6xzREthpkPEW8tziq0xxHpztmQWB2zzpMc8Zy+HmrY=; b=VCb9vrNd+51QYxEB1KTsFQKqRxIE/IiFkSjyT6IgUyTJyDor5Igb6Gwl98WSJ4BWUC DzZLMlplAs4PHsLY39zhCZMrk16XbeeYiSZvubzjEzG0MvNGu6l7HoDrfrjhSQTHSKJg Un6Lve6uVdzf+gXklOtVLspnuZlpyK3Z9YOhp1c95L3EcqLvW49GufW54tamTwKway0E jJFhNIwIsdNGDTZ5R4hOC7/Y4+EUH3Pn3LF5rC257JR8UjAfmxzBiquFaqBLcTX6amf/ XCKsaJ6FzJuGPSVX8aWWEFdbRCprVD57OztA81hh+Mk6uDZNp5nVEvGLmURD8JPAq0o7 gvYQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=HjvstFYn; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id af79cd13be357-7acde5fec2esi363831185a.393.2024.09.25.04.16.19 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 25 Sep 2024 04:16:19 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=HjvstFYn; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1stPvZ-0000Qx-7T; Wed, 25 Sep 2024 07:11:25 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1stPvY-0000IP-1k for qemu-devel@nongnu.org; Wed, 25 Sep 2024 07:11:24 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1stPvW-0003XR-CE for qemu-devel@nongnu.org; Wed, 25 Sep 2024 07:11:23 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1727262680; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=FIaPitvZwBfLvSiAb1b7GqbCUaofsa86VJPizr+59Y4=; b=HjvstFYnOlL/mafv0kZck0F9TZpUfGpfGzojmX3bbOMFYsUT5r71ZfCWFt25UkKLbfMwac exZ9Zcc2Tfeh0lJGy5i5Cy6Dak7WWoMgYqgV00WVy3h5pJNnb7LAIv5jndOWD7dEWPkZN1 IZjKu+aR59lOz2bffUtZf/nI3pQKNlk= Received: from mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-653-w5LFXZmbOUy143G3VC8fTQ-1; Wed, 25 Sep 2024 07:11:16 -0400 X-MC-Unique: w5LFXZmbOUy143G3VC8fTQ-1 Received: from mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com (unknown [10.30.177.15]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 58C2619772E3; Wed, 25 Sep 2024 11:11:15 +0000 (UTC) Received: from thuth-p1g4.redhat.com (unknown [10.39.193.206]) by mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id A9633195609D; Wed, 25 Sep 2024 11:11:13 +0000 (UTC) From: Thomas Huth To: qemu-devel@nongnu.org Cc: Peter Maydell , Pierrick Bouvier Subject: [PULL 14/44] target/ppc: replace assert(0) with g_assert_not_reached() Date: Wed, 25 Sep 2024 13:09:55 +0200 Message-ID: <20240925111029.24082-15-thuth@redhat.com> In-Reply-To: <20240925111029.24082-1-thuth@redhat.com> References: <20240925111029.24082-1-thuth@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.15 Received-SPF: pass client-ip=170.10.129.124; envelope-from=thuth@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.108, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Pierrick Bouvier 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 Message-ID: <20240919044641.386068-7-pierrick.bouvier@linaro.org> Signed-off-by: Thomas Huth --- 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 5967ea07a9..ecc3f79326 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 b0a0676beb..b167b37e0a 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);