Thread (15 messages) 15 messages, 4 authors, 2024-07-10

[Intel-wired-lan] [PATCH iwl-next v1 1/6] checkpatch: don't complain on _Generic() use

flat view
STALE843d SUPERSEDED: 1 (0M)

From: Mateusz Polchlopek <hidden>
Date: 2024-07-03 13:12:40
Also in: intel-wired-lan, lkml
Subsystem: checkpatch, the rest · Maintainers: Andy Whitcroft, Joe Perches, Linus Torvalds

Status: Superseded by v2 (posted 2024-07-12). [go to v2]

Revision v1 (2 revisions archived); 1 review trailer.

Revisions (2)
  1. v1 current
  2. v2 [diff against previous]
From: Przemek Kitszel <przemyslaw.kitszel@intel.com>

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>
Reviewed-by: Wojciech Drewek <redacted>
Signed-off-by: Mateusz Polchlopek <redacted>
---
 scripts/checkpatch.pl | 2 ++
 1 file changed, 2 insertions(+)
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 2b812210b412..c4a087d325d4 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -5840,6 +5840,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
-- 
2.38.1
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help