Skip to content

Commit

Permalink
checkpatch: fix spurious vendor compatible warnings
Browse files Browse the repository at this point in the history
With a compatible string like

  compatible = "foo";

checkpatch will currently try to find "foo" in vendor-prefixes.txt,
which is wrong since the vendor prefix is empty in this specific case.

Skip the vendor test if the compatible is not like

  compatible = "vendor,something";

Signed-off-by: Florian Vaussard <[email protected]>
Cc: Joe Perches <[email protected]>
Acked-by: Rob Herring <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
Florian Vaussard authored and torvalds committed Apr 3, 2014
1 parent 8f0dbfa commit 4fbf32a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions scripts/checkpatch.pl
Original file line number Diff line number Diff line change
Expand Up @@ -2088,10 +2088,10 @@ sub process {
"DT compatible string \"$compat\" appears un-documented -- check $dt_path\n" . $herecurr);
}

my $vendor = $compat;
my $vendor_path = $dt_path . "vendor-prefixes.txt";
next if (! -f $vendor_path);
$vendor =~ s/^([a-zA-Z0-9\-]+)\,.*/$1/;
next if $compat !~ /^([a-zA-Z0-9\-]+)\,/;
my $vendor = $1;
`grep -Eq "$vendor" $vendor_path`;
if ( $? >> 8 ) {
WARN("UNDOCUMENTED_DT_STRING",
Expand Down

0 comments on commit 4fbf32a

Please sign in to comment.