diff options
Diffstat (limited to 'scripts/checkpatch.pl')
-rwxr-xr-x | scripts/checkpatch.pl | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index 0e5af8ed107e..9e7e9d1d5958 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl | |||
@@ -1942,12 +1942,17 @@ sub process { | |||
1942 | 1942 | ||
1943 | #warn if <asm/foo.h> is #included and <linux/foo.h> is available (uses RAW line) | 1943 | #warn if <asm/foo.h> is #included and <linux/foo.h> is available (uses RAW line) |
1944 | if ($tree && $rawline =~ m{^.\s*\#\s*include\s*\<asm\/(.*)\.h\>}) { | 1944 | if ($tree && $rawline =~ m{^.\s*\#\s*include\s*\<asm\/(.*)\.h\>}) { |
1945 | my $checkfile = "include/linux/$1.h"; | 1945 | my $file = "$1.h"; |
1946 | if (-f "$root/$checkfile" && $realfile ne $checkfile && | 1946 | my $checkfile = "include/linux/$file"; |
1947 | if (-f "$root/$checkfile" && | ||
1948 | $realfile ne $checkfile && | ||
1947 | $1 ne 'irq') | 1949 | $1 ne 'irq') |
1948 | { | 1950 | { |
1949 | WARN("Use #include <linux/$1.h> instead of <asm/$1.h>\n" . | 1951 | if ($realfile =~ m{^arch/}) { |
1950 | $herecurr); | 1952 | CHK("Consider using #include <linux/$file> instead of <asm/$file>\n" . $herecurr); |
1953 | } else { | ||
1954 | WARN("Use #include <linux/$file> instead of <asm/$file>\n" . $herecurr); | ||
1955 | } | ||
1951 | } | 1956 | } |
1952 | } | 1957 | } |
1953 | 1958 | ||