Commit 7840a94c authored by Wolfram Sang's avatar Wolfram Sang Committed by Linus Torvalds

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: default avatarWolfram Sang <w.sang@pengutronix.de>
Cc: Russell King <linux@arm.linux.org.uk>
Cc: Andy Whitcroft <apw@shadowen.org>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 1986aaf8
...@@ -224,6 +224,12 @@ our @modifierList = ( ...@@ -224,6 +224,12 @@ our @modifierList = (
qr{fastcall}, qr{fastcall},
); );
our $allowed_asm_includes = qr{(?x:
irq|
memory
)};
# memory.h: ARM has a custom one
sub build_types { sub build_types {
my $mods = "(?x: \n" . join("|\n ", @modifierList) . "\n)"; my $mods = "(?x: \n" . join("|\n ", @modifierList) . "\n)";
my $all = "(?x: \n" . join("|\n ", @typeList) . "\n)"; my $all = "(?x: \n" . join("|\n ", @typeList) . "\n)";
...@@ -2308,7 +2314,7 @@ sub process { ...@@ -2308,7 +2314,7 @@ sub process {
my $checkfile = "include/linux/$file"; my $checkfile = "include/linux/$file";
if (-f "$root/$checkfile" && if (-f "$root/$checkfile" &&
$realfile ne $checkfile && $realfile ne $checkfile &&
$1 ne 'irq') $1 !~ /$allowed_asm_includes/)
{ {
if ($realfile =~ m{^arch/}) { if ($realfile =~ m{^arch/}) {
CHK("Consider using #include <linux/$file> instead of <asm/$file>\n" . $herecurr); CHK("Consider using #include <linux/$file> instead of <asm/$file>\n" . $herecurr);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment