Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id C7D84C4345F for ; Wed, 24 Apr 2024 20:25:23 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rzjAg-00059K-Ut; Wed, 24 Apr 2024 16:24:51 -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 1rzjAZ-00055O-4f for qemu-riscv@nongnu.org; Wed, 24 Apr 2024 16:24:47 -0400 Received: from mail-pf1-x42b.google.com ([2607:f8b0:4864:20::42b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rzjAX-0006XS-Cr for qemu-riscv@nongnu.org; Wed, 24 Apr 2024 16:24:42 -0400 Received: by mail-pf1-x42b.google.com with SMTP id d2e1a72fcca58-6f30f69a958so294629b3a.1 for ; Wed, 24 Apr 2024 13:24:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; t=1713990280; x=1714595080; 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=6k1TEiVk/yosToW5KCtbEMqzVSjxDe3oLoEdhyG1u/s=; b=DyOIafxouxjdtnMG3pX5z1SRPAkrv7lr6O3eS2eiI9G56V7MrAg3veyaCbC4QDdVw4 UjcF+mM2o5G+RIkCOwi3801PjjMFt1JhfrpCxEqOOtth5TuZM+rZ4AhSNrQc8Dh05emA n+7J/dOe++72dyyReAAwhulzB1RVuJOdTZOaqR3XxY/moNqJ4ff27BpkGt8SzR4ctQAX 6TkMz2XFajep5jXRAGCB7i28zpYQRpmywz/8pNdSR/tQ1pK7zuUebG1aIDYhQIXXeaT/ WhwhKWXZGqYeAzs0uKfGkmRSfqq1FOnjy0L6R+JVOdZh1vksU3Pn8fQeNqjWnDGwzgei cMnQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713990280; x=1714595080; 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=6k1TEiVk/yosToW5KCtbEMqzVSjxDe3oLoEdhyG1u/s=; b=aIV3JVaNWyEwkdvCjHDMRaeQbiQzak6RTSSaD17o+E68G+A1rtQN6zyLn4ANTH2WTx DLbE9Z+6R89pdEiNa9sH+XakDoCseVwgGO4ImW0J03I8lqHV80bMvJ5ApRwO2pMrVejO ZPmY0ECUEbkPNWTU6KwuW5gm65sPXoAeAubustXBw1/ZMEUvfQ67o8xJAL72Gj6UAS+O BBIk/sITa5frUjHEjRY88OCWcGQrnEsmvqMyj2xfOlO9sxh5w6DVrG8ZB5LzOWS5o9Tq d7OZnkp9cGFlv9MgxvZYNcjDhFFg1NFVwo3ykwvN4Cm3OdnDUQd0wOmmMNOk4T35oVaO OmCA== X-Gm-Message-State: AOJu0YxS874BLZO1EWeb+RBCr/wUEF1UGFg3OunpRKlrMfkziY1J2ixQ bwYsUg3pc/+6cB6Q+fMvRPw8NboBQ4TQQjxLqdORAppM+SFwI/7nRL3R0AbI2HM= X-Google-Smtp-Source: AGHT+IFjAy4P2BunZ2vBAbReCxsWdtAGGpbKIsRhXCgwMJf9aIMeHrx+Za/wGLdCUYmVbsAYeINLWw== X-Received: by 2002:a05:6a00:2d87:b0:6ed:60a4:6d9c with SMTP id fb7-20020a056a002d8700b006ed60a46d9cmr4422296pfb.4.1713990279992; Wed, 24 Apr 2024 13:24:39 -0700 (PDT) Received: from grind.. ([191.255.35.121]) by smtp.gmail.com with ESMTPSA id fm8-20020a056a002f8800b006ed059cdf02sm11862015pfb.116.2024.04.24.13.24.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Apr 2024 13:24:39 -0700 (PDT) From: Daniel Henrique Barboza To: qemu-devel@nongnu.org Cc: qemu-riscv@nongnu.org, alistair.francis@wdc.com, bmeng@tinylab.org, liwei1518@gmail.com, zhiwei_liu@linux.alibaba.com, palmer@rivosinc.com, thuth@redhat.com, alex.bennee@linaro.org, philmd@linaro.org, mjt@tls.msk.ru, ajones@ventanamicro.com, Daniel Henrique Barboza Subject: [PATCH v2 2/2] checkpatch.pl: forbid strerrorname_np() Date: Wed, 24 Apr 2024 17:24:25 -0300 Message-ID: <20240424202425.534338-3-dbarboza@ventanamicro.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240424202425.534338-1-dbarboza@ventanamicro.com> References: <20240424202425.534338-1-dbarboza@ventanamicro.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=2607:f8b0:4864:20::42b; envelope-from=dbarboza@ventanamicro.com; helo=mail-pf1-x42b.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-riscv@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-riscv-bounces+qemu-riscv=archiver.kernel.org@nongnu.org Sender: qemu-riscv-bounces+qemu-riscv=archiver.kernel.org@nongnu.org Commit d424db2354 removed an instance of strerrorname_np() because it was breaking building with musl libc. A recent RISC-V patch ended up re-introducing it again by accident. Put this function in the baddies list in checkpatch.pl to avoid this situation again. This is what it will look like next time: $ ./scripts/checkpatch.pl 0001-temp-test.patch ERROR: use strerror() instead of strerrorname_np() #22: FILE: target/riscv/kvm/kvm-cpu.c:1058: + strerrorname_np(errno)); total: 1 errors, 0 warnings, 10 lines checked Signed-off-by: Daniel Henrique Barboza Reviewed-by: Thomas Huth Reviewed-by: Philippe Mathieu-Daudé --- scripts/checkpatch.pl | 3 +++ 1 file changed, 3 insertions(+) diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index 7026895074..f7ffa74858 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl @@ -3078,6 +3078,9 @@ sub process { if ($line =~ /\b(g_)?assert\(0\)/) { ERROR("use g_assert_not_reached() instead of assert(0)\n" . $herecurr); } + if ($line =~ /\bstrerrorname_np\(/) { + ERROR("use strerror() instead of strerrorname_np()\n" . $herecurr); + } my $non_exit_glib_asserts = qr{g_assert_cmpstr| g_assert_cmpint| g_assert_cmpuint| -- 2.44.0