diff options
-rwxr-xr-x | scripts/checkpatch.pl | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index bb88df2d001b..4680ccf7760c 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl | |||
@@ -146,6 +146,11 @@ our $UTF8 = qr { | |||
146 | | \xF4[\x80-\x8F][\x80-\xBF]{2} # plane 16 | 146 | | \xF4[\x80-\x8F][\x80-\xBF]{2} # plane 16 |
147 | }x; | 147 | }x; |
148 | 148 | ||
149 | our $typeTypedefs = qr{(?x: | ||
150 | (?:__)?(?:u|s|be|le)(?:\d|\d\d)| | ||
151 | atomic_t | ||
152 | )}; | ||
153 | |||
149 | our @typeList = ( | 154 | our @typeList = ( |
150 | qr{void}, | 155 | qr{void}, |
151 | qr{(?:unsigned\s+)?char}, | 156 | qr{(?:unsigned\s+)?char}, |
@@ -159,7 +164,6 @@ our @typeList = ( | |||
159 | qr{float}, | 164 | qr{float}, |
160 | qr{double}, | 165 | qr{double}, |
161 | qr{bool}, | 166 | qr{bool}, |
162 | qr{(?:__)?(?:u|s|be|le)(?:\d|\d\d)}, | ||
163 | qr{struct\s+$Ident}, | 167 | qr{struct\s+$Ident}, |
164 | qr{union\s+$Ident}, | 168 | qr{union\s+$Ident}, |
165 | qr{enum\s+$Ident}, | 169 | qr{enum\s+$Ident}, |
@@ -179,6 +183,7 @@ sub build_types { | |||
179 | (?:$Modifier\s+|const\s+)* | 183 | (?:$Modifier\s+|const\s+)* |
180 | (?: | 184 | (?: |
181 | (?:typeof|__typeof__)\s*\(\s*\**\s*$Ident\s*\)| | 185 | (?:typeof|__typeof__)\s*\(\s*\**\s*$Ident\s*\)| |
186 | (?:$typeTypedefs\b)| | ||
182 | (?:${all}\b) | 187 | (?:${all}\b) |
183 | ) | 188 | ) |
184 | (?:\s+$Modifier|\s+const)* | 189 | (?:\s+$Modifier|\s+const)* |
@@ -1589,6 +1594,7 @@ sub process { | |||
1589 | if ($line =~ /\btypedef\s/ && | 1594 | if ($line =~ /\btypedef\s/ && |
1590 | $line !~ /\btypedef\s+$Type\s+\(\s*\*?$Ident\s*\)\s*\(/ && | 1595 | $line !~ /\btypedef\s+$Type\s+\(\s*\*?$Ident\s*\)\s*\(/ && |
1591 | $line !~ /\btypedef\s+$Type\s+$Ident\s*\(/ && | 1596 | $line !~ /\btypedef\s+$Type\s+$Ident\s*\(/ && |
1597 | $line !~ /\b$typeTypedefs\b/ && | ||
1592 | $line !~ /\b__bitwise(?:__|)\b/) { | 1598 | $line !~ /\b__bitwise(?:__|)\b/) { |
1593 | WARN("do not add new typedefs\n" . $herecurr); | 1599 | WARN("do not add new typedefs\n" . $herecurr); |
1594 | } | 1600 | } |