diff mbox series

[net-next,09/16] dt-bindings: net: dwmac: Prohibit additional props in AXI-config

Message ID 20230313225103.30512-10-Sergey.Semin@baikalelectronics.ru
State Changes Requested, archived
Headers show
Series dt-bindings: net: dwmac: Extend clocks, props desc and constraints | expand

Checks

Context Check Description
robh/checkpatch success
robh/patch-applied success
robh/dtbs-check warning build log
robh/dt-meta-schema success

Commit Message

Serge Semin March 13, 2023, 10:50 p.m. UTC
Currently DT-schema of the AXI-bus config sub-node prohibits to have
unknown properties by using the unevaluatedProperties property. It's
overkill for the sub-node which doesn't use any combining schemas
keywords (allOf, anyOf, etc). Instead more natural is to use
additionalProperties to prohibit for that.

Signed-off-by: Serge Semin <Sergey.Semin@baikalelectronics.ru>
---
 Documentation/devicetree/bindings/net/snps,dwmac.yaml | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Krzysztof Kozlowski March 16, 2023, 8:06 a.m. UTC | #1
On 13/03/2023 23:50, Serge Semin wrote:
> Currently DT-schema of the AXI-bus config sub-node prohibits to have
> unknown properties by using the unevaluatedProperties property. It's
> overkill for the sub-node which doesn't use any combining schemas
> keywords (allOf, anyOf, etc). Instead more natural is to use
> additionalProperties to prohibit for that.
> 
> Signed-off-by: Serge Semin <Sergey.Semin@baikalelectronics.ru>
> ---
>  Documentation/devicetree/bindings/net/snps,dwmac.yaml | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/Documentation/devicetree/bindings/net/snps,dwmac.yaml b/Documentation/devicetree/bindings/net/snps,dwmac.yaml
> index 89be67e55c3e..d1b2910b799b 100644
> --- a/Documentation/devicetree/bindings/net/snps,dwmac.yaml
> +++ b/Documentation/devicetree/bindings/net/snps,dwmac.yaml
> @@ -466,7 +466,6 @@ properties:
>  
>    stmmac-axi-config:
>      type: object
> -    unevaluatedProperties: false
>      description:
>        AXI BUS Mode parameters.
>  
> @@ -518,6 +517,8 @@ properties:
>          description:
>            rebuild INCRx Burst
>  
> +    additionalProperties: false

But why moving it? Keep the same placement.

Best regards,
Krzysztof
Serge Semin March 23, 2023, 11:37 a.m. UTC | #2
On Thu, Mar 16, 2023 at 09:06:04AM +0100, Krzysztof Kozlowski wrote:
> On 13/03/2023 23:50, Serge Semin wrote:
> > Currently DT-schema of the AXI-bus config sub-node prohibits to have
> > unknown properties by using the unevaluatedProperties property. It's
> > overkill for the sub-node which doesn't use any combining schemas
> > keywords (allOf, anyOf, etc). Instead more natural is to use
> > additionalProperties to prohibit for that.
> > 
> > Signed-off-by: Serge Semin <Sergey.Semin@baikalelectronics.ru>
> > ---
> >  Documentation/devicetree/bindings/net/snps,dwmac.yaml | 3 ++-
> >  1 file changed, 2 insertions(+), 1 deletion(-)
> > 
> > diff --git a/Documentation/devicetree/bindings/net/snps,dwmac.yaml b/Documentation/devicetree/bindings/net/snps,dwmac.yaml
> > index 89be67e55c3e..d1b2910b799b 100644
> > --- a/Documentation/devicetree/bindings/net/snps,dwmac.yaml
> > +++ b/Documentation/devicetree/bindings/net/snps,dwmac.yaml
> > @@ -466,7 +466,6 @@ properties:
> >  
> >    stmmac-axi-config:
> >      type: object
> > -    unevaluatedProperties: false
> >      description:
> >        AXI BUS Mode parameters.
> >  
> > @@ -518,6 +517,8 @@ properties:
> >          description:
> >            rebuild INCRx Burst
> >  
> > +    additionalProperties: false
> 
> But why moving it? Keep the same placement.

No firm justification except that vast majority of DT bindings have
that keyword placed at the tail of the schema body. Anyway I'll get
the it back to the original line.

-Serge(y)

> 
> Best regards,
> Krzysztof
>
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/net/snps,dwmac.yaml b/Documentation/devicetree/bindings/net/snps,dwmac.yaml
index 89be67e55c3e..d1b2910b799b 100644
--- a/Documentation/devicetree/bindings/net/snps,dwmac.yaml
+++ b/Documentation/devicetree/bindings/net/snps,dwmac.yaml
@@ -466,7 +466,6 @@  properties:
 
   stmmac-axi-config:
     type: object
-    unevaluatedProperties: false
     description:
       AXI BUS Mode parameters.
 
@@ -518,6 +517,8 @@  properties:
         description:
           rebuild INCRx Burst
 
+    additionalProperties: false
+
 required:
   - compatible
   - reg