From nobody Tue May 14 13:08:53 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1677022061; cv=none; d=zohomail.com; s=zohoarc; b=L6TliUGEvDJZXYC3EHnuXrqVlVKYaGmPfO0EF6jUrSkbHZ+c0CwMtZ8tCm6B5+xRFgU9sPCLy8U5H+xeQOx7HBSQTlrDa+x3/AA/i3Zfxm5XeZ48iim8XIhJdWVw1zrFtJKxK64GA1Ht9JCWDHgUFt+08uyLqWh4eqiI3DtHZrM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1677022061; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=CnNTwGg0MOHmmdkp5WuNV0U9bN887LNmRf50zWb625Q=; b=VN8nmYNAwzscV5KBsQzNQ0Mrkm9cUIpoX3qNqxpXTltreeYgag4EIMr9egpjTGiEAIAQAueCJnpoPQsAtASqREFS8TcrGocFWK6TtdmVq73EujKiZKOz3iNv1ZAB49adG2foE2OLLbyF9J/OBJ5HT7oKlX4rUwVc7Xdl/Bc7Hbg= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 167702206146180.4774132791; Tue, 21 Feb 2023 15:27:41 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pUc12-0005DQ-0o; Tue, 21 Feb 2023 18:25:44 -0500 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 1pUc0r-00058D-Qx for qemu-devel@nongnu.org; Tue, 21 Feb 2023 18:25:37 -0500 Received: from mail-wr1-x435.google.com ([2a00:1450:4864:20::435]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pUc0o-0002Z4-UP for qemu-devel@nongnu.org; Tue, 21 Feb 2023 18:25:33 -0500 Received: by mail-wr1-x435.google.com with SMTP id 6so5678449wrb.11 for ; Tue, 21 Feb 2023 15:25:30 -0800 (PST) Received: from localhost.localdomain ([185.126.107.38]) by smtp.gmail.com with ESMTPSA id q9-20020adff949000000b002c56a7872f4sm7044564wrr.82.2023.02.21.15.25.27 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 21 Feb 2023 15:25:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; 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=CnNTwGg0MOHmmdkp5WuNV0U9bN887LNmRf50zWb625Q=; b=eFs26vK4M22XELInBI1Ob4vSmuZr0/f7PbMlVb0mnYED47WCwhRVkt4YiYll3Rpp2d +ESy2XhVh2vQU8FJka3zULXRf7co5Rdx3hrFwQJJf+0jc29Rpwezhc/Bx8bR9K7rat1g gUxcLQTVN2h+GNGcWllaTp+jPu9qkQI1jjbPcN4xuXTy7IDTLfz0VSjN1sN51FIHDqFw frC0Q7JbbcA+FmFMSLTL/Eq3ARG+BMMerQXqQh1hXd6maPB+TAPNS7/t06zakYwRH3NP A7xqCBJ8QAa7z/zZHzEuMCgTHjkqmFhfqmWtSSSadDBxxcl8uFnHdwH0KMbcJBfJCUrl WkdA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=CnNTwGg0MOHmmdkp5WuNV0U9bN887LNmRf50zWb625Q=; b=IZJaI+j6yfLPltBHVIHRkJoIo05f+Zlx/wEoW07teKDEbVaBIINPBFSYCPX8fvlZFH k8nUYaGCmprkUWA4e9j2zqJInpSZUo72mw6cfm03/UmELXNmh3Ao2o1uTttzMg7vFq4v sFJ025XfnvmFll8W36h3eD6kgnHUT0OcvzO4lj2rLDjjUycYH4Em4c/BDoOYaWHDlKUa fshW0NgidkFsOKjSJK8s4WD6rfEJo6UbQBILePUdx0KzoPhBL5T+OYrJsOzAxoqPWapg Bi2gE76wk5kpE/sZ+0fUrTlaOwUM/qEC7C2AfYPcLBWX62MrtUE9mspc079jBbkqRBpO 8dvg== X-Gm-Message-State: AO0yUKUppBGx+YgV7Zk4WBZbaOFdMSdkYXikkUURd4zKj1U1CZrydY/1 nVVU5Y9oge381rQFVFlb15WaOYxpOyqWlAaQ X-Google-Smtp-Source: AK7set9oSCOpO/fBHFKiMhmatK6QXnGTxefMrlxpf7joPRgd5WZ6r8IAO0ASwCtgTf7pdr5uv7fCmg== X-Received: by 2002:a5d:4d50:0:b0:2c6:e7ff:8f17 with SMTP id a16-20020a5d4d50000000b002c6e7ff8f17mr5207912wru.25.1677021928899; Tue, 21 Feb 2023 15:25:28 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-block@nongnu.org, qemu-arm@nongnu.org, Thomas Huth , qemu-ppc@nongnu.org, Eric Blake , Pierrick Bouvier , Richard Henderson , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Daniel Henrique Barboza , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , David Gibson , Greg Kurz Subject: [PATCH 1/5] target/ppc: fix warning with clang-15 Date: Wed, 22 Feb 2023 00:25:16 +0100 Message-Id: <20230221232520.14480-2-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230221232520.14480-1-philmd@linaro.org> References: <20230221232520.14480-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::435; envelope-from=philmd@linaro.org; helo=mail-wr1-x435.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1677022062464100002 From: Pierrick Bouvier When compiling for windows-arm64 using clang-15, it reports a sometimes uninitialized variable. This seems to be a false positive, as a default case guards switch expressions, preventing to return an uninitialized value, but clang seems unhappy with assert(0) definition. Change code to g_assert_not_reached() fix the warning. Signed-off-by: Pierrick Bouvier Reviewed-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daud=C3=A9 Message-Id: <20230221153006.20300-5-pierrick.bouvier@linaro.org> Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- target/ppc/dfp_helper.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/target/ppc/dfp_helper.c b/target/ppc/dfp_helper.c index cc024316d5..5967ea07a9 100644 --- a/target/ppc/dfp_helper.c +++ b/target/ppc/dfp_helper.c @@ -121,7 +121,7 @@ static void dfp_set_round_mode_from_immediate(uint8_t r= , uint8_t rmc, case 3: /* use FPSCR rounding mode */ return; default: - assert(0); /* cannot get here */ + g_assert_not_reached(); } } else { /* r =3D=3D 1 */ switch (rmc & 3) { @@ -138,7 +138,7 @@ static void dfp_set_round_mode_from_immediate(uint8_t r= , uint8_t rmc, rnd =3D DEC_ROUND_HALF_DOWN; break; default: - assert(0); /* cannot get here */ + g_assert_not_reached(); } } decContextSetRounding(&dfp->context, rnd); --=20 2.38.1 From nobody Tue May 14 13:08:53 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1677022023; cv=none; d=zohomail.com; s=zohoarc; b=m0uEj3/IFaou07QvDQ+whZlzMQg9jXAs8+mGPnKvWBenOnKLEKeddsR0PR5aR3aYFaxHm+jWMifCCbudDMN5RVEC8jlxX7boZyTcaKyq2IUX7UGRGYrfoZcwxMmd7q1ggU8/010NmZTkXhsFakj5OoAZEyBKjyDLcw/FPiNrvA4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1677022023; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=z7XCyvkdm6DP0Jui7XSb0+VPfOdaD+dTmIQzSrRKlao=; b=OESJfBeh0nMsox/h1M3rlguYrAIBzy0XcTATUBvOJ70ccwwdxNT9cVjkwCXCR8ut1zfVgIbXSwd6A+75NyCj5TXSVjCVb+LnCM4XO0cfOuBku8oljzsEhEd7ukACyDejEG9lRpZ+Jzq69xa2ASP8SGCXEFCrzNfxNWCLsNSqVIs= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1677022023044315.4705312466034; Tue, 21 Feb 2023 15:27:03 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pUc14-0005Eo-MH; Tue, 21 Feb 2023 18:25:46 -0500 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 1pUc0w-00059Y-Bv for qemu-devel@nongnu.org; Tue, 21 Feb 2023 18:25:38 -0500 Received: from mail-wm1-x32e.google.com ([2a00:1450:4864:20::32e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pUc0t-0002aN-Kr for qemu-devel@nongnu.org; Tue, 21 Feb 2023 18:25:38 -0500 Received: by mail-wm1-x32e.google.com with SMTP id k14-20020a05600c1c8e00b003e22107b7ccso287492wms.0 for ; Tue, 21 Feb 2023 15:25:35 -0800 (PST) Received: from localhost.localdomain ([185.126.107.38]) by smtp.gmail.com with ESMTPSA id u18-20020a05600c211200b003dc4fd6e624sm6050300wml.19.2023.02.21.15.25.32 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 21 Feb 2023 15:25:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; 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=z7XCyvkdm6DP0Jui7XSb0+VPfOdaD+dTmIQzSrRKlao=; b=FUVVDitLHTx3NBH77U/HrfszCBCKJJBsnR54CItVnAdU+fEQU3Quk+FtVxBpcD4+Rr wj8zg4d17SDpB27uJ2hokLy/EvXeEGnaVs+99IWNN60gNLOtiL51/R6AmxsOmC/LvlWs CbGJdAu4GGAeHpQDhsQb6w7K2Zihr0G4ij0NuV7W7mcdy0r8dUv/dhITim7SfSfCc7gM 3wGhcJulNGOlaZw/Mj/+UW+NX3qvkvz22ArlvsAp8eBFArd2IVfvrYk9zbzl9551wl4P W7GE2cjCrGhJ9H+jYeOaSATdcW+jcxCse8j5GICzc0lu7OrLjBdoHMk7pjzLPAhHkxLu 9WHw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=z7XCyvkdm6DP0Jui7XSb0+VPfOdaD+dTmIQzSrRKlao=; b=ifINoSMneE2LnV1DnXCsjKy3C+lG+sHSH+ILkcJkf+pTTnjE44mHZ/C5muGDYIzksx 0bILiwTvrjNdUB5PwywfaQJpf45X2qwQp1wWK5ha2aKQbMFYH3vv+vi7wjsWA0bzyejW 5Xc8JO1L2RqUNAtlgLEDGsa86kR6RSz8AfCeSs56og9cqUMHyGwBRYAiLe0jop4aGR0P rMfLu0EMIOVzP2CQXWXo1iTaShTIvsQkAESHEMayqSrWjsdSVaByP7J9I/gyKXXgzuxS mKSO1M0XQp/1lziKhGVS/UdQT5iQOeqWibNMXDsYeXFtpIXwBLDOlK9Mwr+fCBw72fw9 RQ+A== X-Gm-Message-State: AO0yUKWVTKEr/Fx9xs5IJU/1+utLgrrNWJ6hf1WLVZvtFZR45OLAF1Eh HHldHEA2rpG0XVC03/MAf6JbMoVFkwL8LsMj X-Google-Smtp-Source: AK7set9TifsiJCRQ0BJ+N+S1l84xbAVuDN+JKiZ/oefWDU4v60J0e6Idllw+llPO5zMn3j72xCtvcg== X-Received: by 2002:a05:600c:3088:b0:3dc:5c86:12f3 with SMTP id g8-20020a05600c308800b003dc5c8612f3mr11829602wmn.1.1677021933999; Tue, 21 Feb 2023 15:25:33 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-block@nongnu.org, qemu-arm@nongnu.org, Thomas Huth , qemu-ppc@nongnu.org, Eric Blake , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH 2/5] scripts/checkpatch.pl: Do not allow assert(0) Date: Wed, 22 Feb 2023 00:25:17 +0100 Message-Id: <20230221232520.14480-3-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230221232520.14480-1-philmd@linaro.org> References: <20230221232520.14480-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::32e; envelope-from=philmd@linaro.org; helo=mail-wm1-x32e.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1677022024396100005 Since commit 262a69f428 ("osdep.h: Prohibit disabling assert() in supported builds") we can not build QEMU with NDEBUG (or G_DISABLE_ASSERT) defined, thus 'assert(0)' always aborts QEMU. However some static analyzers / compilers doesn't notice NDEBUG can't be defined and emit warnings if code is used after an 'assert(0)' call. See for example commit c0a6665c3c ("target/i386: Remove compilation errors when -Werror=3Dmaybe-uninitialized"). Apparently such compiler isn't as clever with G_DISABLE_ASSERT, so we can silent these warnings by using g_assert_not_reached() which is easier to read anyway. In order to avoid these annoying warnings, add a checkpatch rule to prohibit 'assert(0)'. Suggest using g_assert_not_reached() instead. For example when reverting the previous patch we get: ERROR: use g_assert_not_reached() instead of assert(0) #21: FILE: target/ppc/dfp_helper.c:124: + assert(0); /* cannot get here */ ERROR: use g_assert_not_reached() instead of assert(0) #30: FILE: target/ppc/dfp_helper.c:141: + assert(0); /* cannot get here */ total: 2 errors, 0 warnings, 16 lines checked Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson --- scripts/checkpatch.pl | 3 +++ 1 file changed, 3 insertions(+) diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index 6ecabfb2b5..d768171dcf 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl @@ -2982,6 +2982,9 @@ sub process { if ($line =3D~ /\bsysconf\(_SC_PAGESIZE\)/) { ERROR("use qemu_real_host_page_size() instead of sysconf(_SC_PAGESIZE)\= n" . $herecurr); } + if ($line =3D~ /\b(g_)?assert\(0\)/) { + ERROR("use g_assert_not_reached() instead of assert(0)\n" . $herecurr); + } my $non_exit_glib_asserts =3D qr{g_assert_cmpstr| g_assert_cmpint| g_assert_cmpuint| --=20 2.38.1 From nobody Tue May 14 13:08:53 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1677022023; cv=none; d=zohomail.com; s=zohoarc; b=aTyTBYpIOWbGUVsjAJPoEtAfb1GqrdkZBa0F5szUWjecJ4f9GtGYoyLPjdcSJ7VOP8sW4NtnYYg11UMFD8k4UA/YBsJyvo9ANxsGElavYDA0W3LaAjCSUe1s2+H7rmxqWhFAFKkhBZ2AKe2L8P5qRO512vFjSIs8VFqShqIgR6A= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1677022023; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=8SOiO6SUqRICLIJPyMazSs+K23fbT+t1yx1l1at9jCs=; b=YgJAZod0HMQJEvkxvjnAucMziNyX1k4xs2eCGtz+S/hsTrRGa719WJhVNhmL98IC0vn6ChLBK5sMmHNgXJjCt5drW8jcM8HbIDuyNAFyR0V9COQtqUjiirvubC1dSS9mTE5FxAANfCUz9yPskET8Tk2A1ptT+gJD6CeVDIc6/Cc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1677022023196525.8050930178977; Tue, 21 Feb 2023 15:27:03 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pUc18-0005HI-0y; Tue, 21 Feb 2023 18:25:50 -0500 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 1pUc15-0005FH-0b for qemu-devel@nongnu.org; Tue, 21 Feb 2023 18:25:47 -0500 Received: from mail-wm1-x32c.google.com ([2a00:1450:4864:20::32c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pUc10-0002eG-Ba for qemu-devel@nongnu.org; Tue, 21 Feb 2023 18:25:46 -0500 Received: by mail-wm1-x32c.google.com with SMTP id o4-20020a05600c4fc400b003e1f5f2a29cso4888384wmq.4 for ; Tue, 21 Feb 2023 15:25:41 -0800 (PST) Received: from localhost.localdomain ([185.126.107.38]) by smtp.gmail.com with ESMTPSA id ja13-20020a05600c556d00b003e4326a6d53sm7943109wmb.35.2023.02.21.15.25.38 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 21 Feb 2023 15:25:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; 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=8SOiO6SUqRICLIJPyMazSs+K23fbT+t1yx1l1at9jCs=; b=GR0ZEVjfnRKb3kLaXpnRUVEpkF+ngvRlSoE6P8NUuMwzMVv5lVCVwy7dg7HcZrr6Ay 6pPYsbbc74Db7gPZ/vg80DHZGhOaNHeHnESobJeTuFqyn/w+tMfzdUCMgjrqIu2DsiKO eATl/iA15+QMsyqvC3GmzuWMYKUGs/FGyPa58MfHmWMFWPWXMbta8+xn2JzMVQCYCZ8Y aRx06cc4zwWZ+IMqR0a7ny3FTJAJFK3UMHrvsyvlo0tmrCGIVqkeFfQ2/m5XOtQsyL7I inxeCdU6vsn/gxyrlAXem8APTMeH6r/fLf0IREWfv35ezA2rZc6GTVNTiMs2UqGhK3+1 MQvQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=8SOiO6SUqRICLIJPyMazSs+K23fbT+t1yx1l1at9jCs=; b=eUveOJ/Sv7HRA1bXMRfH3oFPpGc54XHySFFkyannYBABZAA6iuJTJoQB61jkISj/iU pBldeqn1Xwncso6qED2IIybSYwSB4mrfPByGnWwmzQbFCZKd3xk5mZvu5FgW9FZFhJiI iVALittI4uOZEM0zv4LFXfeoERR2Emj4i5Fn4Z/ZnSz1QLJ5S4bAQglCcozXQF9ThwFr GFKKaAKra4D4bG/Qv7cLd8YiStcpIU8Pugc5uOQJ09mvLzR1Ka3vd9AriosXsCMOisw6 jTWDjiyFCgMlwsH5hrDW9g6Amj2rUPBplpVqqHjGG2/4VlQLH5luRK0VsW6WiGUWJC0M Wznw== X-Gm-Message-State: AO0yUKUf6lv8zTRoKrMho5PXQ8AuBVnwuwlhc83HyHOfMBe70QWNRzyz FVQXuFAhNfALp4Vd10AiJn2Fan3i3BICG8eT X-Google-Smtp-Source: AK7set8O3y4xbVB84SZCqtzXrCsksUTCY9WnE13A2tQdEk8H7sITNJCcFQ4B3XHdH3NF9jjWeM38qQ== X-Received: by 2002:a05:600c:1da5:b0:3e2:1dac:b071 with SMTP id p37-20020a05600c1da500b003e21dacb071mr5590135wms.13.1677021940513; Tue, 21 Feb 2023 15:25:40 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-block@nongnu.org, qemu-arm@nongnu.org, Thomas Huth , qemu-ppc@nongnu.org, Eric Blake , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , "Michael S. Tsirkin" , Igor Mammedov , Ani Sinha , Rob Herring , Peter Maydell , Michael Rolnik , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Paolo Bonzini , Eduardo Habkost , Marcel Apfelbaum , Yanan Wang , Richard Henderson , Helge Deller , Jason Wang , Juan Quintela , "Dr. David Alan Gilbert" , Markus Armbruster , Huacai Chen , Aurelien Jarno , Jiaxun Yang , Aleksandar Rikalo , Daniel Henrique Barboza , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , David Gibson , Greg Kurz , Corey Minyard , Laurent Vivier Subject: [PATCH 3/5] bulk: Replace [g_]assert(0) -> g_assert_not_reached() Date: Wed, 22 Feb 2023 00:25:18 +0100 Message-Id: <20230221232520.14480-4-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230221232520.14480-1-philmd@linaro.org> References: <20230221232520.14480-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::32c; envelope-from=philmd@linaro.org; helo=mail-wm1-x32c.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1677022024441100007 In order to avoid warnings such commit c0a6665c3c ("target/i386: Remove compilation errors when -Werror=3Dmaybe-uninitialized"), replace all assert(0) and g_assert(0) by g_assert_not_reached(). Remove any code following g_assert_not_reached(). See previous commit for rationale. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson --- docs/spin/aio_notify_accept.promela | 6 +- docs/spin/aio_notify_bug.promela | 6 +- hw/acpi/aml-build.c | 3 +- hw/arm/highbank.c | 2 +- hw/char/avr_usart.c | 2 +- hw/core/numa.c | 2 +- hw/net/i82596.c | 2 +- hw/watchdog/watchdog.c | 2 +- migration/migration-hmp-cmds.c | 2 +- migration/postcopy-ram.c | 21 ++---- migration/ram.c | 8 +-- qobject/qlit.c | 2 +- qobject/qnum.c | 12 ++-- softmmu/rtc.c | 2 +- target/mips/sysemu/physaddr.c | 3 +- target/mips/tcg/msa_helper.c | 104 ++++++++++++++-------------- target/ppc/dfp_helper.c | 8 +-- target/ppc/mmu_helper.c | 2 +- tests/qtest/ipmi-bt-test.c | 2 +- tests/qtest/ipmi-kcs-test.c | 4 +- tests/qtest/rtl8139-test.c | 2 +- 21 files changed, 91 insertions(+), 106 deletions(-) diff --git a/docs/spin/aio_notify_accept.promela b/docs/spin/aio_notify_acc= ept.promela index 9cef2c955d..f929d30328 100644 --- a/docs/spin/aio_notify_accept.promela +++ b/docs/spin/aio_notify_accept.promela @@ -118,7 +118,7 @@ accept_if_req_not_eventually_false: if :: req -> goto accept_if_req_not_eventually_false; fi; - assert(0); + g_assert_not_reached(); } =20 #else @@ -141,12 +141,12 @@ accept_if_event_not_eventually_true: :: !event && notifier_done -> do :: true -> skip; od; :: !event && !notifier_done -> goto accept_if_event_not_eventually= _true; fi; - assert(0); + g_assert_not_reached(); =20 accept_if_event_not_eventually_false: if :: event -> goto accept_if_event_not_eventually_false; fi; - assert(0); + g_assert_not_reached(); } #endif diff --git a/docs/spin/aio_notify_bug.promela b/docs/spin/aio_notify_bug.pr= omela index b3bfca1ca4..ce6f5177ed 100644 --- a/docs/spin/aio_notify_bug.promela +++ b/docs/spin/aio_notify_bug.promela @@ -106,7 +106,7 @@ accept_if_req_not_eventually_false: if :: req -> goto accept_if_req_not_eventually_false; fi; - assert(0); + g_assert_not_reached(); } =20 #else @@ -129,12 +129,12 @@ accept_if_event_not_eventually_true: :: !event && notifier_done -> do :: true -> skip; od; :: !event && !notifier_done -> goto accept_if_event_not_eventually= _true; fi; - assert(0); + g_assert_not_reached(); =20 accept_if_event_not_eventually_false: if :: event -> goto accept_if_event_not_eventually_false; fi; - assert(0); + g_assert_not_reached(); } #endif diff --git a/hw/acpi/aml-build.c b/hw/acpi/aml-build.c index ea331a20d1..97dfdcdd2f 100644 --- a/hw/acpi/aml-build.c +++ b/hw/acpi/aml-build.c @@ -534,8 +534,7 @@ void aml_append(Aml *parent_ctx, Aml *child) case AML_NO_OPCODE: break; default: - assert(0); - break; + g_assert_not_reached(); } build_append_array(parent_ctx->buf, buf); build_free_array(buf); diff --git a/hw/arm/highbank.c b/hw/arm/highbank.c index f12aacea6b..fc212195ca 100644 --- a/hw/arm/highbank.c +++ b/hw/arm/highbank.c @@ -198,7 +198,7 @@ static void calxeda_init(MachineState *machine, enum cx= machines machine_id) machine->cpu_type =3D ARM_CPU_TYPE_NAME("cortex-a15"); break; default: - assert(0); + g_assert_not_reached(); } =20 for (n =3D 0; n < smp_cpus; n++) { diff --git a/hw/char/avr_usart.c b/hw/char/avr_usart.c index 5bcf9db0b7..e738a2ca97 100644 --- a/hw/char/avr_usart.c +++ b/hw/char/avr_usart.c @@ -86,7 +86,7 @@ static void update_char_mask(AVRUsartState *usart) usart->char_mask =3D 0b11111111; break; default: - assert(0); + g_assert_not_reached(); } } =20 diff --git a/hw/core/numa.c b/hw/core/numa.c index d8d36b16d8..26ef02792a 100644 --- a/hw/core/numa.c +++ b/hw/core/numa.c @@ -381,7 +381,7 @@ void parse_numa_hmat_lb(NumaState *numa_state, NumaHmat= LBOptions *node, } lb_data.data =3D node->bandwidth; } else { - assert(0); + g_assert_not_reached(); } =20 g_array_append_val(hmat_lb->list, lb_data); diff --git a/hw/net/i82596.c b/hw/net/i82596.c index ec21e2699a..eda0f586fb 100644 --- a/hw/net/i82596.c +++ b/hw/net/i82596.c @@ -285,7 +285,7 @@ static void command_loop(I82596State *s) case CmdDump: case CmdDiagnose: printf("FIXME Command %d !!\n", cmd & 7); - assert(0); + g_assert_not_reached(); } =20 /* update status */ diff --git a/hw/watchdog/watchdog.c b/hw/watchdog/watchdog.c index 955046161b..d0ce3c4ac5 100644 --- a/hw/watchdog/watchdog.c +++ b/hw/watchdog/watchdog.c @@ -85,7 +85,7 @@ void watchdog_perform_action(void) break; =20 default: - assert(0); + g_assert_not_reached(); } } =20 diff --git a/migration/migration-hmp-cmds.c b/migration/migration-hmp-cmds.c index ef25bc8929..4e07c95801 100644 --- a/migration/migration-hmp-cmds.c +++ b/migration/migration-hmp-cmds.c @@ -602,7 +602,7 @@ void hmp_migrate_set_parameter(Monitor *mon, const QDic= t *qdict) "through QMP"); break; default: - assert(0); + g_assert_not_reached(); } =20 if (err) { diff --git a/migration/postcopy-ram.c b/migration/postcopy-ram.c index f54f44d899..59c8032a21 100644 --- a/migration/postcopy-ram.c +++ b/migration/postcopy-ram.c @@ -1347,49 +1347,42 @@ int postcopy_ram_incoming_init(MigrationIncomingSta= te *mis) =20 int postcopy_ram_incoming_cleanup(MigrationIncomingState *mis) { - assert(0); - return -1; + g_assert_not_reached(); } =20 int postcopy_ram_prepare_discard(MigrationIncomingState *mis) { - assert(0); - return -1; + g_assert_not_reached(); } =20 int postcopy_request_shared_page(struct PostCopyFD *pcfd, RAMBlock *rb, uint64_t client_addr, uint64_t rb_offset) { - assert(0); - return -1; + g_assert_not_reached(); } =20 int postcopy_ram_incoming_setup(MigrationIncomingState *mis) { - assert(0); - return -1; + g_assert_not_reached(); } =20 int postcopy_place_page(MigrationIncomingState *mis, void *host, void *fro= m, RAMBlock *rb) { - assert(0); - return -1; + g_assert_not_reached(); } =20 int postcopy_place_page_zero(MigrationIncomingState *mis, void *host, RAMBlock *rb) { - assert(0); - return -1; + g_assert_not_reached(); } =20 int postcopy_wake_shared(struct PostCopyFD *pcfd, uint64_t client_addr, RAMBlock *rb) { - assert(0); - return -1; + g_assert_not_reached(); } #endif =20 diff --git a/migration/ram.c b/migration/ram.c index 96e8a19a58..93f5a4a416 100644 --- a/migration/ram.c +++ b/migration/ram.c @@ -2061,19 +2061,17 @@ bool ram_write_tracking_available(void) =20 bool ram_write_tracking_compatible(void) { - assert(0); - return false; + g_assert_not_reached(); } =20 int ram_write_tracking_start(void) { - assert(0); - return -1; + g_assert_not_reached(); } =20 void ram_write_tracking_stop(void) { - assert(0); + g_assert_not_reached(); } #endif /* defined(__linux__) */ =20 diff --git a/qobject/qlit.c b/qobject/qlit.c index be8332136c..a62865b642 100644 --- a/qobject/qlit.c +++ b/qobject/qlit.c @@ -118,7 +118,7 @@ QObject *qobject_from_qlit(const QLitObject *qlit) case QTYPE_QBOOL: return QOBJECT(qbool_from_bool(qlit->value.qbool)); default: - assert(0); + g_assert_not_reached(); } =20 return NULL; diff --git a/qobject/qnum.c b/qobject/qnum.c index 2bbeaedc7b..dd8ea49565 100644 --- a/qobject/qnum.c +++ b/qobject/qnum.c @@ -85,8 +85,7 @@ bool qnum_get_try_int(const QNum *qn, int64_t *val) return false; } =20 - assert(0); - return false; + g_assert_not_reached(); } =20 /** @@ -123,8 +122,7 @@ bool qnum_get_try_uint(const QNum *qn, uint64_t *val) return false; } =20 - assert(0); - return false; + g_assert_not_reached(); } =20 /** @@ -156,8 +154,7 @@ double qnum_get_double(QNum *qn) return qn->u.dbl; } =20 - assert(0); - return 0.0; + g_assert_not_reached(); } =20 char *qnum_to_string(QNum *qn) @@ -172,8 +169,7 @@ char *qnum_to_string(QNum *qn) return g_strdup_printf("%.17g", qn->u.dbl); } =20 - assert(0); - return NULL; + g_assert_not_reached(); } =20 /** diff --git a/softmmu/rtc.c b/softmmu/rtc.c index f7114bed7d..a2145da23d 100644 --- a/softmmu/rtc.c +++ b/softmmu/rtc.c @@ -63,7 +63,7 @@ static time_t qemu_ref_timedate(QEMUClockType clock) } break; default: - assert(0); + g_assert_not_reached(); } return value; } diff --git a/target/mips/sysemu/physaddr.c b/target/mips/sysemu/physaddr.c index 2970df8a09..05990aa5bb 100644 --- a/target/mips/sysemu/physaddr.c +++ b/target/mips/sysemu/physaddr.c @@ -70,8 +70,7 @@ static int is_seg_am_mapped(unsigned int am, bool eu, int= mmu_idx) /* is this AM mapped in current execution mode */ return ((adetlb_mask << am) < 0); default: - assert(0); - return TLBRET_BADADDR; + g_assert_not_reached(); }; } =20 diff --git a/target/mips/tcg/msa_helper.c b/target/mips/tcg/msa_helper.c index 736283e2af..29b31d70fe 100644 --- a/target/mips/tcg/msa_helper.c +++ b/target/mips/tcg/msa_helper.c @@ -5333,7 +5333,7 @@ void helper_msa_shf_df(CPUMIPSState *env, uint32_t df= , uint32_t wd, } break; default: - assert(0); + g_assert_not_reached(); } msa_move_v(pwd, pwx); } @@ -5368,7 +5368,7 @@ void helper_msa_ ## helper ## _df(CPUMIPSState *env, = uint32_t df, \ } \ break; \ default: \ - assert(0); \ + g_assert_not_reached(); \ } \ } =20 @@ -5413,7 +5413,7 @@ void helper_msa_ldi_df(CPUMIPSState *env, uint32_t df= , uint32_t wd, } break; default: - assert(0); + g_assert_not_reached(); } } =20 @@ -5461,7 +5461,7 @@ void helper_msa_ ## helper ## _df(CPUMIPSState *env, = uint32_t df, uint32_t wd, \ } \ break; \ default: \ - assert(0); \ + g_assert_not_reached(); \ } \ } =20 @@ -5511,7 +5511,7 @@ void helper_msa_ ## helper ## _df(CPUMIPSState *env, = uint32_t df, \ } \ break; \ default: \ - assert(0); \ + g_assert_not_reached(); \ } \ } =20 @@ -5557,7 +5557,7 @@ static inline void msa_sld_df(uint32_t df, wr_t *pwd, } break; default: - assert(0); + g_assert_not_reached(); } } =20 @@ -5632,7 +5632,7 @@ void helper_msa_ ## func ## _df(CPUMIPSState *env, ui= nt32_t df, \ pwd->d[1] =3D msa_ ## func ## _df(df, pws->d[1], pwt->d[1]); \ break; \ default: \ - assert(0); \ + g_assert_not_reached(); \ } \ } =20 @@ -5771,7 +5771,7 @@ void helper_msa_ ## func ## _df(CPUMIPSState *env, ui= nt32_t df, uint32_t wd, \ pwd->d[1] =3D msa_ ## func ## _df(df, pwd->d[1], pws->d[1], pwt->d= [1]); \ break; = \ default: = \ - assert(0); = \ + g_assert_not_reached(); = \ } = \ } =20 @@ -5811,7 +5811,7 @@ static inline void msa_splat_df(uint32_t df, wr_t *pw= d, } break; default: - assert(0); + g_assert_not_reached(); } } =20 @@ -5869,7 +5869,7 @@ void helper_msa_##FUNC(CPUMIPSState *env, uint32_t df= , uint32_t wd, \ MSA_LOOP_D; \ break; \ default: \ - assert(0); \ + g_assert_not_reached(); \ } \ msa_move_v(pwd, pwx); \ } @@ -6090,7 +6090,7 @@ void helper_msa_insve_df(CPUMIPSState *env, uint32_t = df, uint32_t wd, pwd->d[n] =3D (int64_t)pws->d[0]; break; default: - assert(0); + g_assert_not_reached(); } } =20 @@ -6150,7 +6150,7 @@ void helper_msa_fill_df(CPUMIPSState *env, uint32_t d= f, uint32_t wd, } break; default: - assert(0); + g_assert_not_reached(); } } =20 @@ -6565,7 +6565,7 @@ static inline void compare_af(CPUMIPSState *env, wr_t= *pwd, wr_t *pws, } break; default: - assert(0); + g_assert_not_reached(); } =20 check_msacsr_cause(env, retaddr); @@ -6596,7 +6596,7 @@ static inline void compare_un(CPUMIPSState *env, wr_t= *pwd, wr_t *pws, } break; default: - assert(0); + g_assert_not_reached(); } =20 check_msacsr_cause(env, retaddr); @@ -6625,7 +6625,7 @@ static inline void compare_eq(CPUMIPSState *env, wr_t= *pwd, wr_t *pws, } break; default: - assert(0); + g_assert_not_reached(); } =20 check_msacsr_cause(env, retaddr); @@ -6654,7 +6654,7 @@ static inline void compare_ueq(CPUMIPSState *env, wr_= t *pwd, wr_t *pws, } break; default: - assert(0); + g_assert_not_reached(); } =20 check_msacsr_cause(env, retaddr); @@ -6683,7 +6683,7 @@ static inline void compare_lt(CPUMIPSState *env, wr_t= *pwd, wr_t *pws, } break; default: - assert(0); + g_assert_not_reached(); } =20 check_msacsr_cause(env, retaddr); @@ -6712,7 +6712,7 @@ static inline void compare_ult(CPUMIPSState *env, wr_= t *pwd, wr_t *pws, } break; default: - assert(0); + g_assert_not_reached(); } =20 check_msacsr_cause(env, retaddr); @@ -6741,7 +6741,7 @@ static inline void compare_le(CPUMIPSState *env, wr_t= *pwd, wr_t *pws, } break; default: - assert(0); + g_assert_not_reached(); } =20 check_msacsr_cause(env, retaddr); @@ -6770,7 +6770,7 @@ static inline void compare_ule(CPUMIPSState *env, wr_= t *pwd, wr_t *pws, } break; default: - assert(0); + g_assert_not_reached(); } =20 check_msacsr_cause(env, retaddr); @@ -6799,7 +6799,7 @@ static inline void compare_or(CPUMIPSState *env, wr_t= *pwd, wr_t *pws, } break; default: - assert(0); + g_assert_not_reached(); } =20 check_msacsr_cause(env, retaddr); @@ -6828,7 +6828,7 @@ static inline void compare_une(CPUMIPSState *env, wr_= t *pwd, wr_t *pws, } break; default: - assert(0); + g_assert_not_reached(); } =20 check_msacsr_cause(env, retaddr); @@ -6857,7 +6857,7 @@ static inline void compare_ne(CPUMIPSState *env, wr_t= *pwd, wr_t *pws, } break; default: - assert(0); + g_assert_not_reached(); } =20 check_msacsr_cause(env, retaddr); @@ -7107,7 +7107,7 @@ void helper_msa_fadd_df(CPUMIPSState *env, uint32_t d= f, uint32_t wd, } break; default: - assert(0); + g_assert_not_reached(); } =20 check_msacsr_cause(env, GETPC()); @@ -7137,7 +7137,7 @@ void helper_msa_fsub_df(CPUMIPSState *env, uint32_t d= f, uint32_t wd, } break; default: - assert(0); + g_assert_not_reached(); } =20 check_msacsr_cause(env, GETPC()); @@ -7167,7 +7167,7 @@ void helper_msa_fmul_df(CPUMIPSState *env, uint32_t d= f, uint32_t wd, } break; default: - assert(0); + g_assert_not_reached(); } =20 check_msacsr_cause(env, GETPC()); @@ -7198,7 +7198,7 @@ void helper_msa_fdiv_df(CPUMIPSState *env, uint32_t d= f, uint32_t wd, } break; default: - assert(0); + g_assert_not_reached(); } =20 check_msacsr_cause(env, GETPC()); @@ -7245,7 +7245,7 @@ void helper_msa_fmadd_df(CPUMIPSState *env, uint32_t = df, uint32_t wd, } break; default: - assert(0); + g_assert_not_reached(); } =20 check_msacsr_cause(env, GETPC()); @@ -7280,7 +7280,7 @@ void helper_msa_fmsub_df(CPUMIPSState *env, uint32_t = df, uint32_t wd, } break; default: - assert(0); + g_assert_not_reached(); } =20 check_msacsr_cause(env, GETPC()); @@ -7317,7 +7317,7 @@ void helper_msa_fexp2_df(CPUMIPSState *env, uint32_t = df, uint32_t wd, } break; default: - assert(0); + g_assert_not_reached(); } =20 check_msacsr_cause(env, GETPC()); @@ -7371,7 +7371,7 @@ void helper_msa_fexdo_df(CPUMIPSState *env, uint32_t = df, uint32_t wd, } break; default: - assert(0); + g_assert_not_reached(); } =20 check_msacsr_cause(env, GETPC()); @@ -7417,7 +7417,7 @@ void helper_msa_ftq_df(CPUMIPSState *env, uint32_t df= , uint32_t wd, } break; default: - assert(0); + g_assert_not_reached(); } =20 check_msacsr_cause(env, GETPC()); @@ -7526,7 +7526,7 @@ void helper_msa_fmin_df(CPUMIPSState *env, uint32_t d= f, uint32_t wd, =20 } else { =20 - assert(0); + g_assert_not_reached(); =20 } =20 @@ -7555,7 +7555,7 @@ void helper_msa_fmin_a_df(CPUMIPSState *env, uint32_t= df, uint32_t wd, FMAXMIN_A(min, max, pwx->d[0], pws->d[0], pwt->d[0], 64, status); FMAXMIN_A(min, max, pwx->d[1], pws->d[1], pwt->d[1], 64, status); } else { - assert(0); + g_assert_not_reached(); } =20 check_msacsr_cause(env, GETPC()); @@ -7628,7 +7628,7 @@ void helper_msa_fmax_df(CPUMIPSState *env, uint32_t d= f, uint32_t wd, =20 } else { =20 - assert(0); + g_assert_not_reached(); =20 } =20 @@ -7657,7 +7657,7 @@ void helper_msa_fmax_a_df(CPUMIPSState *env, uint32_t= df, uint32_t wd, FMAXMIN_A(max, min, pwx->d[0], pws->d[0], pwt->d[0], 64, status); FMAXMIN_A(max, min, pwx->d[1], pws->d[1], pwt->d[1], 64, status); } else { - assert(0); + g_assert_not_reached(); } =20 check_msacsr_cause(env, GETPC()); @@ -7681,7 +7681,7 @@ void helper_msa_fclass_df(CPUMIPSState *env, uint32_t= df, pwd->d[0] =3D float_class_d(pws->d[0], status); pwd->d[1] =3D float_class_d(pws->d[1], status); } else { - assert(0); + g_assert_not_reached(); } } =20 @@ -7723,7 +7723,7 @@ void helper_msa_ftrunc_s_df(CPUMIPSState *env, uint32= _t df, uint32_t wd, } break; default: - assert(0); + g_assert_not_reached(); } =20 check_msacsr_cause(env, GETPC()); @@ -7753,7 +7753,7 @@ void helper_msa_ftrunc_u_df(CPUMIPSState *env, uint32= _t df, uint32_t wd, } break; default: - assert(0); + g_assert_not_reached(); } =20 check_msacsr_cause(env, GETPC()); @@ -7783,7 +7783,7 @@ void helper_msa_fsqrt_df(CPUMIPSState *env, uint32_t = df, uint32_t wd, } break; default: - assert(0); + g_assert_not_reached(); } =20 check_msacsr_cause(env, GETPC()); @@ -7832,7 +7832,7 @@ void helper_msa_frsqrt_df(CPUMIPSState *env, uint32_t= df, uint32_t wd, } break; default: - assert(0); + g_assert_not_reached(); } =20 check_msacsr_cause(env, GETPC()); @@ -7862,7 +7862,7 @@ void helper_msa_frcp_df(CPUMIPSState *env, uint32_t d= f, uint32_t wd, } break; default: - assert(0); + g_assert_not_reached(); } =20 check_msacsr_cause(env, GETPC()); @@ -7892,7 +7892,7 @@ void helper_msa_frint_df(CPUMIPSState *env, uint32_t = df, uint32_t wd, } break; default: - assert(0); + g_assert_not_reached(); } =20 check_msacsr_cause(env, GETPC()); @@ -7946,7 +7946,7 @@ void helper_msa_flog2_df(CPUMIPSState *env, uint32_t = df, uint32_t wd, } break; default: - assert(0); + g_assert_not_reached(); } =20 check_msacsr_cause(env, GETPC()); @@ -7983,7 +7983,7 @@ void helper_msa_fexupl_df(CPUMIPSState *env, uint32_t= df, uint32_t wd, } break; default: - assert(0); + g_assert_not_reached(); } =20 check_msacsr_cause(env, GETPC()); @@ -8019,7 +8019,7 @@ void helper_msa_fexupr_df(CPUMIPSState *env, uint32_t= df, uint32_t wd, } break; default: - assert(0); + g_assert_not_reached(); } =20 check_msacsr_cause(env, GETPC()); @@ -8046,7 +8046,7 @@ void helper_msa_ffql_df(CPUMIPSState *env, uint32_t d= f, uint32_t wd, } break; default: - assert(0); + g_assert_not_reached(); } =20 msa_move_v(pwd, pwx); @@ -8072,7 +8072,7 @@ void helper_msa_ffqr_df(CPUMIPSState *env, uint32_t d= f, uint32_t wd, } break; default: - assert(0); + g_assert_not_reached(); } =20 msa_move_v(pwd, pwx); @@ -8100,7 +8100,7 @@ void helper_msa_ftint_s_df(CPUMIPSState *env, uint32_= t df, uint32_t wd, } break; default: - assert(0); + g_assert_not_reached(); } =20 check_msacsr_cause(env, GETPC()); @@ -8130,7 +8130,7 @@ void helper_msa_ftint_u_df(CPUMIPSState *env, uint32_= t df, uint32_t wd, } break; default: - assert(0); + g_assert_not_reached(); } =20 check_msacsr_cause(env, GETPC()); @@ -8166,7 +8166,7 @@ void helper_msa_ffint_s_df(CPUMIPSState *env, uint32_= t df, uint32_t wd, } break; default: - assert(0); + g_assert_not_reached(); } =20 check_msacsr_cause(env, GETPC()); @@ -8196,7 +8196,7 @@ void helper_msa_ffint_u_df(CPUMIPSState *env, uint32_= t df, uint32_t wd, } break; default: - assert(0); + g_assert_not_reached(); } =20 check_msacsr_cause(env, GETPC()); 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 P= PC_DFP *dfp, fprf =3D 0x05; break; default: - assert(0); /* should never get here */ + g_assert_not_reached(); } dfp->env->fpscr &=3D ~FP_FPRF; dfp->env->fpscr |=3D (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) =3D -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) =3D=3D 128) { \ vt.VsrD(1) =3D 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 =3D 0x1e000; = \ bias =3D 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 64e30435f5..b064f3bd04 100644 --- a/target/ppc/mmu_helper.c +++ b/target/ppc/mmu_helper.c @@ -353,7 +353,7 @@ void ppc_tlb_invalidate_one(CPUPPCState *env, target_ul= ong addr) break; default: /* Should never reach here with other MMU models */ - assert(0); + g_assert_not_reached(); } #else ppc_tlb_invalidate_all(env); diff --git a/tests/qtest/ipmi-bt-test.c b/tests/qtest/ipmi-bt-test.c index ed431e34e6..5bd6b769d3 100644 --- a/tests/qtest/ipmi-bt-test.c +++ b/tests/qtest/ipmi-bt-test.c @@ -251,7 +251,7 @@ static void emu_msg_handler(void) msg[msg_len++] =3D 0xa0; write_emu_msg(msg, msg_len); } else { - g_assert(0); + g_assert_not_reached(); } } =20 diff --git a/tests/qtest/ipmi-kcs-test.c b/tests/qtest/ipmi-kcs-test.c index afc24dd3e4..3186c6ad64 100644 --- a/tests/qtest/ipmi-kcs-test.c +++ b/tests/qtest/ipmi-kcs-test.c @@ -145,7 +145,7 @@ static void kcs_cmd(uint8_t *cmd, unsigned int cmd_len, break; =20 default: - g_assert(0); + g_assert_not_reached(); } *rsp_len =3D j; } @@ -184,7 +184,7 @@ static void kcs_abort(uint8_t *cmd, unsigned int cmd_le= n, break; =20 default: - g_assert(0); + g_assert_not_reached(); } =20 /* Start the abort here */ diff --git a/tests/qtest/rtl8139-test.c b/tests/qtest/rtl8139-test.c index 8fa3313cc3..37e352c651 100644 --- a/tests/qtest/rtl8139-test.c +++ b/tests/qtest/rtl8139-test.c @@ -59,7 +59,7 @@ PORT(IntrMask, w, 0x3c) PORT(IntrStatus, w, 0x3E) PORT(TimerInt, l, 0x54) =20 -#define fatal(...) do { g_test_message(__VA_ARGS__); g_assert(0); } while = (0) +#define fatal(...) do { g_test_message(__VA_ARGS__); g_assert_not_reached(= ); } while (0) =20 static void test_timer(void) { --=20 2.38.1 From nobody Tue May 14 13:08:53 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1677022026; cv=none; d=zohomail.com; s=zohoarc; b=ImkmFhGOS1+QrOgKQ+PjbfYsPBtV0P5tsbnQUutsVNwt0N1ABQA/7NSu18b193lfnwDLd2qJ6w6/Scq2IgjB+lLqvfzGzsuRTDILlsEKdy1m0LbK1IUB/QMfA0ZBEolWbMQ0u0whuQIBo2LDAcZN9pHQhoUprJus/X/c4VouFs8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1677022026; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=cOPVh2gJbusm2XsmCeCaqslHPbfLfSgGJBWGPz8N7FE=; b=oBtlz2kn0FfJOX/9KtMIzBKtGCG8rusUF3sACL+eqzzUT7di97OMqAKN8G2ZY0q8YdNxRHMcxvYzB0fBpkEeJMz7wjGneBZbQYjuCNnjlEZXQXbXFbdzD1GkjZ2cjqiOdjbFy0etrz2AFYt+yGbCHvdoypZEMauJlnJMvvpRlfY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1677022026310546.8583581153646; Tue, 21 Feb 2023 15:27:06 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pUc1D-0005Lg-3c; Tue, 21 Feb 2023 18:25:55 -0500 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 1pUc19-0005HZ-B3 for qemu-devel@nongnu.org; Tue, 21 Feb 2023 18:25:51 -0500 Received: from mail-wm1-x333.google.com ([2a00:1450:4864:20::333]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pUc16-0002hr-O7 for qemu-devel@nongnu.org; Tue, 21 Feb 2023 18:25:51 -0500 Received: by mail-wm1-x333.google.com with SMTP id j3so2476555wms.2 for ; Tue, 21 Feb 2023 15:25:46 -0800 (PST) Received: from localhost.localdomain ([185.126.107.38]) by smtp.gmail.com with ESMTPSA id l37-20020a05600c1d2500b003db0ad636d1sm17942737wms.28.2023.02.21.15.25.44 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 21 Feb 2023 15:25:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; 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=cOPVh2gJbusm2XsmCeCaqslHPbfLfSgGJBWGPz8N7FE=; b=lPbMzBd3uLSLD6hbU4KVIqKOa34CIa5lGYUtsBxbhnJ/5QDmFrb2P0ue6CToAkUfjM HyIj2gRr/SxacC9XmxvtqfDJhCRNxw9L39Ctv3x+PU7eUQ1NqnPmj0TDhC08Vseqwl7r pKQtFHTcZOTDPHDboDZ6N4N0+cv4SnNFEh56NIy0wdtQmeY9juCmhH1gvd0+5PyJkk3F tYUbKOzVkOQFTb91wILMf4wGz5HO9ufZbiNhCXMWI85WFpaBrAUBt2efTCGDfmAAzm9Z wxR4uC9L//iLK4Suzi2qiDUCQgho6BLr48dKDGrsD94CWSCr0v7l+LcFy9k1KovvEjdj Etyw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=cOPVh2gJbusm2XsmCeCaqslHPbfLfSgGJBWGPz8N7FE=; b=TLNvGEVQaSpMkeVQ2LCFo7wkqfHFldlqTRbKRjw3y1w8LRxLRbdJymiDAkNk6A6ihI W1ObzOc9tLr4+WVQv556VoWScTCmCvkxwPqxXph9aI8HOBXvi7bPRApuTPtOSDqi4FrQ hNA+/uaYxGDQP5aiSfhIREEtQI3M5jzY6qVdhjgshZ4ioxsfgjQtNfzzDawX3pzI6DE+ qi9dy+taPCWtsIwY+bOIX6pJc8HRJSjrMEjVDwEPZjIL0HjpvUQI1CMdARxsIbssgvma UQ1fnm1cmj5H9jmMJwsouVi//4/MMhe74Z/8I1gEJYDNyfIDu+5iTz9T26j07+TkhsER 9ZJw== X-Gm-Message-State: AO0yUKWaDU+ZU4EL3dqAcDrMGDX4VticHWCUd72ua1M2OYVLYJ9s9/0C yOrt+pcd2KDDm3qnCJfwgctxtQCiwhH9s+sq X-Google-Smtp-Source: AK7set8Oa0nK7D79P6HYfLhZYcSH5VvVspCejAKAYa7t8JpeC/wRlvepUz7mJVQV+cpWP1uxzutTUw== X-Received: by 2002:a05:600c:198e:b0:3df:9858:c037 with SMTP id t14-20020a05600c198e00b003df9858c037mr4903370wmq.12.1677021945596; Tue, 21 Feb 2023 15:25:45 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-block@nongnu.org, qemu-arm@nongnu.org, Thomas Huth , qemu-ppc@nongnu.org, Eric Blake , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Kevin Wolf , Hanna Reitz Subject: [PATCH 4/5] block/vvfat: Remove pointless check of NDEBUG Date: Wed, 22 Feb 2023 00:25:19 +0100 Message-Id: <20230221232520.14480-5-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230221232520.14480-1-philmd@linaro.org> References: <20230221232520.14480-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::333; envelope-from=philmd@linaro.org; helo=mail-wm1-x333.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1677022028263100003 Since commit 262a69f428 ("osdep.h: Prohibit disabling assert() in supported builds") 'NDEBUG' can not be defined, so '#ifndef NDEBUG' is dead code. Remove it. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson --- block/vvfat.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/block/vvfat.c b/block/vvfat.c index d7d775bd2c..fd45e86416 100644 --- a/block/vvfat.c +++ b/block/vvfat.c @@ -2784,13 +2784,10 @@ static int handle_commits(BDRVVVFATState* s) fail =3D -2; break; case ACTION_WRITEOUT: { -#ifndef NDEBUG - /* these variables are only used by assert() below */ direntry_t* entry =3D array_get(&(s->directory), commit->param.writeout.dir_index); uint32_t begin =3D begin_of_direntry(entry); mapping_t* mapping =3D find_mapping_for_cluster(s, begin); -#endif =20 assert(mapping); assert(mapping->begin =3D=3D begin); --=20 2.38.1 From nobody Tue May 14 13:08:53 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1677022037; cv=none; d=zohomail.com; s=zohoarc; b=LxIfUTTC5OpbU1DYyhzKitRxn/ppLNrMhkrGezvCNznc8sBwqlt4cEeTC4rOIdcrYdTBx8FLrCFRfJxDwA/dDS4lYxr/B0jqUjxW6cNabTmyYtA8iF5u0pVvphpEPJVTS+m1Lp5X9SOyjDWCrKIV9UpsoSoOCMbv1U/B79XYwSs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1677022037; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=kCjOFfN/JCWa/PeEus9yAgUI0eq6WXQy8QoVJLxSGDI=; b=iij8JWI0zuWtWZSof5ow1D11hS4CQldOo79LfSt7aJcmQ+ZIAovIo3ILxFv4mVbjLxRzsdksMl4qxBedw7Q69MLq/OSm1Es8Wt4T/2ilSe4duHBsvbRB5J2uzIC6xul8RdaDcMw5w75yK2yj0qj/gdnvusZho/p0O2WERB1BWRE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1677022037627373.3344177572026; Tue, 21 Feb 2023 15:27:17 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pUc1G-0005Pb-5C; Tue, 21 Feb 2023 18:25:58 -0500 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 1pUc1C-0005LZ-V4 for qemu-devel@nongnu.org; Tue, 21 Feb 2023 18:25:54 -0500 Received: from mail-wm1-x333.google.com ([2a00:1450:4864:20::333]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pUc19-0002hn-Q4 for qemu-devel@nongnu.org; Tue, 21 Feb 2023 18:25:53 -0500 Received: by mail-wm1-x333.google.com with SMTP id p16so2211318wmq.5 for ; Tue, 21 Feb 2023 15:25:51 -0800 (PST) Received: from localhost.localdomain ([185.126.107.38]) by smtp.gmail.com with ESMTPSA id c24-20020a7bc858000000b003e11ad0750csm3155554wml.47.2023.02.21.15.25.49 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 21 Feb 2023 15:25:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; 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=kCjOFfN/JCWa/PeEus9yAgUI0eq6WXQy8QoVJLxSGDI=; b=jMMKDzXX2P8N4rIHCofsi7Cr6rQJJnrEkC2mpN7TAiI6UwEri8p3Yt2JfHWTayJUjI qoQ6lSksT7eR6cEkukai1JvI+BQXeSJTLkUWFiR6JqxmpZSWo7fFIMugI49JIJt1urTz 3F1X27CjnzS+zw3lMk71CkzYc1HqJpbMufkBnewUlZsHe33d02QJe931E6X0LRX5V6s0 GoMLYAbx5DGN7/TGyEggkcn90Ieb/nEjKFbAMNaF3SKVGbkGKzKnYZukpkzLAyoz3KVq Y3E5Cr5P/hOoFcqhjD6wIA+auK4W2DTtlTEOPLAl6/IeGszuRfms8b2JuOfcTjwEaulP 59VQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=kCjOFfN/JCWa/PeEus9yAgUI0eq6WXQy8QoVJLxSGDI=; b=KexXSLcf5l4zWUzjD7/h6+noyWJID8RpHd29LvMZbS4KIcq1ikfaZteClJ0a1Shcyd Id08DxH2cDnLz7wd2AG4FI9w0PUIP7LTEZwLGthGHV5pjT7TXv/DLPu8m6rxveXVDaIO BY0hOfG/2vtdSxiMSjsO6Qc3Qga2RNPNogQlbCLq80hctZTnKVZQ95QC/k0i0K5WqJ2r aDS+ezFAo+fJnkXGxOsU8MLUkgAqzP/pceUUAPOu2NFcXEYHL9fiA9BWnVoGncmbNZ+p jHMrNjV+1QpDRdRVK+i/ZlYoht68+fIkWRyu1T71yhIEiyokM5eO7fDCJdL56DShbKID QxzA== X-Gm-Message-State: AO0yUKWj2NTPuCH04tqIVj8up7aW8K1fkFg+Sfex7fwEzb5HxteWjpwB pYRsIF0D9wQY6Fe6EPjrNxK3PPd8hnfyZVlN X-Google-Smtp-Source: AK7set8hb5N4zqpLpQZaAsPu7Bg17Rq+2Fbq9vf+ucCPUcZ3h9/lLExvhr0UbFeJTdAon2CtAgnUqg== X-Received: by 2002:a05:600c:984:b0:3e1:fff7:e970 with SMTP id w4-20020a05600c098400b003e1fff7e970mr4862034wmp.30.1677021950629; Tue, 21 Feb 2023 15:25:50 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-block@nongnu.org, qemu-arm@nongnu.org, Thomas Huth , qemu-ppc@nongnu.org, Eric Blake , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Paolo Bonzini , Fam Zheng , "Michael S. Tsirkin" Subject: [PATCH 5/5] hw: Remove mentions of NDEBUG Date: Wed, 22 Feb 2023 00:25:20 +0100 Message-Id: <20230221232520.14480-6-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230221232520.14480-1-philmd@linaro.org> References: <20230221232520.14480-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::333; envelope-from=philmd@linaro.org; helo=mail-wm1-x333.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1677022038388100003 Since commit 262a69f428 ("osdep.h: Prohibit disabling assert() in supported builds") 'NDEBUG' can not be defined. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson --- hw/scsi/mptsas.c | 2 -- hw/virtio/virtio.c | 2 -- 2 files changed, 4 deletions(-) diff --git a/hw/scsi/mptsas.c b/hw/scsi/mptsas.c index c485da792c..5b373d3ed6 100644 --- a/hw/scsi/mptsas.c +++ b/hw/scsi/mptsas.c @@ -1240,8 +1240,6 @@ static void *mptsas_load_request(QEMUFile *f, SCSIReq= uest *sreq) n =3D qemu_get_be32(f); /* TODO: add a way for SCSIBusInfo's load_request to fail, * and fail migration instead of asserting here. - * This is just one thing (there are probably more) that must be - * fixed before we can allow NDEBUG compilation. */ assert(n >=3D 0); =20 diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c index f35178f5fc..c6b3e3fb08 100644 --- a/hw/virtio/virtio.c +++ b/hw/virtio/virtio.c @@ -1898,8 +1898,6 @@ void *qemu_get_virtqueue_element(VirtIODevice *vdev, = QEMUFile *f, size_t sz) =20 /* TODO: teach all callers that this can fail, and return failure inst= ead * of asserting here. - * This is just one thing (there are probably more) that must be - * fixed before we can allow NDEBUG compilation. */ assert(ARRAY_SIZE(data.in_addr) >=3D data.in_num); assert(ARRAY_SIZE(data.out_addr) >=3D data.out_num); --=20 2.38.1