All of lore.kernel.org
 help / color / mirror / Atom feed
From: Vladimir Oltean <olteanv@gmail.com>
To: Rob Herring <robh@kernel.org>
Cc: "David S. Miller" <davem@davemloft.net>,
	"Eric Dumazet" <edumazet@google.com>,
	"Jakub Kicinski" <kuba@kernel.org>,
	"Paolo Abeni" <pabeni@redhat.com>,
	"Krzysztof Kozlowski" <krzysztof.kozlowski+dt@linaro.org>,
	"Conor Dooley" <conor+dt@kernel.org>,
	"Chen-Yu Tsai" <wens@csie.org>,
	"Jernej Skrabec" <jernej.skrabec@gmail.com>,
	"Samuel Holland" <samuel@sholland.org>,
	"Andrew Lunn" <andrew@lunn.ch>,
	"Florian Fainelli" <f.fainelli@gmail.com>,
	"Matthias Brugger" <matthias.bgg@gmail.com>,
	"AngeloGioacchino Del Regno"
	<angelogioacchino.delregno@collabora.com>,
	"Woojung Huh" <woojung.huh@microchip.com>,
	UNGLinuxDriver@microchip.com,
	"Linus Walleij" <linus.walleij@linaro.org>,
	"Alvin Šipraga" <alsi@bang-olufsen.dk>,
	"Clément Léger" <clement.leger@bootlin.com>,
	"Geert Uytterhoeven" <geert+renesas@glider.be>,
	"Magnus Damm" <magnus.damm@gmail.com>,
	"Maxime Ripard" <mripard@kernel.org>,
	"nç ÜNAL" <arinc.unal@arinc9.com>,
	"Landen Chao" <Landen.Chao@mediatek.com>,
	"DENG Qingfang" <dqfext@gmail.com>,
	"Sean Wang" <sean.wang@mediatek.com>,
	"Daniel Golle" <daniel@makrotopia.org>,
	"John Crispin" <john@phrozen.org>,
	"Gerhard Engleder" <gerhard@engleder-embedded.com>,
	"Heiner Kallweit" <hkallweit1@gmail.com>,
	"Sergey Shtylyov" <s.shtylyov@omp.ru>,
	"Sergei Shtylyov" <sergei.shtylyov@gmail.com>,
	"Justin Chen" <justin.chen@broadcom.com>,
	"Florian Fainelli" <florian.fainelli@broadcom.com>,
	"Grygorii Strashko" <grygorii.strashko@ti.com>,
	"Sekhar Nori" <nsekhar@ti.com>,
	"Claudiu Manoil" <claudiu.manoil@nxp.com>,
	"Alexandre Belloni" <alexandre.belloni@bootlin.com>,
	"Vladimir Oltean" <vladimir.oltean@nxp.com>,
	netdev@vger.kernel.org, devicetree@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-sunxi@lists.linux.dev, linux-kernel@vger.kernel.org,
	linux-mediatek@lists.infradead.org,
	linux-renesas-soc@vger.kernel.org,
	bcm-kernel-feedback-list@broadcom.com
Subject: Re: [PATCH net-next 1/8] dt-bindings: net: Add missing (unevaluated|additional)Properties on child node schemas
Date: Thu, 19 Oct 2023 16:18:06 +0300	[thread overview]
Message-ID: <20231019131806.lbzydoplodybvb62@skbuf> (raw)
In-Reply-To: <20231016-dt-net-cleanups-v1-1-a525a090b444@kernel.org> <20231016-dt-net-cleanups-v1-1-a525a090b444@kernel.org>

Hi Rob,

