From 5522b4287817a610a4ae221ef91168cf610e02dc Mon Sep 17 00:00:00 2001 From: Andy Whitcroft Date: Wed, 15 Oct 2008 22:02:20 -0700 Subject: [PATCH] --- yaml --- r: 114758 b: refs/heads/master c: e09dec4831bbb319987215ea0a280b2a620021b7 h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/scripts/checkpatch.pl | 13 +++++++++---- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/[refs] b/[refs] index 2adabcd0f538..41d524aa54c0 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: c1ab33269a84d6056d2ffc728d8bbaa26377d3e3 +refs/heads/master: e09dec4831bbb319987215ea0a280b2a620021b7 diff --git a/trunk/scripts/checkpatch.pl b/trunk/scripts/checkpatch.pl index 0e5af8ed107e..9e7e9d1d5958 100755 --- a/trunk/scripts/checkpatch.pl +++ b/trunk/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); + } } }