devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Rob Herring <robh@kernel.org>
To: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>
Cc: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>,
	Claudiu Beznea <claudiu.beznea@microchip.com>,
	Thierry Reding <thierry.reding@gmail.com>,
	Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>,
	Conor Dooley <conor+dt@kernel.org>,
	Nicolas Ferre <nicolas.ferre@microchip.com>,
	Alexandre Belloni <alexandre.belloni@bootlin.com>,
	Shawn Guo <shawnguo@kernel.org>,
	Sascha Hauer <s.hauer@pengutronix.de>,
	Pengutronix Kernel Team <kernel@pengutronix.de>,
	Fabio Estevam <festevam@gmail.com>,
	NXP Linux Team <linux-imx@nxp.com>,
	Anson Huang <anson.huang@nxp.com>,
	linux-arm-kernel@lists.infradead.org, linux-pwm@vger.kernel.org,
	devicetree@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] dt-bindings: pwm: drop unneeded quotes
Date: Wed, 21 Jun 2023 15:58:26 -0600	[thread overview]
Message-ID: <20230621215826.GA3555109-robh@kernel.org> (raw)
In-Reply-To: <20230621205317.GA3493078-robh@kernel.org>

On Wed, Jun 21, 2023 at 02:53:17PM -0600, Rob Herring wrote:
> On Mon, Jun 12, 2023 at 11:33:15AM +0200, Uwe Kleine-König wrote:
> > Hello,
> > 
> > On Fri, Jun 09, 2023 at 04:07:09PM +0200, Krzysztof Kozlowski wrote:
> > > Cleanup bindings dropping unneeded quotes. Once all these are fixed,
> > > checking for this can be enabled in yamllint.
> > 
> > in my book quoting everything instead of dropping quotes is the better
> > option. While that policy adds more quotes, it prevents surprises like:
> > 
> > 	$ yaml2json << EOF
> > 	> countrycodes:
> > 	>  - de
> > 	>  - fr
> > 	>  - no
> > 	>  - pl
> > 	> EOF
> > 	{
> > 	  "countrycodes": [
> > 	    "de",
> > 	    "fr",
> > 	    false,
> > 	    "pl"
> > 	  ]
> > 	}
> > 
> > And if you use the "only-when-needed" rule of yamllint you have to write
> > the above list as:
> > 
> > 	countrycodes:
> > 	 - de
> > 	 - fr
> > 	 - "no"
> > 	 - pl
> > 
> > which is IMHO really ugly.
> 
> Agreed, but "no" and "yes" are unlikely values in DT.
> 
> > 
> > Another culprit is "on" (which is used e.g. in github action workflows),
> > so yamllint tells for example for
> > https://github.com/pengutronix/microcom/blob/main/.github/workflows/build.yml:
> > 
> > 	  3:1       warning  truthy value should be one of [false, true]  (truthy)
> > 
> > and there are still more surprises (e.g. version numbers might be
> > subject to conversion to float).
> 
> I'll add a meta-schema check for this. 'const' is already limited to 
> string or integer. That's missing from 'enum'. I think we can also check 
> that all items are the same type as well.

And of course, like every meta-schema addition, we find new errors in 
schemas:

/home/rob/proj/linux-dt/Documentation/devicetree/bindings/phy/brcm,brcmstb-usb-phy.yaml: allOf:0:if:properties:compatible:contains:enum: 'oneOf' conditional failed, one must be fixed:
        {'const': 'brcm,bcm4908-usb-phy'} is not of type 'integer'
        {'const': 'brcm,bcm4908-usb-phy'} is not of type 'string'
        {'const': 'brcm,brcmstb-usb-phy'} is not of type 'integer'
        {'const': 'brcm,brcmstb-usb-phy'} is not of type 'string'
        hint: "enum" must be an array with the same type for all items
        from schema $id: http://devicetree.org/meta-schemas/core.yaml#
/home/rob/proj/linux-dt/Documentation/devicetree/bindings/sound/microchip,sama7g5-pdmc.yaml: properties:microchip,mic-pos:items: 'oneOf' conditional failed, one must be fixed:
        {'items': [{'description': 'value for DS line'}, {'description': 'value for sampling edge'}], 'anyOf': [{'enum': [[0, 0], [0, 1], [1, 0], [1, 1]]}]} is not of type 'array'
        /home/rob/proj/linux-dt/Documentation/devicetree/bindings/sound/microchip,sama7g5-pdmc.yaml: properties:microchip,mic-pos:items:anyOf:0:enum: 'oneOf' conditional failed, one must be fixed:
                [0, 0] is not of type 'integer'
                [0, 0] is not of type 'string'
                [0, 1] is not of type 'integer'
                [0, 1] is not of type 'string'
                [1, 0] is not of type 'integer'
                [1, 0] is not of type 'string'
                [1, 1] is not of type 'integer'
                [1, 1] is not of type 'string'
                hint: "enum" must be an array with the same type for all items
                from schema $id: http://devicetree.org/meta-schemas/core.yaml#
        from schema $id: http://devicetree.org/meta-schemas/core.yaml#
/home/rob/proj/linux-dt/Documentation/devicetree/bindings/net/altr,tse.yaml: allOf:1:if:properties:compatible:contains:enum: 'oneOf' conditional failed, one must be fixed:
        {'const': 'altr,tse-1.0'} is not of type 'integer'
        {'const': 'altr,tse-1.0'} is not of type 'string'
        {'const': 'ALTR,tse-1.0'} is not of type 'integer'
        {'const': 'ALTR,tse-1.0'} is not of type 'string'
        hint: "enum" must be an array with the same type for all items
        from schema $id: http://devicetree.org/meta-schemas/core.yaml#


  reply	other threads:[~2023-06-21 21:58 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-09 14:07 [PATCH] dt-bindings: pwm: drop unneeded quotes Krzysztof Kozlowski
2023-06-12  8:21 ` Claudiu.Beznea
2023-06-12  9:33 ` Uwe Kleine-König
2023-06-21 20:53   ` Rob Herring
2023-06-21 21:58     ` Rob Herring [this message]
2023-06-23 20:25 ` Rob Herring

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=20230621215826.GA3555109-robh@kernel.org \
    --to=robh@kernel.org \
    --cc=alexandre.belloni@bootlin.com \
    --cc=anson.huang@nxp.com \
    --cc=claudiu.beznea@microchip.com \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=festevam@gmail.com \
    --cc=kernel@pengutronix.de \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=krzysztof.kozlowski@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-imx@nxp.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pwm@vger.kernel.org \
    --cc=nicolas.ferre@microchip.com \
    --cc=s.hauer@pengutronix.de \
    --cc=shawnguo@kernel.org \
    --cc=thierry.reding@gmail.com \
    --cc=u.kleine-koenig@pengutronix.de \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).