Commit 7dd05b38 authored by Florian Vaussard's avatar Florian Vaussard Committed by Linus Torvalds

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: default avatarFlorian Vaussard <florian.vaussard@epfl.ch>
Cc: Joe Perches <joe@perches.com>
Acked-by: default avatarRob Herring <robh@kernel.org>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 4fbf32a6
......@@ -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) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment