Re: [PATCH] checkpatch: add DT compatible string documentation check

From: Rob Herring
Date: Tue Nov 26 2013 - 12:11:32 EST


On Tue, Nov 26, 2013 at 10:43 AM, Joe Perches <joe@xxxxxxxxxxx> wrote:
> On Tue, 2013-11-26 at 10:01 -0600, Rob Herring wrote:
>> From: Rob Herring <rob.herring@xxxxxxxxxxx>
>
> Hi Rob.
>
>> This adds a simple check that any compatible strings in DeviceTree dts
>> files are present in Documentation/devicetree/bindings. This should be a
>> temporary check until we have more sophisticated binding schema checking.
> []
>> diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
> []
>> @@ -2034,6 +2034,21 @@ sub process {
>> "Use of $flag is deprecated, please use \`$replacement->{$flag} instead.\n" . $herecurr) if ($replacement->{$flag});
>> }
>>
>> +# check for compatible documentation
>> + if ($realfile =~ /\.dts/ && $rawline =~ /\+\s*compatible\s*=/) {
>> + my @compats = $rawline =~ /\"([a-zA-Z0-9\-\,]+)\"/g;
>
> I believe there needs to be a \+\. in the brackets
> for lines like:
>
> arch/c6x/boot/dts/tms320c6678.dtsi: compatible = "ti,c64x+timer64";

I think we don't really want '+' (or '_') in compatible strings. That
would really a check against the documentation versus whether the dts
matches the documentation. So I probably should add a separate check
on use of documented, but deprecated compatible strings. Ideally, that
check would be on the binding doc, but since they are unstructured
currently, we'd have to do it on dts files.

> and
> arch/powerpc/boot/dts/mpc8313erdb.dts: compatible = "fsl,sec2.2", "fsl,sec2.1",

Yes, indeed.

Rob
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/