Commit 7840a94cd12559d8aee6382fafb85fbc9eb3a2c2
Committed by
Linus Torvalds
1 parent
1986aaf828
Exists in
master
and in
4 other branches
checkpatch: refactor 'allowed asm includes' and add memory.h
Change the check suggesting replacement of asm-includes with linux-includes. Exceptions to this rule are easier to extend now. Add memory.h because ARM has a custom one. Signed-off-by: Wolfram Sang <w.sang@pengutronix.de> Cc: Russell King <linux@arm.linux.org.uk> Cc: Andy Whitcroft <apw@shadowen.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Showing 1 changed file with 7 additions and 1 deletions Side-by-side Diff
scripts/checkpatch.pl
... | ... | @@ -224,6 +224,12 @@ |
224 | 224 | qr{fastcall}, |
225 | 225 | ); |
226 | 226 | |
227 | +our $allowed_asm_includes = qr{(?x: | |
228 | + irq| | |
229 | + memory | |
230 | +)}; | |
231 | +# memory.h: ARM has a custom one | |
232 | + | |
227 | 233 | sub build_types { |
228 | 234 | my $mods = "(?x: \n" . join("|\n ", @modifierList) . "\n)"; |
229 | 235 | my $all = "(?x: \n" . join("|\n ", @typeList) . "\n)"; |
... | ... | @@ -2308,7 +2314,7 @@ |
2308 | 2314 | my $checkfile = "include/linux/$file"; |
2309 | 2315 | if (-f "$root/$checkfile" && |
2310 | 2316 | $realfile ne $checkfile && |
2311 | - $1 ne 'irq') | |
2317 | + $1 !~ /$allowed_asm_includes/) | |
2312 | 2318 | { |
2313 | 2319 | if ($realfile =~ m{^arch/}) { |
2314 | 2320 | CHK("Consider using #include <linux/$file> instead of <asm/$file>\n" . $herecurr); |