On Mon, Oct 16, 2023 at 04:44:20PM -0500, Rob Herring wrote:
> Just as unevaluatedProperties or additionalProperties are required at
> the top level of schemas, they should (and will) also be required for
> child node schemas. That ensures only documented properties are
> present for any node.
> 
> Add unevaluatedProperties or additionalProperties as appropriate.
> 
> Signed-off-by: Rob Herring <robh@kernel.org>
> ---
> diff --git a/Documentation/devicetree/bindings/net/dsa/renesas,rzn1-a5psw.yaml b/Documentation/devicetree/bindings/net/dsa/renesas,rzn1-a5psw.yaml
> index 833d2f68daa1..ea285ef3e64f 100644
> --- a/Documentation/devicetree/bindings/net/dsa/renesas,rzn1-a5psw.yaml
> +++ b/Documentation/devicetree/bindings/net/dsa/renesas,rzn1-a5psw.yaml
> @@ -61,17 +61,11 @@ properties:
>  
>    ethernet-ports:
>      type: object
> -    properties:
> -      '#address-cells':
> -        const: 1
> -      '#size-cells':
> -        const: 0
> -
> +    additionalProperties: true
>      patternProperties:
>        "^(ethernet-)?port@[0-4]$":
>          type: object
> -        description: Ethernet switch ports
> -
> +        additionalProperties: true
>          properties:
>            pcs-handle:
>              maxItems: 1

For my edification, this patch removes #address-cells and #size-cells
at the same time, because "additionalProperties: true" (which was also
implied before) doesn't care if they aren't defined in this sub-schema,
and they are defined through $ref: dsa.yaml#/$defs/ethernet-ports,
right?

WARNING: multiple messages have this Message-ID (diff)
From: Vladimir Oltean <olteanv@gmail.com>
To: Rob Herring <robh@kernel.org>
Cc: "David S. Miller" <davem@davemloft.net>,
	"Eric Dumazet" <edumazet@google.com>,
	"Jakub Kicinski" <kuba@kernel.org>,
	"Paolo Abeni" <pabeni@redhat.com>,
	"Krzysztof Kozlowski" <krzysztof.kozlowski+dt@linaro.org>,
	"Conor Dooley" <conor+dt@kernel.org>,
	"Chen-Yu Tsai" <wens@csie.org>,
	"Jernej Skrabec" <jernej.skrabec@gmail.com>,
	"Samuel Holland" <samuel@sholland.org>,
	"Andrew Lunn" <andrew@lunn.ch>,
	"Florian Fainelli" <f.fainelli@gmail.com>,
	"Matthias Brugger" <matthias.bgg@gmail.com>,
	"AngeloGioacchino Del Regno"
	<angelogioacchino.delregno@collabora.com>,
	"Woojung Huh" <woojung.huh@microchip.com>,
	UNGLinuxDriver@microchip.com,
	"Linus Walleij" <linus.walleij@linaro.org>,
	"Alvin Šipraga" <alsi@bang-olufsen.dk>,
	"Clément Léger" <clement.leger@bootlin.com>,
	"Geert Uytterhoeven" <geert+renesas@glider.be>,
	"Magnus Damm" <magnus.damm@gmail.com>,
	"Maxime Ripard" <mripard@kernel.org>,
	"nç ÜNAL" <arinc.unal@arinc9.com>,
	"Landen Chao" <Landen.Chao@mediatek.com>,
	"DENG Qingfang" <dqfext@gmail.com>,
	"Sean Wang" <sean.wang@mediatek.com>,
	"Daniel Golle" <daniel@makrotopia.org>,
	"John Crispin" <john@phrozen.org>,
	"Gerhard Engleder" <gerhard@engleder-embedded.com>,
	"Heiner Kallweit" <hkallweit1@gmail.com>,
	"Sergey Shtylyov" <s.shtylyov@omp.ru>,
	"Sergei Shtylyov" <sergei.shtylyov@gmail.com>,
	"Justin Chen" <justin.chen@broadcom.com>,
	"Florian Fainelli" <florian.fainelli@broadcom.com>,
	"Grygorii Strashko" <grygorii.strashko@ti.com>,
	"Sekhar Nori" <nsekhar@ti.com>,
	"Claudiu Manoil" <claudiu.manoil@nxp.com>,
	"Alexandre Belloni" <alexandre.belloni@bootlin.com>,
	"Vladimir Oltean" <vladimir.oltean@nxp.com>,
	netdev@vger.kernel.org, devicetree@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-sunxi@lists.linux.dev, linux-kernel@vger.kernel.org,
	linux-mediatek@lists.infradead.org,
	linux-renesas-soc@vger.kernel.org,
	bcm-kernel-feedback-list@broadcom.com
