diff options
author | Florian Vaussard <florian.vaussard@epfl.ch> | 2014-04-03 14:49:26 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2014-04-03 16:21:15 -0700 |
commit | 7dd05b38e5b729f412b617baad5c3363519cf1d4 (patch) | |
tree | a4ed04a8352d646b84d29961dbfe0ea0ebbd74be /scripts | |
parent | 4fbf32a69346afc87ac1ddceb92c860d644433f9 (diff) | |
download | op-kernel-dev-7dd05b38e5b729f412b617baad5c3363519cf1d4.zip op-kernel-dev-7dd05b38e5b729f412b617baad5c3363519cf1d4.tar.gz |
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')
-rwxr-xr-x | scripts/checkpatch.pl | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index 75b587e..271d2f9 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) { |