We attempt to search for compatible strings which use a variable token in the documented name such as <chip> or <soc>. While this was attempted to be handled, it's utterly broken. The desired forms of matching are: vendor,<chip>-* vendor,name<part#>-* For <chip>, lower case characters and numbers are permitted. For <part#>, 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.
Showing the changes to scripts/checkpatch.pl (1 of 1 file). Show all
Unified · Split
| @@ -2093,8 +2093,10 @@ sub process { · 2092 unmodified lines | ||
| 2093 | 2093 | |
| 2094 | 2094 | foreach my $compat (@compats) { |
| 2095 | 2095 | my $compat2 = $compat; |
| 2096 | − $compat2 =~ s/\,[a-z]*\-/\,<\.\*>\-/; | |
| 2097 | − `grep -Erq "$compat|$compat2" $dt_path`; | |
| 2096 | + $compat2 =~ s/\,[a-zA-Z0-9]*\-/\,<\.\*>\-/; | |
| 2097 | + my $compat3 = $compat; | |
| 2098 | + $compat3 =~ s/\,([a-z]*)[0-9]*\-/\,$1<\.\*>\-/; | |
| 2099 | + `grep -Erq "$compat|$compat2|$compat3" $dt_path`; | |
| 2098 | 2100 | if ( $? >> 8 ) { |
| 2099 | 2101 | WARN("UNDOCUMENTED_DT_STRING", |
| 2100 | 2102 | "DT compatible string \"$compat\" appears un-documented -- check $dt_path\n" . $herecurr); |