* [PATCH v2] checkpatch: don't complain on _Generic() use
@ 2023-12-05 11:05 Przemek Kitszel
2024-01-09 7:32 ` Przemek Kitszel
0 siblings, 1 reply; 2+ messages in thread
From: Przemek Kitszel @ 2023-12-05 11:05 UTC (permalink / raw)
To: Andy Whitcroft, Joe Perches, linux-kernel
Cc: Jacob Keller, Dwaipayan Ray, Lukas Bulwahn, Rasmus Villemoes,
Przemek Kitszel
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
^ permalink raw reply [flat|nested] 2+ messages in thread* Re: [PATCH v2] checkpatch: don't complain on _Generic() use
2023-12-05 11:05 [PATCH v2] checkpatch: don't complain on _Generic() use Przemek Kitszel
@ 2024-01-09 7:32 ` Przemek Kitszel
0 siblings, 0 replies; 2+ messages in thread
From: Przemek Kitszel @ 2024-01-09 7:32 UTC (permalink / raw)
To: Andy Whitcroft, Joe Perches, linux-kernel
Cc: Jacob Keller, Dwaipayan Ray, Lukas Bulwahn, Rasmus Villemoes
On 12/5/23 12:05, Przemek Kitszel wrote:
> 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
Hi,
could I do anything more to have this patch applied?
Przemek
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2024-01-09 7:32 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-12-05 11:05 [PATCH v2] checkpatch: don't complain on _Generic() use Przemek Kitszel
2024-01-09 7:32 ` Przemek Kitszel
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®