]> bbs.cooldavid.org Git - net-next-2.6.git/blobdiff - scripts/checkpatch.pl
checkpatch: refactor 'allowed asm includes' and add memory.h
[net-next-2.6.git] / scripts / checkpatch.pl
index bd88f11b0953d161b259e80b27d6f423b12e8b1c..315faf99effd95a1f8246504b6560680e464b5d8 100755 (executable)
@@ -224,6 +224,12 @@ our @modifierList = (
        qr{fastcall},
 );
 
+our $allowed_asm_includes = qr{(?x:
+       irq|
+       memory
+)};
+# memory.h: ARM has a custom one
+
 sub build_types {
        my $mods = "(?x:  \n" . join("|\n  ", @modifierList) . "\n)";
        my $all = "(?x:  \n" . join("|\n  ", @typeList) . "\n)";
@@ -2308,7 +2314,7 @@ sub process {
                        my $checkfile = "include/linux/$file";
                        if (-f "$root/$checkfile" &&
                            $realfile ne $checkfile &&
-                           $1 ne 'irq')
+                           $1 !~ /$allowed_asm_includes/)
                        {
                                if ($realfile =~ m{^arch/}) {
                                        CHK("Consider using #include <linux/$file> instead of <asm/$file>\n" . $herecurr);