aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/checkpatch.pl
diff options
context:
space:
mode:
authorFlorian Vaussard <florian.vaussard@epfl.ch>2014-04-03 17:49:26 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2014-04-03 19:21:15 -0400
commit7dd05b38e5b729f412b617baad5c3363519cf1d4 (patch)
treea4ed04a8352d646b84d29961dbfe0ea0ebbd74be /scripts/checkpatch.pl
parent4fbf32a69346afc87ac1ddceb92c860d644433f9 (diff)
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 'scripts/checkpatch.pl')
-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 {
2074 } 2074 }
2075 2075
2076# check for DT compatible documentation 2076# check for DT compatible documentation
2077 if (defined $root && $realfile =~ /\.dts/ && 2077 if (defined $root &&
2078 $rawline =~ /^\+\s*compatible\s*=/) { 2078 (($realfile =~ /\.dtsi?$/ && $line =~ /^\+\s*compatible\s*=\s*\"/) ||
2079 ($realfile =~ /\.[ch]$/ && $line =~ /^\+.*\.compatible\s*=\s*\"/))) {
2080
2079 my @compats = $rawline =~ /\"([a-zA-Z0-9\-\,\.\+_]+)\"/g; 2081 my @compats = $rawline =~ /\"([a-zA-Z0-9\-\,\.\+_]+)\"/g;
2080 2082
2081 foreach my $compat (@compats) { 2083 foreach my $compat (@compats) {