From: Przemek Kitszel Date: Mon, 16 Dec 2024 14:15:30 +0000 (+0100) Subject: checkpatch: don't complain on _Generic() use X-Git-Tag: v6.14-rc1~162^2~188^2~5 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=20d00cfae627f048560c46ba5849011a34515103;p=thirdparty%2Fkernel%2Flinux.git checkpatch: don't complain on _Generic() use 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. Reviewed-by: Wojciech Drewek Reviewed-by: Simon Horman Signed-off-by: Mateusz Polchlopek Acked-by: Joe Perches Signed-off-by: Przemek Kitszel Signed-off-by: Tony Nguyen --- diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index 9eed3683ad76c..a2066a6c9dd8b 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl @@ -5843,6 +5843,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 variants