Subject: Re: [PATCH net-next 1/8] dt-bindings: net: Add missing (unevaluated|additional)Properties on child node schemas
Date: Thu, 19 Oct 2023 16:18:06 +0300	[thread overview]
Message-ID: <20231019131806.lbzydoplodybvb62@skbuf> (raw)
In-Reply-To: <20231016-dt-net-cleanups-v1-1-a525a090b444@kernel.org> <20231016-dt-net-cleanups-v1-1-a525a090b444@kernel.org>

Hi Rob,

On Mon, Oct 16, 2023 at 04:44:20PM -0500, Rob Herring wrote:
> Just as unevaluatedProperties or additionalProperties are required at
> the top level of schemas, they should (and will) also be required for
> child node schemas. That ensures only documented properties are
> present for any node.
> 
> Add unevaluatedProperties or additionalProperties as appropriate.
> 
> Signed-off-by: Rob Herring <robh@kernel.org>
> ---
> diff --git a/Documentation/devicetree/bindings/net/dsa/renesas,rzn1-a5psw.yaml b/Documentation/devicetree/bindings/net/dsa/renesas,rzn1-a5psw.yaml
> index 833d2f68daa1..ea285ef3e64f 100644
> --- a/Documentation/devicetree/bindings/net/dsa/renesas,rzn1-a5psw.yaml
> +++ b/Documentation/devicetree/bindings/net/dsa/renesas,rzn1-a5psw.yaml
> @@ -61,17 +61,11 @@ properties:
>  
>    ethernet-ports:
>      type: object
> -    properties:
> -      '#address-cells':
> -        const: 1
> -      '#size-cells':
> -        const: 0
> -
> +    additionalProperties: true
>      patternProperties:
>        "^(ethernet-)?port@[0-4]$":
>          type: object
> -        description: Ethernet switch ports
> -
> +        additionalProperties: true
>          properties:
>            pcs-handle:
>              maxItems: 1

For my edification, this patch removes #address-cells and #size-cells
at the same time, because "additionalProperties: true" (which was also
implied before) doesn't care if they aren't defined in this sub-schema,
and they are defined through $ref: dsa.yaml#/$defs/ethernet-ports,
right?

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  parent reply	other threads:[~2023-10-19 13:18 UTC|newest]

