dt-bindings: remoteproc: Add missing (unevaluated|additional)Properties on child nodes
Rob Herring
maintainerPATCH 1/1 dt-bindings: remoteproc: Add missing (unevaluated|additional)Properties on child nodes
In order to ensure only documented properties are present, node schemas must have unevaluatedProperties or additionalProperties set to false (typically).
--- .../devicetree/bindings/remoteproc/qcom,sc7180-mss-pil.yaml | 1 + .../devicetree/bindings/remoteproc/qcom,sc7280-mss-pil.yaml | 1 + .../devicetree/bindings/remoteproc/qcom,sc7280-wpss-pil.yaml | 1 + 3 files changed, 3 insertions(+)
Documentation/devicetree/bindings/remoteproc/qcom,sc7180-mss-pil.yaml +1 -0
@@ -140,6 +140,7 @@ properties: glink-edge: $ref: qcom,glink-edge.yaml# + unevaluatedProperties: false description: Qualcomm G-Link subnode which represents communication edge, channels and devices related to the DSP.
Documentation/devicetree/bindings/remoteproc/qcom,sc7280-mss-pil.yaml +1 -0
@@ -154,6 +154,7 @@ properties: glink-edge: $ref: qcom,glink-edge.yaml# + unevaluatedProperties: false description: Qualcomm G-Link subnode which represents communication edge, channels and devices related to the DSP.
Documentation/devicetree/bindings/remoteproc/qcom,sc7280-wpss-pil.yaml +1 -0
@@ -107,6 +107,7 @@ properties: glink-edge: $ref: qcom,glink-edge.yaml# + unevaluatedProperties: false description: Qualcomm G-Link subnode which represents communication edge, channels and devices related to the ADSP.
Signature · 1 line
2.34.1
Quoted 16 lines · Rob Herring
In order to ensure only documented properties are present, node schemas must have unevaluatedProperties or additionalProperties set to false (typically).
Signed-off-by Rob Herring <[email protected]>--- .../devicetree/bindings/remoteproc/qcom,sc7180-mss-pil.yaml | 1 + .../devicetree/bindings/remoteproc/qcom,sc7280-mss-pil.yaml | 1 + .../devicetree/bindings/remoteproc/qcom,sc7280-wpss-pil.yaml | 1 + 3 files changed, 3 insertions(+)Documentation/devicetree/bindings/remoteproc/qcom,sc7180-mss-pil.yaml +0
-0
Documentation/devicetree/bindings/remoteproc/qcom,sc7180-mss-pil.yaml properties: · line 143
Quoted 4 lines
Documentation/devicetree/bindings/remoteproc/qcom,sc7180-mss-pil.yaml +1
-0@@ -140,6 +140,7 @@ properties: glink-edge: $ref: qcom,glink-edge.yaml# + unevaluatedProperties: false
Is it actually needed? The qcom,glink-edge.yaml has additionalProperties:false, so I expect it to complain if anything appears here.
Best regards,
Krzysztof
Rob Herring
maintainerQuoted 19 lines · Krzysztof Kozlowski
Quoted 17 lines · Rob Herring
In order to ensure only documented properties are present, node schemas must have unevaluatedProperties or additionalProperties set to false (typically).
Signed-off-by Rob Herring <[email protected]>--- .../devicetree/bindings/remoteproc/qcom,sc7180-mss-pil.yaml | 1 + .../devicetree/bindings/remoteproc/qcom,sc7280-mss-pil.yaml | 1 + .../devicetree/bindings/remoteproc/qcom,sc7280-wpss-pil.yaml | 1 + 3 files changed, 3 insertions(+)Documentation/devicetree/bindings/remoteproc/qcom,sc7180-mss-pil.yaml +0
-0@@ -140,6 +140,7 @@ properties:
Quoted 7 lines
Documentation/devicetree/bindings/remoteproc/qcom,sc7180-mss-pil.yaml properties: · line 143
Quoted 3 lines
Documentation/devicetree/bindings/remoteproc/qcom,sc7180-mss-pil.yaml +1
-0glink-edge: $ref: qcom,glink-edge.yaml# + unevaluatedProperties: falseIs it actually needed? The qcom,glink-edge.yaml has additionalProperties:false, so I expect it to complain if anything appears here.
Perhaps not, but I'm trying to come up with a meta-schema to check these though I'm not sure I can get to no warnings which is how I found all these cases. The main remaining warnings are bus child node pattern schemas which can perhaps be handled with 'additionalProperties: true'. The rule I have says if properties or patternProperties is present then unevaluatedProperties or additionalProperties must be. To handle this case, I think we'd have to walk the $ref and check it.
Anyways, we can hold off on this one until when and if there's a meta-schema in place.
Rob
Krzysztof Kozlowski
Reviewed-byQuoted 38 lines · Rob Herring
Quoted 19 lines · Krzysztof Kozlowski
Quoted 17 lines · Rob Herring
In order to ensure only documented properties are present, node schemas must have unevaluatedProperties or additionalProperties set to false (typically).
Signed-off-by Rob Herring <[email protected]>--- .../devicetree/bindings/remoteproc/qcom,sc7180-mss-pil.yaml | 1 + .../devicetree/bindings/remoteproc/qcom,sc7280-mss-pil.yaml | 1 + .../devicetree/bindings/remoteproc/qcom,sc7280-wpss-pil.yaml | 1 + 3 files changed, 3 insertions(+)Documentation/devicetree/bindings/remoteproc/qcom,sc7180-mss-pil.yaml +0
-0@@ -140,6 +140,7 @@ properties:Quoted 7 lines
Documentation/devicetree/bindings/remoteproc/qcom,sc7180-mss-pil.yaml properties: · line 143
Quoted 3 lines
Documentation/devicetree/bindings/remoteproc/qcom,sc7180-mss-pil.yaml +1
-0glink-edge: $ref: qcom,glink-edge.yaml# + unevaluatedProperties: falseIs it actually needed? The qcom,glink-edge.yaml has additionalProperties:false, so I expect it to complain if anything appears here.
Perhaps not, but I'm trying to come up with a meta-schema to check these though I'm not sure I can get to no warnings which is how I found all these cases. The main remaining warnings are bus child node pattern schemas which can perhaps be handled with 'additionalProperties: true'. The rule I have says if properties or patternProperties is present then unevaluatedProperties or additionalProperties must be. To handle this case, I think we'd have to walk the $ref and check it.
Quoted 2 lines
Anyways, we can hold off on this one until when and if there's a meta-schema in place.
For me adding unevaluatedProp:false everywhere with $ref is okay and it makes the code easier to read - no need to dive into referenced schema to remember if it allows or does not allow additional properties. It is also a safer choice if referenced schema forgot to set additionalProp:false.
However if referenced schema has additionalProp:false, then unevaluatedProp:false here is redundant and question is whether the redundancy is worth additional readability/obviousness.
To me, unevaluatedProp:false here would during review save time - no need to jump into referenced schema to check what is there. If we make it a rule / coding convention, then I am in.
Best regards,
Krzysztof
Quoted 11 lines · Rob Herring
In order to ensure only documented properties are present, node schemas must have unevaluatedProperties or additionalProperties set to false (typically).
Signed-off-by Rob Herring <[email protected]>--- .../devicetree/bindings/remoteproc/qcom,sc7180-mss-pil.yaml | 1 + .../devicetree/bindings/remoteproc/qcom,sc7280-mss-pil.yaml | 1 + .../devicetree/bindings/remoteproc/qcom,sc7280-wpss-pil.yaml | 1 + 3 files changed, 3 insertions(+)
Applied, thanks!