aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/checkpatch.pl
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/checkpatch.pl')
-rwxr-xr-xscripts/checkpatch.pl8
1 files changed, 8 insertions, 0 deletions
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 6a3baa0bdde8..6705576198a6 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -339,6 +339,11 @@ our $UTF8 = qr{
339 | $NON_ASCII_UTF8 339 | $NON_ASCII_UTF8
340}x; 340}x;
341 341
342our $typeOtherOSTypedefs = qr{(?x:
343 u_(?:char|short|int|long) | # bsd
344 u(?:nchar|short|int|long) # sysv
345)};
346
342our $typeTypedefs = qr{(?x: 347our $typeTypedefs = qr{(?x:
343 (?:__)?(?:u|s|be|le)(?:8|16|32|64)| 348 (?:__)?(?:u|s|be|le)(?:8|16|32|64)|
344 atomic_t 349 atomic_t
@@ -475,6 +480,7 @@ sub build_types {
475 (?:$Modifier\s+|const\s+)* 480 (?:$Modifier\s+|const\s+)*
476 (?: 481 (?:
477 (?:typeof|__typeof__)\s*\([^\)]*\)| 482 (?:typeof|__typeof__)\s*\([^\)]*\)|
483 (?:$typeOtherOSTypedefs\b)|
478 (?:$typeTypedefs\b)| 484 (?:$typeTypedefs\b)|
479 (?:${all}\b) 485 (?:${all}\b)
480 ) 486 )
@@ -492,6 +498,7 @@ sub build_types {
492 (?: 498 (?:
493 (?:typeof|__typeof__)\s*\([^\)]*\)| 499 (?:typeof|__typeof__)\s*\([^\)]*\)|
494 (?:$typeTypedefs\b)| 500 (?:$typeTypedefs\b)|
501 (?:$typeOtherOSTypedefs\b)|
495 (?:${allWithAttr}\b) 502 (?:${allWithAttr}\b)
496 ) 503 )
497 (?:\s+$Modifier|\s+const)* 504 (?:\s+$Modifier|\s+const)*
@@ -3159,6 +3166,7 @@ sub process {
3159 $line !~ /\btypedef\s+$Type\s*\(\s*\*?$Ident\s*\)\s*\(/ && 3166 $line !~ /\btypedef\s+$Type\s*\(\s*\*?$Ident\s*\)\s*\(/ &&
3160 $line !~ /\btypedef\s+$Type\s+$Ident\s*\(/ && 3167 $line !~ /\btypedef\s+$Type\s+$Ident\s*\(/ &&
3161 $line !~ /\b$typeTypedefs\b/ && 3168 $line !~ /\b$typeTypedefs\b/ &&
3169 $line !~ /\b$typeOtherOSTypedefs\b/ &&
3162 $line !~ /\b__bitwise(?:__|)\b/) { 3170 $line !~ /\b__bitwise(?:__|)\b/) {
3163 WARN("NEW_TYPEDEFS", 3171 WARN("NEW_TYPEDEFS",
3164 "do not add new typedefs\n" . $herecurr); 3172 "do not add new typedefs\n" . $herecurr);