Thread overview: 56+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-16 21:44 [PATCH net-next 0/8] dt-bindings: net: Child node schema cleanups Rob Herring
2023-10-16 21:44 ` Rob Herring
2023-10-16 21:44 ` [PATCH net-next 1/8] dt-bindings: net: Add missing (unevaluated|additional)Properties on child node schemas Rob Herring
2023-10-16 21:44   ` Rob Herring
2023-10-17  6:14   ` Arınç ÜNAL
2023-10-17  6:14     ` Arınç ÜNAL
2023-10-17 15:14   ` Jernej Škrabec
2023-10-17 15:14     ` Jernej Škrabec
2023-10-17 19:18   ` Gerhard Engleder
2023-10-17 19:18     ` Gerhard Engleder
2023-10-19 13:18   ` Vladimir Oltean [this message]
2023-10-19 13:18     ` Vladimir Oltean
2023-10-19 18:05     ` Rob Herring
2023-10-19 18:05       ` Rob Herring
2023-10-16 21:44 ` [PATCH net-next 2/8] dt-bindings: net: renesas: Drop ethernet-phy node schema Rob Herring
2023-10-16 21:44   ` Rob Herring
2023-10-16 21:44 ` [PATCH net-next 3/8] dt-bindings: net: dsa/switch: Make 'ethernet-port' node addresses hex Rob Herring
2023-10-16 21:44   ` Rob Herring
2023-10-17  6:25   ` Arınç ÜNAL
2023-10-17  6:25     ` Arınç ÜNAL
2023-10-19 13:21   ` Vladimir Oltean
2023-10-19 13:21     ` Vladimir Oltean
2023-10-16 21:44 ` [PATCH net-next 4/8] dt-bindings: net: ethernet-switch: Add missing 'ethernet-ports' level Rob Herring
2023-10-16 21:44   ` Rob Herring
2023-10-17  6:32   ` Arınç ÜNAL
2023-10-17  6:32     ` Arınç ÜNAL
2023-10-19 13:34   ` Vladimir Oltean
2023-10-19 13:34     ` Vladimir Oltean
2023-10-16 21:44 ` [PATCH net-next 5/8] dt-bindings: net: ethernet-switch: Rename $defs "base" to 'ethernet-ports' Rob Herring
2023-10-16 21:44   ` Rob Herring
2023-10-17  6:35   ` Arınç ÜNAL
2023-10-17  6:35     ` Arınç ÜNAL
2023-10-19 13:36   ` Vladimir Oltean
2023-10-19 13:36     ` Vladimir Oltean
2023-10-16 21:44 ` [PATCH net-next 6/8] dt-bindings: net: mscc,vsc7514-switch: Clean-up example indentation Rob Herring
2023-10-16 21:44   ` Rob Herring
2023-10-17  6:43   ` Arınç ÜNAL
2023-10-17  6:43     ` Arınç ÜNAL
2023-10-19 13:37   ` Vladimir Oltean
2023-10-19 13:37     ` Vladimir Oltean
2023-10-16 21:44 ` [PATCH net-next 7/8] dt-bindings: net: mscc,vsc7514-switch: Simplify DSA and switch references Rob Herring
2023-10-16 21:44   ` Rob Herring
2023-10-17  6:46   ` Arınç ÜNAL
2023-10-17  6:46     ` Arınç ÜNAL
2023-10-19 13:46   ` Vladimir Oltean
2023-10-19 13:46     ` Vladimir Oltean
2023-10-16 21:44 ` [PATCH net-next 8/8] dt-bindings: net: dsa: Drop 'ethernet-ports' node properties Rob Herring
2023-10-16 21:44   ` Rob Herring
2023-10-17  6:49   ` Arınç ÜNAL
2023-10-17  6:49     ` Arınç ÜNAL
2023-10-19 13:48   ` Vladimir Oltean
2023-10-19 13:48     ` Vladimir Oltean
2023-10-18  8:53 ` [PATCH net-next 0/8] dt-bindings: net: Child node schema cleanups Linus Walleij
2023-10-18  8:53   ` Linus Walleij
2023-10-19 16:10 ` patchwork-bot+netdevbpf
2023-10-19 16:10   ` patchwork-bot+netdevbpf

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20231019131806.lbzydoplodybvb62@skbuf \
    --to=olteanv@gmail.com \
    --cc=Landen.Chao@mediatek.com \
    --cc=UNGLinuxDriver@microchip.com \
    --cc=alexandre.belloni@bootlin.com \
    --cc=alsi@bang-olufsen.dk \
    --cc=andrew@lunn.ch \
    --cc=angelogioacchino.delregno@collabora.com \
    --cc=arinc.unal@arinc9.com \
    --cc=bcm-kernel-feedback-list@broadcom.com \
    --cc=claudiu.manoil@nxp.com \
    --cc=clement.leger@bootlin.com \
    --cc=conor+dt@kernel.org \
    --cc=daniel@makrotopia.org \
    --cc=davem@davemloft.net \
    --cc=devicetree@vger.kernel.org \
    --cc=dqfext@gmail.com \
    --cc=edumazet@google.com \
    --cc=f.fainelli@gmail.com \
    --cc=florian.fainelli@broadcom.com \
    --cc=geert+renesas@glider.be \
    --cc=gerhard@engleder-embedded.com \
    --cc=grygorii.strashko@ti.com \
    --cc=hkallweit1@gmail.com \
    --cc=jernej.skrabec@gmail.com \
    --cc=john@phrozen.org \
    --cc=justin.chen@broadcom.com \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=kuba@kernel.org \
    --cc=linus.walleij@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=linux-renesas-soc@vger.kernel.org \
    --cc=linux-sunxi@lists.linux.dev \
    --cc=magnus.damm@gmail.com \
    --cc=matthias.bgg@gmail.com \
    --cc=mripard@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=nsekhar@ti.com \
    --cc=pabeni@redhat.com \
    --cc=robh@kernel.org \
    --cc=s.shtylyov@omp.ru \
    --cc=samuel@sholland.org \
    --cc=sean.wang@mediatek.com \
    --cc=sergei.shtylyov@gmail.com \
    --cc=vladimir.oltean@nxp.com \
    --cc=wens@csie.org \
    --cc=woojung.huh@microchip.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.