aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/checkpatch.pl
diff options
context:
space:
mode:
authorFlorian Vaussard <florian.vaussard@epfl.ch>2014-04-03 14:49:26 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2014-04-03 16:21:15 -0700
commit7dd05b38e5b729f412b617baad5c3363519cf1d4 (patch)
treea4ed04a8352d646b84d29961dbfe0ea0ebbd74be /scripts/checkpatch.pl
parentcheckpatch: fix spurious vendor compatible warnings (diff)
downloadlinux-dev-7dd05b38e5b729f412b617baad5c3363519cf1d4.tar.xz
linux-dev-7dd05b38e5b729f412b617baad5c3363519cf1d4.zip
checkpatch: check compatible strings in .c and .h too
Look for ".compatible = "foo" strings not only in .dts files, but in .c and .h too. Signed-off-by: Florian Vaussard <florian.vaussard@epfl.ch> Cc: Joe Perches <joe@perches.com> Acked-by: Rob Herring <robh@kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to '')
-rwxr-xr-xscripts/checkpatch.pl6
1 files changed, 4 insertions, 2 deletions
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 75b587e8ddfd..271d2f96b407 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -2074,8 +2074,10 @@ sub process {
}
# check for DT compatible documentation
- if (defined $root && $realfile =~ /\.dts/ &&
- $rawline =~ /^\+\s*compatible\s*=/) {
+ if (defined $root &&
+ (($realfile =~ /\.dtsi?$/ && $line =~ /^\+\s*compatible\s*=\s*\"/) ||
+ ($realfile =~ /\.[ch]$/ && $line =~ /^\+.*\.compatible\s*=\s*\"/))) {
+
my @compats = $rawline =~ /\"([a-zA-Z0-9\-\,\.\+_]+)\"/g;
foreach my $compat (@compats) {