From: Andy Whitcroft It is much more likely that an architecture file will want to directly include asm header files. Reduce this WARNING to a CHECK when the referencing file is in the arch directory. Signed-off-by: Andy Whitcroft Signed-off-by: Andrew Morton --- scripts/checkpatch.pl | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff -puN scripts/checkpatch.pl~checkpatch-reduce-warnings-for-include-of-asm-fooh-to-check-from-arch-barc scripts/checkpatch.pl --- a/scripts/checkpatch.pl~checkpatch-reduce-warnings-for-include-of-asm-fooh-to-check-from-arch-barc +++ a/scripts/checkpatch.pl @@ -1942,12 +1942,17 @@ sub process { #warn if is #included and is available (uses RAW line) if ($tree && $rawline =~ m{^.\s*\#\s*include\s*\}) { - my $checkfile = "include/linux/$1.h"; - if (-f "$root/$checkfile" && $realfile ne $checkfile && + my $file = "$1.h"; + my $checkfile = "include/linux/$file"; + if (-f "$root/$checkfile" && + $realfile ne $checkfile && $1 ne 'irq') { - WARN("Use #include instead of \n" . - $herecurr); + if ($realfile =~ m{^arch/}) { + CHK("Consider using #include instead of \n" . $herecurr); + } else { + WARN("Use #include instead of \n" . $herecurr); + } } } _