Message ID | 20221027134334.164301-1-stf_xl@wp.pl |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp245449wru; Thu, 27 Oct 2022 06:58:06 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7GPowomisgTq3Qvy+VaZbjL0cFqJ+vsOwYQXUqQUoonK6gVlYjlw/l2MpB0HKqe5gEN4oz X-Received: by 2002:a17:90a:2bc9:b0:212:8210:c92d with SMTP id n9-20020a17090a2bc900b002128210c92dmr10445226pje.38.1666879085778; Thu, 27 Oct 2022 06:58:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666879085; cv=none; d=google.com; s=arc-20160816; b=zdnKRLjw2NE4d1Hm7BgDxsgOtcN58Uy1IhP8mjNXMudYMbr7qvsVQ5MUNpBdRKUJjB lCPSEX0US4bbMPYL2jwJy4pCjsolTLTKDCiuYMq3CF6RYzroaZh3XtNrvHCbcgqsne7F nib1LmkW3UGx9iYCGjOQ2PtiQFqEzg0UHbT6/xBDLHPHsfmLEbxY6mUhuUhbNvKoaI71 yIqqT0+m7/4MPhCgpQxz/qhmy5VbnJDAID9rOzVfvNvE2afLXou0H2WqZG3edlB3vcgO wA+0nllu5HARu2hONCHPE7Tg0V3mbodVFRnZa7rro8KCCLV34BxH9QN18xldV3GhZI/L XEZA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=0jTZuFMOet0/Mkh7blWo8IBP2mkifDuxnD2liUJEdLI=; b=pyupNDiQp4X51A+0ldVodkD3hoV6roFcAEzB6u+juA3P5yUeEISHjeS+dxmEt0GEfJ F9opMH5gIjY7CxMwytG2v8XKwidioFxP2+HcSz7/JGouVm3NSU/yeNnA59oJiaD2sETY nNSC6G9HJKiX2NIUebdho2XL4/FiF2GF5RDMmUcHcBK96ScivXcUWku1klsQoeDuS6D6 ozWOsJaXdGQWJ8FbMo5VbJvQe2nH4OIuIJsMhsyu+bfQ9gZ4SajUPsXi/Z0aIC37d4GQ zZORXl42/yRSHAWcVLLm7kUgd1q4OBPxGBlKT+/ELxGS9W6dVl8Nmz3xiYidwvsTYDAB vtFQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass (test mode) header.i=@wp.pl header.s=1024a header.b=PH7P4e85; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=wp.pl Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id e1-20020a17090301c100b00177f35ce11fsi1925632plh.22.2022.10.27.06.57.50; Thu, 27 Oct 2022 06:58:05 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass (test mode) header.i=@wp.pl header.s=1024a header.b=PH7P4e85; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=wp.pl Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235693AbiJ0Nnk (ORCPT <rfc822;chrisfriedt@gmail.com> + 99 others); Thu, 27 Oct 2022 09:43:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59152 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233403AbiJ0Nnj (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Thu, 27 Oct 2022 09:43:39 -0400 Received: from mx4.wp.pl (mx4.wp.pl [212.77.101.12]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C5558101192 for <linux-kernel@vger.kernel.org>; Thu, 27 Oct 2022 06:43:37 -0700 (PDT) Received: (wp-smtpd smtp.wp.pl 21206 invoked from network); 27 Oct 2022 15:43:34 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wp.pl; s=1024a; t=1666878214; bh=0jTZuFMOet0/Mkh7blWo8IBP2mkifDuxnD2liUJEdLI=; h=From:To:Cc:Subject; b=PH7P4e85jPsp92b4BrWX9Bd3o1Dx4MILCfGYxKmr2Z3jU1tNzC9WbCdSCgydcUsM5 oYDRXw5WayBJmlbOC0it5tEPs/EV4KvqZj9I6gkaAFJU1elyILlAjKd8/8y9CaynKj TloCMQkh0/VePtRXkaMUQPNuREdaR4oCIAYJ03XM= Received: from 89-64-7-202.dynamic.chello.pl (HELO localhost) (stf_xl@wp.pl@[89.64.7.202]) (envelope-sender <stf_xl@wp.pl>) by smtp.wp.pl (WP-SMTPD) with ECDHE-RSA-AES256-GCM-SHA384 encrypted SMTP for <akpm@linux-foundation.org>; 27 Oct 2022 15:43:34 +0200 From: Stanislaw Gruszka <stf_xl@wp.pl> To: Andrew Morton <akpm@linux-foundation.org>, Joe Perches <joe@perches.com>, Andy Whitcroft <apw@canonical.com> Cc: Dwaipayan Ray <dwaipayanray1@gmail.com>, Lukas Bulwahn <lukas.bulwahn@gmail.com>, linux-kernel@vger.kernel.org Subject: [PATCH v2] scripts: checkpatch: allow "case" macros Date: Thu, 27 Oct 2022 15:43:34 +0200 Message-Id: <20221027134334.164301-1-stf_xl@wp.pl> X-Mailer: git-send-email 2.25.4 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-WP-MailID: 15cd002cc8fdabecd2e0a63b415f080c X-WP-AV: skaner antywirusowy Poczty Wirtualnej Polski X-WP-SPAM: NO 000000B [wcOE] X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747849404289927101?= X-GMAIL-MSGID: =?utf-8?q?1747849404289927101?= |
Series |
[v2] scripts: checkpatch: allow "case" macros
|
|
Commit Message
Stanislaw Gruszka
Oct. 27, 2022, 1:43 p.m. UTC
Do not report errors like below:
./scripts/checkpatch.pl -f drivers/net/wireless/ath/ath10k/wmi.h
ERROR: Macros with complex values should be enclosed in parentheses
+#define C2S(x) case x: return #x
since many "case ..." macros are already used by some in-kernel drivers.
Signed-off-by: Stanislaw Gruszka <stf_xl@wp.pl>
---
scripts/checkpatch.pl | 1 +
1 file changed, 1 insertion(+)
Comments
On Thu, 2022-10-27 at 15:43 +0200, Stanislaw Gruszka wrote: > Do not report errors like below: > > ./scripts/checkpatch.pl -f drivers/net/wireless/ath/ath10k/wmi.h > > ERROR: Macros with complex values should be enclosed in parentheses > +#define C2S(x) case x: return #x > > since many "case ..." macros are already used by some in-kernel drivers. > > Signed-off-by: Stanislaw Gruszka <stf_xl@wp.pl> Acked-by: Joe Perches <joe@perches.com> > --- > scripts/checkpatch.pl | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl > index 1e5e66ae5a52..4b888b1313d5 100755 > --- a/scripts/checkpatch.pl > +++ b/scripts/checkpatch.pl > @@ -5901,6 +5901,7 @@ sub process { > $dstat !~ /$exceptions/ && > $dstat !~ /^\.$Ident\s*=/ && # .foo = > $dstat !~ /^(?:\#\s*$Ident|\#\s*$Constant)\s*$/ && # stringification #foo > + $dstat !~ /^case\b/ && # case ... > $dstat !~ /^do\s*$Constant\s*while\s*$Constant;?$/ && # do {...} while (...); // do {...} while (...) > $dstat !~ /^while\s*$Constant\s*$Constant\s*$/ && # while (...) {...} > $dstat !~ /^for\s*$Constant$/ && # for (...)
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index 1e5e66ae5a52..4b888b1313d5 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl @@ -5901,6 +5901,7 @@ sub process { $dstat !~ /$exceptions/ && $dstat !~ /^\.$Ident\s*=/ && # .foo = $dstat !~ /^(?:\#\s*$Ident|\#\s*$Constant)\s*$/ && # stringification #foo + $dstat !~ /^case\b/ && # case ... $dstat !~ /^do\s*$Constant\s*while\s*$Constant;?$/ && # do {...} while (...); // do {...} while (...) $dstat !~ /^while\s*$Constant\s*$Constant\s*$/ && # while (...) {...} $dstat !~ /^for\s*$Constant$/ && # for (...)