Received: by 2002:a05:7412:f690:b0:e2:908c:2ebd with SMTP id ej16csp321360rdb; Thu, 19 Oct 2023 05:46:52 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEBSMxt/jP8ZQBJTIj6s1VAhpzM7iHSUdHkBwh++pd7CA2lUmO4C/sM1Q2ivyV0LidkQhgG X-Received: by 2002:a05:6359:7043:b0:166:d5af:3200 with SMTP id ua3-20020a056359704300b00166d5af3200mr1776906rwb.6.1697719611647; Thu, 19 Oct 2023 05:46:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697719611; cv=none; d=google.com; s=arc-20160816; b=E1tvPMBVP6SpYIUjpUCX8d0aZLCncHOezn/+bs3f7xD0bs3btD76O+BpBvtkPqcnKO FGUOBGixJ12ZmMr6C6ZB2PeH4LKEmL9s/WM4SbgBWn2bhh3BNEcUNs0YVRVaqEgeYbV3 MU3lwx9VSk7aAbvXn1OBdnembSQCmJXUyjnBc7shNOWd874Q9rMVlqwhbZZpMFNHGIMc CpRDBuas7OovfIQwR+vh6lrmQG0TtT2DTF9at/oB1+lilyChwxlW+3d8rKTnW7sAhlyG 6YOM7EvF9cD7za+s+Fn4SkIMm5B4GO4B8BapjJM+tpNzdOU36DCz9Qv+vU2wxWzRcVcI i0rw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=KNLZx5GsIK+TgLjUSGmArZrXDMyDH1Dl9eWFrYrAbiQ=; fh=Wh+EHSK7+fvC29y848TYS0sJ9VpZ3nvjA5zRlaaSbos=; b=oIbrhX+4KSFOLY2oZXCCPaaHCGGdqqyB9igpSQD6RJlREChkbLgaDakuHLxMI0a2oU Mm9lwi6oWdtDf95yPCOo7xDP4gRJYVa/LgXQR8rXTpZpJ2sd9HIf9i9+fsI8RwFfYlJo SQAVf6SMAesH4raO5tNZsALke0gh0iB6IhE97E+F5ulFpY0AKmAyS0CS8n9PLX9YO+qA pAwV8c2l2eivX191msd5VQmGRmYnly6b687Y6DLBVCNkGHg44aTotEZxN2ZwJBEojYPa 23b94W/Re/iNb9QP1L2Py8OMZYW3p9OQfMwfzjO3Jdqg+hP5jIBsjWS8OFrINFt3RqCV x0XQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="O/pjOKSw"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id d5-20020a056a0010c500b0068ff741579fsi6389674pfu.318.2023.10.19.05.46.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Oct 2023 05:46:51 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="O/pjOKSw"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 8FC8B822CF0B; Thu, 19 Oct 2023 05:46:50 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345442AbjJSMqq (ORCPT + 99 others); Thu, 19 Oct 2023 08:46:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43176 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345380AbjJSMqo (ORCPT ); Thu, 19 Oct 2023 08:46:44 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 65BBFF7 for ; Thu, 19 Oct 2023 05:46:43 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2D4F4C433C7; Thu, 19 Oct 2023 12:46:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1697719603; bh=zrChmdwZjapKXHOuDShzo54XNW6c5+Js5gqYUObtK/o=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=O/pjOKSw15Eyq52t9nl85klJ8UdBJwT/YwJwJS+3+usiTv2DShKdWaInjqc3GJBu+ On2MmXCrAFp44XHG2X55Os2Y3DDHncbNWMtbFB8F6peVVN4RyLmSfgvt39KYcVOkVp 9ygwmt/C+n0oHLdJj5fl2VqHRxsZgDDb6abF925Jn8yGcmYFTkNFLVbPJAXL+814dF mb/nJdZEIbkYb3dJhS+APNwFZH4GGhkOYbjyzYeqHOWwU9bZ7oXivEdvkVC+0j4jSn 5/T22RVnwa07bAzIKK1YarpkufcGDt0zrqKSDC2PoFcm9C4/IgHwiIQRJcR8Vdhhgu 5+3dfibFfiV1Q== Date: Thu, 19 Oct 2023 13:46:36 +0100 From: Conor Dooley To: "Russell King (Oracle)" Cc: Linus Walleij , Rob Herring , Christian Marangi , Andrew Lunn , Florian Fainelli , linux-arm-kernel@lists.infradead.org, Krzysztof Kozlowski , devicetree@vger.kernel.org, Conor Dooley , Sebastian Hesselbarth , Eric Dumazet , Vladimir Oltean , Rob Herring , netdev@vger.kernel.org, Jakub Kicinski , Paolo Abeni , "David S. Miller" , linux-kernel@vger.kernel.org, Gregory Clement Subject: Re: [PATCH net-next v4 1/7] dt-bindings: net: dsa: Require ports or ethernet-ports Message-ID: <20231019-friday-fabulous-4882c4048b8c@spud> References: <20231018-marvell-88e6152-wan-led-v4-0-3ee0c67383be@linaro.org> <20231018-marvell-88e6152-wan-led-v4-1-3ee0c67383be@linaro.org> <169762516670.391804.7528295251386913602.robh@kernel.org> <20231019-pulse-autopilot-166bb6c96090@spud> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="hRWpvk1HDqmaTX1z" Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Thu, 19 Oct 2023 05:46:50 -0700 (PDT) --hRWpvk1HDqmaTX1z Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Oct 19, 2023 at 01:27:09PM +0100, Russell King (Oracle) wrote: > On Thu, Oct 19, 2023 at 12:58:46PM +0100, Conor Dooley wrote: > > On Thu, Oct 19, 2023 at 11:58:49AM +0100, Russell King (Oracle) wrote: > > > On Wed, Oct 18, 2023 at 01:11:45PM +0200, Linus Walleij wrote: > > > > On Wed, Oct 18, 2023 at 12:32=E2=80=AFPM Rob Herring wrote: > > > > > On Wed, 18 Oct 2023 11:03:40 +0200, Linus Walleij wrote: > > > >=20 > > > > > > Bindings using dsa.yaml#/$defs/ethernet-ports specify that > > > > > > a DSA switch node need to have a ports or ethernet-ports > > > > > > subnode, and that is actually required, so add requirements > > > > > > using oneOf. > > > > > > > > > > > > Suggested-by: Rob Herring > > > > > > Signed-off-by: Linus Walleij > > > > > > --- > > > > > > Documentation/devicetree/bindings/net/dsa/dsa.yaml | 6 ++++++ > > > > > > 1 file changed, 6 insertions(+) > > > > > > > > > > > > > > > > My bot found errors running 'make DT_CHECKER_FLAGS=3D-m dt_bindin= g_check' > > > > > on your patch (DT_CHECKER_FLAGS is new in v5.13): > > > > > > > > > > yamllint warnings/errors: > > > > > ./Documentation/devicetree/bindings/net/dsa/dsa.yaml:60:7: [warni= ng] wrong indentation: expected 8 but found 6 (indentation) > > > > > ./Documentation/devicetree/bindings/net/dsa/dsa.yaml:62:7: [warni= ng] wrong indentation: expected 8 but found 6 (indentation) > > > >=20 > > > > Really? > > > >=20 > > > > + oneOf: > > > > + - required: > > > > + - ports > > > > + - required: > > > > + - ethernet-ports > > > >=20 > > > > Two spaces after the oneOf, 2 spaces after a required as usual. > > > > I don't get it. > > >=20 > > > Given the other python errors spat out in Rob's report, I would sugge= st > > > that the "bot" is running a development version that hasn't been fully > > > tested, so anything it spits out is suspect. Maybe Rob can comment on > > > the validity of the warnings in the report. > >=20 > > In this case, I think it is correct. > > 2 spaces for the oneOf, 2 spaces the start of the required for the > > nested list, so: > > oneOf: > > - required: >=20 > This is a total of two spaces indentation. >=20 > > - ports >=20 > This is a total of six spaces indentation. >=20 > You mention 2 spaces for the oneOf, which explains why the "- required" > needs to be indented by two spaces. You also say 2 spaces for the > required nested list, but what about the other two spaces? I a word that might've made it more clear. It is 2 spaces for the oneOf and 2 spaces _from_ the start of the required for the nested list. In theory you might have a contrived example that looks like: oneOf: - required: - ports properties: ethernet-ports: false - required: - ethernet-ports properties: ports: false Maybe with that example you can see that each option of the oneOf contains a `required` and a `properties` component at 4 spaces of indent, and then in turn the required properties, being sub-components of `required` grow 2 more spaces for 6. > I guess if you're a YAML expert, this all makes sense, but to those of > us who aren't, these quirky "features" of it just seem totally > illogical. If I were a yaml expert, I would probably be able to use the correct terminology to explain this better, but hopefully the example is useful. --hRWpvk1HDqmaTX1z Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEABYIAB0WIQRh246EGq/8RLhDjO14tDGHoIJi0gUCZTElLAAKCRB4tDGHoIJi 0nGyAQCSissEbIBxRaCcFxF/SsIhIEna84/VQZA/TgqU6R+5eQEAqIrUvOveubc0 111rEtBQs+tzwLNM+TuvJiUKGztktg0= =HXqE -----END PGP SIGNATURE----- --hRWpvk1HDqmaTX1z--