diff options
author | Wolfram Sang <w.sang@pengutronix.de> | 2010-08-09 20:20:57 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-08-09 23:45:09 -0400 |
commit | 7840a94cd12559d8aee6382fafb85fbc9eb3a2c2 (patch) | |
tree | 6d3dad4d269f55aec1f21c0d40e40df54212632b /scripts/checkpatch.pl | |
parent | 1986aaf828ac8398b3d8d9b4151b08c840414ffe (diff) |
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>
Diffstat (limited to 'scripts/checkpatch.pl')
-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 bd88f11b0953..315faf99effd 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl | |||
@@ -224,6 +224,12 @@ our @modifierList = ( | |||
224 | qr{fastcall}, | 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 | sub build_types { | 233 | sub build_types { |
228 | my $mods = "(?x: \n" . join("|\n ", @modifierList) . "\n)"; | 234 | my $mods = "(?x: \n" . join("|\n ", @modifierList) . "\n)"; |
229 | my $all = "(?x: \n" . join("|\n ", @typeList) . "\n)"; | 235 | my $all = "(?x: \n" . join("|\n ", @typeList) . "\n)"; |
@@ -2308,7 +2314,7 @@ sub process { | |||
2308 | my $checkfile = "include/linux/$file"; | 2314 | my $checkfile = "include/linux/$file"; |
2309 | if (-f "$root/$checkfile" && | 2315 | if (-f "$root/$checkfile" && |
2310 | $realfile ne $checkfile && | 2316 | $realfile ne $checkfile && |
2311 | $1 ne 'irq') | 2317 | $1 !~ /$allowed_asm_includes/) |
2312 | { | 2318 | { |
2313 | if ($realfile =~ m{^arch/}) { | 2319 | if ($realfile =~ m{^arch/}) { |
2314 | CHK("Consider using #include <linux/$file> instead of <asm/$file>\n" . $herecurr); | 2320 | CHK("Consider using #include <linux/$file> instead of <asm/$file>\n" . $herecurr); |