checkpatch.pl: Update DT vendor prefix check [Linux 5.2]

checkpatch.pl: Update DT vendor prefix check [Linux 5.2]

This Linux kernel change "checkpatch.pl: Update DT vendor prefix check" is included in the Linux 5.2 release. This change is authored by Rob Herring <robh [at] kernel.org> on Wed May 22 09:55:34 2019 -0500. The commit for this change in Linux stable tree is 852d095 (patch).

checkpatch.pl: Update DT vendor prefix check

In commit 8122de54602e ("dt-bindings: Convert vendor prefixes to
json-schema"), vendor-prefixes.txt has been converted to a DT schema.
Update the checkpatch.pl DT check to extract vendor prefixes from the new
vendor-prefixes.yaml file.

Fixes: 8122de54602e ("dt-bindings: Convert vendor prefixes to json-schema")
Cc: Joe Perches <[email protected]>
Signed-off-by: Rob Herring <[email protected]>

There are 4 lines of Linux source code added/deleted in this change. Code changes to Linux kernel are as follows.

 scripts/checkpatch.pl | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index bb28b17..342c7c7 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -3027,7 +3027,7 @@ sub process {
            my @compats = $rawline =~ /\"([a-zA-Z0-9\-\,\.\+_]+)\"/g;

            my $dt_path = $root . "/Documentation/devicetree/bindings/";
-           my $vp_file = $dt_path . "vendor-prefixes.txt";
+           my $vp_file = $dt_path . "vendor-prefixes.yaml";

            foreach my $compat (@compats) {
                my $compat2 = $compat;
@@ -3042,7 +3042,7 @@ sub process {

                next if $compat !~ /^([a-zA-Z0-9\-]+)\,/;
                my $vendor = $1;
-               `grep -Eq "^$vendor\\b" $vp_file`;
+               `grep -Eq "\\"\\^\Q$vendor\E,\\.\\*\\":" $vp_file`;
                if ( $? >> 8 ) {
                    WARN("UNDOCUMENTED_DT_STRING",
                         "DT compatible string vendor \"$vendor\" appears un-documented -- check $vp_file\n" . $herecurr);

Leave a Reply

Your email address will not be published. Required fields are marked *