Skip to contentSkip to conversation

checkpatch: don't check c99 types like uint8_t under tools

PATCH Applied Tomas Winkler 2 participants 2 messages Nov 16, 2016 Checkpatch

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 checkpatch: don't check c99 types like uint8_t under tools

Tools contains user space code so uintX_t types are just fine.

---
 scripts/checkpatch.pl | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
scripts/checkpatch.pl +2 -1
index a8368d1c4348..42c3221be6eb 100755
@@ -5548,8 +5548,9 @@ sub process {
 			      "Using weak declarations can have unintended link defects\n" . $herecurr);
 		}
 
-# check for c99 types like uint8_t used outside of uapi/
+# check for c99 types like uint8_t used outside of uapi/ and tools/
 		if ($realfile !~ m@\binclude/uapi/@ &&
+		    $realfile !~ m@\btools/@ &&
 		    $line =~ /\b($Declare)\s*$Ident\s*[=;,\[]/) {
 			my $type = $1;
 			if ($type =~ /\b($typeC99Typedefs)\b/) {
Signature · 1 line
2.7.4
maintainer Acked-by on v1 1/1
#1 lore raw
Quoted 12 lines · Tomas Winkler

Tools contains user space code so uintX_t types are just fine.

---
 scripts/checkpatch.pl | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
scripts/checkpatch.pl +0 -0
index a8368d1c4348..42c3221be6eb 100755

scripts/checkpatch.pl sub process { · line 5556

Quoted 10 lines
scripts/checkpatch.pl +2 -1
@@ -5548,8 +5548,9 @@ sub process {
 			      "Using weak declarations can have unintended link defects\n" . $herecurr);
 		}
 
-# check for c99 types like uint8_t used outside of uapi/
+# check for c99 types like uint8_t used outside of uapi/ and tools/
 		if ($realfile !~ m@\binclude/uapi/@ &&
+		    $realfile !~ m@\btools/@ &&
 		    $line =~ /\b($Declare)\s*$Ident\s*[=;,\[]/) {
 			my $type = $1;
 			if ($type =~ /\b($typeC99Typedefs)\b/) {

Makes sense, thanks.