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: 1983496 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=DgM3TYdq; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=patchwork.ozlabs.org) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4X3J2l4FnJz1y1C for ; Wed, 11 Sep 2024 08:16:47 +1000 (AEST) 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-Google-Smtp-Source: AGHT+IFq8D12w3lrLR9iZPp9dBLWaCbloOusYWBwljwNqw7WFauubajh8SDyD921iLBgiiedqovYTQ== 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+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.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(-)