Re: [PATCH v2 1/2] media: dt-bindings: renesas,fcp: add top-level constraints

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Jan 28, 2025 at 10:53:54AM +0100, Krzysztof Kozlowski wrote:
> Properties with variable number of items per each device are expected to
> have widest constraints in top-level "properties:" block and further
> customized (narrowed) in "if:then:".  Add missing top-level constraints
> for clocks and clock-names.
> 
> Acked-by: Conor Dooley <conor.dooley@xxxxxxxxxxxxx>
> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@xxxxxxxxxx>

How did you find these? The below dtschema patch will find them. 
Unfortunately, there's a lot of false positives. We could eliminate some 
of them, but not sure we could get to 0. The main problem is if the 
constraints are somewhere else (e.g. reset-gpios) or via a $ref.

8<-------------------------------------------------------

diff --git a/dtschema/meta-schemas/cell.yaml b/dtschema/meta-schemas/cell.yaml
index 3f61ed93593b..b4f0d9ea0559 100644
--- a/dtschema/meta-schemas/cell.yaml
+++ b/dtschema/meta-schemas/cell.yaml
@@ -7,6 +7,7 @@ $id: http://devicetree.org/meta-schemas/cell.yaml#
 $schema: https://json-schema.org/draft/2019-09/schema
 
 array:
+  type: object
   description: cell array properties must define how many entries and what the
     entries are when there is more than one entry.
   anyOf:
diff --git a/dtschema/meta-schemas/core.yaml b/dtschema/meta-schemas/core.yaml
index c8cd03439239..233a2afd696b 100644
--- a/dtschema/meta-schemas/core.yaml
+++ b/dtschema/meta-schemas/core.yaml
@@ -16,7 +16,9 @@ allOf:
 
 definitions:
   unit-suffix-properties:
-    $ref: cell.yaml#/array
+    oneOf:
+      - $ref: cell.yaml#/array
+      - type: boolean
     propertyNames:
       description: Standard unit suffix properties don't need a type $ref
       not:
@@ -44,7 +46,9 @@ definitions:
   core-properties:
     properties:
       ranges:
-        $ref: cell.yaml#/array
+        oneOf:
+          - $ref: cell.yaml#/array
+          - type: boolean
       reg:
         $ref: cell.yaml#/array
       compatible:
diff --git a/dtschema/meta-schemas/string-array.yaml b/dtschema/meta-schemas/string-array.yaml
index f5234c6c2fc6..4d4824bc108b 100644
--- a/dtschema/meta-schemas/string-array.yaml
+++ b/dtschema/meta-schemas/string-array.yaml
@@ -5,7 +5,8 @@
 ---
 $id: http://devicetree.org/meta-schemas/string-array.yaml#
 $schema: https://json-schema.org/draft/2019-09/schema
-#type: object
+
+type: object
 
 if:
   not:





[Index of Archives]     [Linux Samsung SOC]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux