From: Przemek Kitszel <przemyslaw.kitszel@intel.com>
To: Andy Whitcroft <apw@canonical.com>, Joe Perches <joe@perches.com>,
linux-kernel@vger.kernel.org
Cc: Jacob Keller <jacob.e.keller@intel.com>,
Dwaipayan Ray <dwaipayanray1@gmail.com>,
Lukas Bulwahn <lukas.bulwahn@gmail.com>,
Rasmus Villemoes <rasmus.villemoes@prevas.dk>,
Przemek Kitszel <przemyslaw.kitszel@intel.com>
Subject: [PATCH v2] checkpatch: don't complain on _Generic() use
Date: Tue, 5 Dec 2023 12:05:24 +0100 [thread overview]
Message-ID: <20231205110524.16561-1-przemyslaw.kitszel@intel.com> (raw)
Improve CamelCase recognition logic to avoid reporting on _Generic() use.
Other C keywords, such as _Bool, are intentionally omitted, as those
should be rather avoided in new source code.
Signed-off-by: Przemek Kitszel <przemyslaw.kitszel@intel.com>
---
v2: _Static_assert dropped from the scope;
whole word match.
v1 link: https://lkml.org/lkml/2023/11/27/1055
---
scripts/checkpatch.pl | 2 ++
1 file changed, 2 insertions(+)
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 25fdb7fda112..1370f426949d 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -5839,6 +5839,8 @@ sub process {
#CamelCase
if ($var !~ /^$Constant$/ &&
$var =~ /[A-Z][a-z]|[a-z][A-Z]/ &&
+#Ignore C keywords
+ $var !~ /^_Generic$/ &&
#Ignore some autogenerated defines and enum values
$var !~ /^(?:[A-Z]+_){1,5}[A-Z]{1,3}[a-z]/ &&
#Ignore Page<foo> variants
base-commit: 3706f141e5639d3034bd83448e929b8462362651
--
2.38.1
next reply other threads:[~2023-12-05 11:06 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-12-05 11:05 Przemek Kitszel [this message]
2024-01-09 7:32 ` Przemek Kitszel
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20231205110524.16561-1-przemyslaw.kitszel@intel.com \
--to=przemyslaw.kitszel@intel.com \
--cc=apw@canonical.com \
--cc=dwaipayanray1@gmail.com \
--cc=jacob.e.keller@intel.com \
--cc=joe@perches.com \
--cc=linux-kernel@vger.kernel.org \
--cc=lukas.bulwahn@gmail.com \
--cc=rasmus.villemoes@prevas.dk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®