From patchwork Tue Sep 10 22:15:27 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pierrick Bouvier X-Patchwork-Id: 827045 Delivered-To: patch@linaro.org Received: by 2002:adf:ab1c:0:b0:367:895a:4699 with SMTP id q28csp528549wrc; Tue, 10 Sep 2024 15:16:46 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCXtyxI9P5q14hqnm3wtgpZkZl5xNpX90Ck4ZTirZmlp4Ogi0GI7lIqYtAssfzPuoUMZbDx5hw==@linaro.org X-Google-Smtp-Source: AGHT+IGkcnrDQpfcKXufwWZqvLVZ3PLgX/GRi8FOsIEg1Y2vpffAI3c9eMW5Z/keNz1gQjqE2RE7 X-Received: by 2002:a05:622a:2c9:b0:458:1e37:f82 with SMTP id d75a77b69052e-4583c765edemr89356991cf.18.1726006606352; Tue, 10 Sep 2024 15:16:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1726006606; cv=none; d=google.com; s=arc-20240605; b=aQSu1tWjf8RJDOmVe++Sm/2mcCmFqXowPYVqMzX49iDGqSGWf0Z1uCsYB1M/C+uGCA Eph0TXm6Mrf0Gbd/UOMsJIbEvJ2lx2vDk3tNqIOFbUA6Aqgx5h20BkRBl5h+fMtd23Cw fxfpEVCGyFmlmAV6o3ciR6CaZvhcLnNUDXhAitPbu5D+TSzl2/PFvb/zYGYhpOORwgSp bgU8OAiP4GKsKv5oMvdFNa4Zs8NogEWenK+y18eb0uNg6+0+CNAJwz0j257hwW0jay6B iFB31Zg9sIC08+b42kaomrOg43Omuor3XhnLmzxiUECasGDsQc3L3JGKmxAZlE5NJU2B GocA== 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:message-id:date:subject:cc:to:from:dkim-signature; bh=YSyqJppZZS4UpzgxKNiY6ieJzLYfceDr8xhPE0xjFbI=; fh=ynTlK/oH/ur5RqvPhczOwhj4YatH1hTHyPq9uMdf314=; b=FuWkjeQv6wDkVoRP6kpRHGkZQ2biOMgrPCXfpF0EVXSQ+UouvnmWPxt+n8EHa6hXga 4E1Q7B89SL3GfkOzJFT5+jcL219n660aSF6ClyiPFE4aa09w8113iZDkqoCUqRaBvZjk t8LFOWBW/ok0ZdNvz1hvt3S5sGi0tkeso+j8COcNY70YxPQ1qWN218RONoH8YD0VMcPl 4ax0OOIoXGzx9jqGKZ7hA+1RD+FefZBq6+rhtVUKZTW52knndncA/K9OLWewqok/e8em WZmwD1GHn9eQ09hQW7Z33ZPGXyei/jrdJQVlWxIU795+4bbYq3P4BdaoQ7qKoBOYWMgQ CZVA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=DgM3TYdq; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=fail header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id d75a77b69052e-45822fa6c7dsi90942871cf.548.2024.09.10.15.16.46 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 10 Sep 2024 15:16:46 -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=fail header.i=@linaro.org header.s=google header.b=DgM3TYdq; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=fail header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1so99p-0006az-B5; Tue, 10 Sep 2024 18:16:21 -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 1so99j-0006Rm-RS for qemu-devel@nongnu.org; Tue, 10 Sep 2024 18:16:16 -0400 Received: from mail-pf1-x431.google.com ([2607:f8b0:4864:20::431]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1so99g-0006RX-99 for qemu-devel@nongnu.org; Tue, 10 Sep 2024 18:16:15 -0400 Received: by mail-pf1-x431.google.com with SMTP id d2e1a72fcca58-71798661a52so233952b3a.0 for ; Tue, 10 Sep 2024 15:16:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1726006570; x=1726611370; darn=nongnu.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=YSyqJppZZS4UpzgxKNiY6ieJzLYfceDr8xhPE0xjFbI=; b=DgM3TYdqDLAoXO1ahL5m0BMH82qpbxJ7ZnqH48YL2TxDqwtWjAXoldG0wEyAentiB3 2dK7hUwlqBbwPpUhDQhPOQwedIrc22os38nCwC68W5tbOuTd1rbT13Bhnh0izYx89JLk EgikWt4GwduDAo2BEx8a3D3W3AA1S8aqYwaHVED5E6kJt4OgmmRF4aCSMac9F8PVfsCW 9sMvGsb8rqU+u47TA3XJwwvJa1WtkzGWPxwOtgs1ZfT6hm3TmbMzNgVDpZAqr68SF7sG gpy5EwJB8QC7TqXjyiKRNc44oAqhUrgfUMo7IKH36WgMGiU6wRJkW6s1G5eiJxzfi8DV h5AA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1726006571; x=1726611371; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=YSyqJppZZS4UpzgxKNiY6ieJzLYfceDr8xhPE0xjFbI=; b=pyRexNtfNGqDlLrgH4EhlHaiOZwDsuyud79v8ePSnVXRL78kioiYYlN9iRvek0ody9 /vyuhr1Pkzyu4ONFFk3RYYNZlvRjdCGx2e8wiTzp5UwtIBcIIX/04oVzqisnBCK5YiK5 Maw34cLKDcNGyjzBb6S6Py0UXacwMFlXIFITkg74fVYJ0IYcTuKz6pf9lCdzp8v8isS3 uCIfMajVLtQwjBvBU7yhYRtV0SagQjSg8Hr4UhgfDKzzKOppsO4LzH3HI6iOV5VqkTl9 Zn2Rzm8O3f4hqnZL5b+tl73gKx0Xh2591LfcE0VqMtb+rEqmw2/eMbX72/nFeJ36Oca6 ySug== X-Gm-Message-State: AOJu0Yyfq7XtWWtNvxIQQOrFykQenSbpnklxt3GMwGcnE8oQZ0yubErw 5JETxwnwt1DCjy5JwHhy8HS1LZ6/iRKEYKW1xdolsl6U97KXvdqd+vDfqjEwdlxqnuyOcIbQEIF W7TglZMYJ X-Received: by 2002:a05:6a00:9484:b0:712:7512:add9 with SMTP id d2e1a72fcca58-71907f2dc50mr6196737b3a.13.1726006570484; Tue, 10 Sep 2024 15:16:10 -0700 (PDT) Received: from linaro.vn.shawcable.net ([2604:3d08:9384:1d00::9633]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-71909003d0esm1884055b3a.93.2024.09.10.15.16.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Sep 2024 15:16:10 -0700 (PDT) From: Pierrick Bouvier To: qemu-devel@nongnu.org Cc: Zhao Liu , "Richard W.M. Jones" , Joel Stanley , Kevin Wolf , Paolo Bonzini , qemu-arm@nongnu.org, Corey Minyard , Eric Farman , Thomas Huth , Keith Busch , WANG Xuerui , Hyman Huang , Stefan Berger , Michael Rolnik , Alistair Francis , =?utf-8?q?Marc-Andr=C3=A9_Lure?= =?utf-8?q?au?= , Markus Armbruster , Sriram Yagnaraman , Palmer Dabbelt , qemu-riscv@nongnu.org, Ani Sinha , Halil Pasic , Jesper Devantier , Laurent Vivier , Peter Maydell , Igor Mammedov , kvm@vger.kernel.org, =?utf-8?q?Alex_Be?= =?utf-8?q?nn=C3=A9e?= , Richard Henderson , Fam Zheng , qemu-s390x@nongnu.org, Hanna Reitz , Nicholas Piggin , Eduardo Habkost , Laurent Vivier , Rob Herring , Marcel Apfelbaum , qemu-block@nongnu.org, "Maciej S. Szmigiero" , qemu-ppc@nongnu.org, Daniel Henrique Barboza , Christian Borntraeger , Harsh Prateek Bora , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= , Nina Schoetterl-Glausch , "Michael S. Tsirkin" , Fabiano Rosas , Helge Deller , Dmitry Fleytman , Daniel Henrique Barboza , Akihiko Odaki , Marcelo Tosatti , David Gibson , Aurelien Jarno , Liu Zhiwei , Yanan Wang , Peter Xu , Bin Meng , Weiwei Li , Klaus Jensen , Jean-Christophe Dubois , Jason Wang , Pierrick Bouvier Subject: [PATCH 00/39] Use g_assert_not_reached instead of (g_)assert(0, false) Date: Tue, 10 Sep 2024 15:15:27 -0700 Message-Id: <20240910221606.1817478-1-pierrick.bouvier@linaro.org> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::431; envelope-from=pierrick.bouvier@linaro.org; helo=mail-pf1-x431.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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org This series cleans up all usages of assert/g_assert who are supposed to stop execution of QEMU. We replace those by g_assert_not_reached(). It was suggested recently when cleaning codebase to build QEMU with gcc and tsan: https://lore.kernel.org/qemu-devel/54bb02a6-1b12-460a-97f6-3f478ef766c6@linaro.org/. In more, cleanup useless break after g_assert_not_reached(); And finally, ensure with scripts/checkpatch.pl that we don't reintroduce (g_)assert(false) in the future. Pierrick Bouvier (39): docs/spin: replace assert(0) with g_assert_not_reached() hw/acpi: replace assert(0) with g_assert_not_reached() hw/arm: replace assert(0) with g_assert_not_reached() hw/char: replace assert(0) with g_assert_not_reached() hw/core: replace assert(0) with g_assert_not_reached() hw/net: replace assert(0) with g_assert_not_reached() hw/watchdog: replace assert(0) with g_assert_not_reached() migration: replace assert(0) with g_assert_not_reached() qobject: replace assert(0) with g_assert_not_reached() system: replace assert(0) with g_assert_not_reached() target/ppc: replace assert(0) with g_assert_not_reached() tests/qtest: replace assert(0) with g_assert_not_reached() tests/unit: replace assert(0) with g_assert_not_reached() include/hw/s390x: replace assert(false) with g_assert_not_reached() block: replace assert(false) with g_assert_not_reached() hw/hyperv: replace assert(false) with g_assert_not_reached() hw/net: replace assert(false) with g_assert_not_reached() hw/nvme: replace assert(false) with g_assert_not_reached() hw/pci: replace assert(false) with g_assert_not_reached() hw/ppc: replace assert(false) with g_assert_not_reached() migration: replace assert(false) with g_assert_not_reached() target/i386/kvm: replace assert(false) with g_assert_not_reached() tests/qtest: replace assert(false) with g_assert_not_reached() accel/tcg: remove break after g_assert_not_reached() block: remove break after g_assert_not_reached() hw/acpi: remove break after g_assert_not_reached() hw/gpio: remove break after g_assert_not_reached() hw/misc: remove break after g_assert_not_reached() hw/net: remove break after g_assert_not_reached() hw/pci-host: remove break after g_assert_not_reached() hw/scsi: remove break after g_assert_not_reached() hw/tpm: remove break after g_assert_not_reached() target/arm: remove break after g_assert_not_reached() target/riscv: remove break after g_assert_not_reached() tests/qtest: remove break after g_assert_not_reached() ui: remove break after g_assert_not_reached() fpu: remove break after g_assert_not_reached() tcg/loongarch64: remove break after g_assert_not_reached() scripts/checkpatch.pl: emit error when using assert(false) docs/spin/aio_notify_accept.promela | 6 +++--- docs/spin/aio_notify_bug.promela | 6 +++--- include/hw/s390x/cpu-topology.h | 2 +- accel/tcg/plugin-gen.c | 1 - block/qcow2.c | 2 +- block/ssh.c | 1 - hw/acpi/aml-build.c | 3 +-- hw/arm/highbank.c | 2 +- hw/char/avr_usart.c | 2 +- hw/core/numa.c | 2 +- hw/gpio/nrf51_gpio.c | 1 - hw/hyperv/hyperv_testdev.c | 6 +++--- hw/hyperv/vmbus.c | 12 ++++++------ hw/misc/imx6_ccm.c | 1 - hw/misc/mac_via.c | 2 -- hw/net/e1000e_core.c | 2 +- hw/net/i82596.c | 2 +- hw/net/igb_core.c | 2 +- hw/net/net_rx_pkt.c | 3 +-- hw/nvme/ctrl.c | 8 ++++---- hw/pci-host/gt64120.c | 2 -- hw/pci/pci-stub.c | 4 ++-- hw/ppc/spapr_events.c | 2 +- hw/scsi/virtio-scsi.c | 1 - hw/tpm/tpm_spapr.c | 1 - hw/watchdog/watchdog.c | 2 +- migration/dirtyrate.c | 2 +- migration/migration-hmp-cmds.c | 2 +- migration/postcopy-ram.c | 14 +++++++------- migration/ram.c | 6 +++--- qobject/qlit.c | 2 +- qobject/qnum.c | 8 ++++---- system/rtc.c | 2 +- target/arm/hyp_gdbstub.c | 1 - target/i386/kvm/kvm.c | 4 ++-- target/ppc/dfp_helper.c | 8 ++++---- target/ppc/mmu_helper.c | 2 +- target/riscv/monitor.c | 1 - tests/qtest/ipmi-bt-test.c | 2 +- tests/qtest/ipmi-kcs-test.c | 4 ++-- tests/qtest/migration-helpers.c | 1 - tests/qtest/numa-test.c | 10 +++++----- tests/qtest/rtl8139-test.c | 2 +- tests/unit/test-xs-node.c | 4 ++-- ui/qemu-pixman.c | 1 - fpu/softfloat-parts.c.inc | 2 -- target/riscv/insn_trans/trans_rvv.c.inc | 2 -- tcg/loongarch64/tcg-target.c.inc | 1 - scripts/checkpatch.pl | 3 +++ 49 files changed, 72 insertions(+), 90 deletions(-)