1
0
Fork 0

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>
hifive-unleashed-5.1
Florian Vaussard 2014-04-03 14:49:26 -07:00 committed by Linus Torvalds
parent 4fbf32a693
commit 7dd05b38e5
1 changed files with 4 additions and 2 deletions

View File

@ -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) {