From patchwork Thu Sep 12 16:11:50 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pierrick Bouvier X-Patchwork-Id: 827837 Delivered-To: patch@linaro.org Received: by 2002:adf:ab1c:0:b0:367:895a:4699 with SMTP id q28csp1358960wrc; Thu, 12 Sep 2024 09:13:25 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVeaWHvd7TLJQJoHwIw045aO58+2qZm0A8og7NpqBsU+Ksf1UY6XmcPamKe9GjqZMUzPcFvLQ==@linaro.org X-Google-Smtp-Source: AGHT+IH+wdKcXe0ydO2xxwWqa0/R1FJ8keRMlam0s7Xacvu9MV2GXpl3h5F2jjdj/O+xl+J/0R51 X-Received: by 2002:a05:620a:28d2:b0:7a5:27e:8814 with SMTP id af79cd13be357-7a9e5f5ef8amr476685785a.44.1726157605526; Thu, 12 Sep 2024 09:13:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1726157605; cv=none; d=google.com; s=arc-20240605; b=Q+c7XLSvJVKBrF565Sgg8kYBzPMevtYDjed5Aw4ixRBY55B2/pqxjBdNpnK6ReGcHB Wcxq+eMSHQe1dYxfGAftU4sOdqB7sF1OncTJa7Na2WVtOTXr7uJc1VYDrsYF/35ldOuF YXmT6O11QJnxmBckHTNzTn/HWOXSVrMeRutPVbAmzk3c2Rm/qLpQjoKirTTQF3kN+RXE dagV6bK4zHCPg3PFh1TYIzlOOOIpOPrqgmTwifKnjHYK91oUmD8mEW02o1uRwldy84Te BAOfUt+h1pFnToo5SjvSONX9KRG2bOM2Y0MQRswPpzqgfu/3+YYQogQB71bnfa/MC5JZ 6f1g== 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=HWN+Oy9HOzHEP1zqC69VZ8fDvc5xR6kboU5Mz4xPMnU=; fh=ujiE8HSy6YTG7a3Z7CGLGec891YtQfFM1W/0TkY2zUo=; b=Ng22qx7suMoaCGU1slBk1M2AhAqwXuaVZK636Vj0YJY5pyTL/6zL2TM1Dgzzyb/CnV 3VHF3l5Cj/DhFpkrgSzOCBGYDOR17w8fubhI2oATudEnyglH8/UyEDOc7zuaxpdiEIUc cBcRH36RFO+dOJZdaWRLRvI9ykUd+NxlzVJi0Sp2c10RZ/TMfVi0L5S8bIlqX/lKGy/f qsL/cSt6zPN6zOEf4oVt/XdvTZ0KJcuLo32Da8wqf5ZYMztC88zuolfaNGr5LRiiWnlm zZ4yy5axlIRH777ZZRJ81vk/g2qheitowT9Ki2Nkht04gjRs2LWrTq0XZlOyvSPiP0uN W14w==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=qliJfrYW; 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=linaro.org; dara=neutral 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 af79cd13be357-7a9a7a54d47si1338078885a.578.2024.09.12.09.13.25 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 12 Sep 2024 09:13:25 -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=@linaro.org header.s=google header.b=qliJfrYW; 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=linaro.org; dara=neutral 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 1somQh-0001VC-15; Thu, 12 Sep 2024 12:12:23 -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 1somQc-00018n-5z for qemu-devel@nongnu.org; Thu, 12 Sep 2024 12:12:18 -0400 Received: from mail-pg1-x52f.google.com ([2607:f8b0:4864:20::52f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1somQa-0007Vm-E1 for qemu-devel@nongnu.org; Thu, 12 Sep 2024 12:12:17 -0400 Received: by mail-pg1-x52f.google.com with SMTP id 41be03b00d2f7-7db19de6346so839486a12.2 for ; Thu, 12 Sep 2024 09:12:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1726157535; x=1726762335; darn=nongnu.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=HWN+Oy9HOzHEP1zqC69VZ8fDvc5xR6kboU5Mz4xPMnU=; b=qliJfrYWjg9UCQEjJ/2fj5MgAM67NRso0rLrm660LjwhmRDC2ygYSZLO0MdAOhZLkm tBE6SMfcNoOXrtbdVGHJA3NMRmL59t0dmB/IJ6+/0vxlYD+UBA/xVSRCArPRzLRNCRMx kCYUMvfJq6o70EMpqu+g5dmGkcJRdACfz+McdEB/U7YkREMM9hRpOuX1L2l8KczvBO7P KKBvrIEc2actiK7SFCxYDJq4nLEu/KO6oU30Lcutp2C1wBbOFt0tv+9NRmQ5IrCL5q0E CdcMex/H3y0XJ3hY9OXonjj4N0KdG9pz32SLwT7CWnKdPYbWuz9yaf4DKAVpmHvSFPH+ G91g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1726157535; x=1726762335; 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=HWN+Oy9HOzHEP1zqC69VZ8fDvc5xR6kboU5Mz4xPMnU=; b=nj4q+Xv6zDjzdJLh5+JAIBmkf6FAzgsI0F/Bwpw4xn2eCkqbR31welaR4jQIpgDiYV hFNCtCrvGwqsPEOXzEhoWmzDpsIn00dFv2FFkPyQDznLq8BLdfHSjOghSP+woAsdJVF3 sSGdLSihH8GuanVm+rEFbMpcOft+jyi/1410okdHEFdLHeiYQ355xP8NSTFUtY/GtTDC 8ErUjzS632q3jEIgUnCoTc81pHtobKrbGs8HiRW4TznQUOajgwnZ6Woj2J3SuZPuM+3J Z11TtZPuGNOjP+xiu6s4Hc0HY7gbpXqTPBw2UuQp9+QTxSs6kcjHZrmk2wMQRT+OtAEV j+cA== X-Gm-Message-State: AOJu0YypN1wOIcKzU8ASw7zzCbc5h25M/TcTfSpM9Bt6f6mvep5JKA5q zdjvlsPqTyXplrJ2IMtofD436QFSSNIFRrjWgSLuSFuXGekiCY4GKlbsqWJBANL4z3NyiubCNXN P+bqvXP4T X-Received: by 2002:a17:90b:4c41:b0:2c9:3370:56e3 with SMTP id 98e67ed59e1d1-2dba008304amr3540812a91.34.1726157534900; Thu, 12 Sep 2024 09:12:14 -0700 (PDT) Received: from linaro.vn.shawcable.net ([2604:3d08:9384:1d00::9633]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2db0419aab4sm10868139a91.15.2024.09.12.09.12.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 Sep 2024 09:12:14 -0700 (PDT) From: Pierrick Bouvier To: qemu-devel@nongnu.org Cc: =?utf-8?q?Alex_Benn=C3=A9e?= , Nicholas Piggin , Igor Mammedov , Akihiko Odaki , Weiwei Li , "Maciej S. Szmigiero" , qemu-s390x@nongnu.org, Michael Rolnik , Liu Zhiwei , =?utf-8?q?Daniel_P=2E_Berrang?= =?utf-8?q?=C3=A9?= , Palmer Dabbelt , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Nina Schoetterl-Glausch , Yanan Wang , Marcel Apfelbaum , Dmitry Fleytman , Stefan Berger , Halil Pasic , Paolo Bonzini , Laurent Vivier , Daniel Henrique Barboza , =?utf-8?q?Marc-Andr=C3=A9_?= =?utf-8?q?Lureau?= , kvm@vger.kernel.org, Joel Stanley , qemu-riscv@nongnu.org, Aurelien Jarno , Fabiano Rosas , Eduardo Habkost , Harsh Prateek Bora , Peter Xu , Hyman Huang , Rob Herring , Peter Maydell , Kevin Wolf , Marcelo Tosatti , Eric Farman , Helge Deller , Jesper Devantier , Daniel Henrique Barboza , Fam Zheng , Klaus Jensen , Keith Busch , Zhao Liu , qemu-ppc@nongnu.org, Jean-Christophe Dubois , Christian Borntraeger , David Gibson , WANG Xuerui , Laurent Vivier , Richard Henderson , Markus Armbruster , Sriram Yagnaraman , Bin Meng , Ani Sinha , qemu-block@nongnu.org, qemu-arm@nongnu.org, Thomas Huth , Jason Wang , "Richard W.M. Jones" , "Michael S. Tsirkin" , Hanna Reitz , Corey Minyard , Alistair Francis , Pierrick Bouvier Subject: [PATCH v2 48/48] scripts/checkpatch.pl: emit error when using assert(false) Date: Thu, 12 Sep 2024 09:11:50 -0700 Message-Id: <20240912161150.483515-5-pierrick.bouvier@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240912161150.483515-1-pierrick.bouvier@linaro.org> References: <20240912161150.483515-1-pierrick.bouvier@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::52f; envelope-from=pierrick.bouvier@linaro.org; helo=mail-pg1-x52f.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=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 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 Signed-off-by: Pierrick Bouvier --- scripts/checkpatch.pl | 3 +++ 1 file changed, 3 insertions(+) diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index 65b6f46f905..fa9c12230eb 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl @@ -3102,6 +3102,9 @@ sub process { if ($line =~ /\b(g_)?assert\(0\)/) { ERROR("use g_assert_not_reached() instead of assert(0)\n" . $herecurr); } + if ($line =~ /\b(g_)?assert\(false\)/) { + ERROR("use g_assert_not_reached() instead of assert(false)\n" . $herecurr); + } if ($line =~ /\bstrerrorname_np\(/) { ERROR("use strerror() instead of strerrorname_np()\n" . $herecurr); }