From: Rob Herring Date: Thu, 22 May 2014 00:43:41 +0000 (+1000) Subject: checkpatch: fix wildcard DT compatible string checking X-Git-Tag: next-20140530~2^2~156 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=9436e9745471f3bb82d8e195ef8648c1703c5f37;p=karo-tx-linux.git checkpatch: fix wildcard DT compatible string checking We attempt to search for compatible strings which use a variable token in the documented name such as or . While this was attempted to be handled, it's utterly broken. The desired forms of matching are: vendor,-* vendor,name-* For , lower case characters and numbers are permitted. For , only numeric values are allowed. With this change, the number of missing compatible strings reported in arch/arm/boot/dts is reduced from 1071 to 960. Reported-by: Alexandre Belloni Signed-off-by: Rob Herring Tested-by: Geert Uytterhoeven Cc: Florian Vaussard Cc: Joe Perches Cc: Andy Whitcroft Signed-off-by: Andrew Morton --- diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index 34eb2160489d..62d005e06031 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl @@ -2093,8 +2093,10 @@ sub process { foreach my $compat (@compats) { my $compat2 = $compat; - $compat2 =~ s/\,[a-z]*\-/\,<\.\*>\-/; - `grep -Erq "$compat|$compat2" $dt_path`; + $compat2 =~ s/\,[a-zA-Z0-9]*\-/\,<\.\*>\-/; + my $compat3 = $compat; + $compat3 =~ s/\,([a-z]*)[0-9]*\-/\,$1<\.\*>\-/; + `grep -Erq "$compat|$compat2|$compat3" $dt_path`; if ( $? >> 8 ) { WARN("UNDOCUMENTED_DT_STRING", "DT compatible string \"$compat\" appears un-documented -- check $dt_path\n" . $herecurr);