Message ID | 20230609140709.64655-1-krzysztof.kozlowski@linaro.org |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp981516vqr; Fri, 9 Jun 2023 07:18:03 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ40VN63H0t2qKTVfjtd/kGrigV5FA49MdAf+aU7Wli07uJpTP6z6z13K6zZ8mJ40IrTVXmv X-Received: by 2002:a05:6a00:b4d:b0:663:5624:6fde with SMTP id p13-20020a056a000b4d00b0066356246fdemr1346638pfo.22.1686320283505; Fri, 09 Jun 2023 07:18:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686320283; cv=none; d=google.com; s=arc-20160816; b=eLdADARuc2dyeP0/o7JKhWD5yfBv8TBuDV1OV1bWQvgm9S1PDV7K00xMywtKqllzYX UE/rAKJ2v0tTaaFjdqO1LKjUJWbgiXvztHB+VI/93B3kqXQJd9IpHWNSSTWiHjoKaq+3 6z6Ya6XNAgGkIHiY+XuXDA3DqltvFShOLpgW0SpzI7xWyCzxFYQQ76AaHD3jB1tGX3G6 U0HUk+/sxVpY8HVNHdtuOItCCOSbej+tQJUMZGfN++ga5m8ZseZprSO1h51wnygDzL+v 5390j4RKj6D2B/XqFRPh5EMWldMqVKu/uefL6/tomJx35TeGehcEpcVd04RZ7N+j0K57 RRFw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=jCeEbW1U8X5tsZ4C4X/AN2VQz3Te0cG/Jf+u2WdiQhA=; b=HBhfLSc8nj0lFz9CqEAH7EwSfVMXSK6yVCg6TQ7ShUXRmf3BWrVnbWZeG4qGt9vq+g Rbk/YkL7WjWS1EwMmT2E2iWg3z4WQaawg46dnUXNOwVqI9kmz4/MHijpUh/+b32vWyVA A9ytaXMffs8sqC4hofMKJiWhoY6Wxv2ZcBTwIw0usNd3eIsFmswbIU9l6ruPS1yI6Pgn xFh6HHvCXRbXd0kdgmyu311bP76EUvCGIWmw5hrIWgthH8Myln1HfKtfCtKx/mdkDUmN wCBW4ja2wvrHB92/IYP6sWDpykUSDJ1bU47ALvsU/WpPgThfrkfeNzjaBCoRjKvqJ593 WvIg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Ts+urxZP; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id a188-20020a624dc5000000b0064367018c21si2571258pfb.12.2023.06.09.07.17.49; Fri, 09 Jun 2023 07:18:03 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Ts+urxZP; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240850AbjFIOH3 (ORCPT <rfc822;liningstudo@gmail.com> + 99 others); Fri, 9 Jun 2023 10:07:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35926 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240127AbjFIOHR (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Fri, 9 Jun 2023 10:07:17 -0400 Received: from mail-lf1-x132.google.com (mail-lf1-x132.google.com [IPv6:2a00:1450:4864:20::132]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1301A35AD for <linux-kernel@vger.kernel.org>; Fri, 9 Jun 2023 07:07:14 -0700 (PDT) Received: by mail-lf1-x132.google.com with SMTP id 2adb3069b0e04-4f644dffd71so2342578e87.1 for <linux-kernel@vger.kernel.org>; Fri, 09 Jun 2023 07:07:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1686319632; x=1688911632; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=jCeEbW1U8X5tsZ4C4X/AN2VQz3Te0cG/Jf+u2WdiQhA=; b=Ts+urxZPApGt0XBPTXgusp3g46WRrEeespxkpm2YhTx4scmVZLcCBxFk3uP6DxV+uf WN6eG0NJwH7RZ1E6L9AHyqbNzdaDRdX4zD0cYnfK3tO4HXMNlwfhaiEw3TIgCkP9qiNQ 9iNsDNhvICxqOwA1dbgfgYbpGtGTgQHjRdXMijsThBI4U9yu42yTNgT5e2M5mQAf9oAd a+Gvb6QBZgaFFtTz4Ct59nJ+QsDL71nuScd4frj824CaOzpeIej0+cEL5+nx+G+d7clP 7qam1XfhLs+cKTZ+Rr0JT5q6tU746JDLC7A6XQRoIf3/pYf5OtfddbncqVOTSYazp1xA 18jQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686319632; x=1688911632; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=jCeEbW1U8X5tsZ4C4X/AN2VQz3Te0cG/Jf+u2WdiQhA=; b=B+zE2rS1MTIGmQZ6tchyjmIIQW3UlnIFtj3JWfyR3LWBBegi79KqLxSVXJ403N+hki /JySFwu704uF5/yeNioIw2FRsWLLKqHKHlTRnhYVrRmbDZzXXxxY1wjzSWeFLmG9iFxQ +xyJXmwKp1pj+30URBJsSiwYzt6wf8+uy4HRZ6wTnbHyeC3E7c6MWWboT6FoeNKLoM+J FbshjrfBhIH2OLUzVPs8CACxDQh6nHnp6oTgiPOwZnIdp5zNB7NabejpgoY2Ag4Ie2Rk SLsTT94hCQ2p6ihtKlNV63eOgMDEqX2YZbZrakdAejCsJCZf4iEybT0FzfUiOFe7bDd7 paiA== X-Gm-Message-State: AC+VfDzHCJlfdvv0AbScKclhSeDSgyyfEDBgSNb6Ub4V/iYqGJUx30SN hKqttFTFjRaH76ErEeGpCVqIKQ== X-Received: by 2002:a2e:9656:0:b0:2ad:95dd:8802 with SMTP id z22-20020a2e9656000000b002ad95dd8802mr1292972ljh.38.1686319632281; Fri, 09 Jun 2023 07:07:12 -0700 (PDT) Received: from krzk-bin.. ([178.197.219.26]) by smtp.gmail.com with ESMTPSA id kg6-20020a17090776e600b009661484e84esm1319651ejc.191.2023.06.09.07.07.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Jun 2023 07:07:11 -0700 (PDT) From: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> To: Claudiu Beznea <claudiu.beznea@microchip.com>, Thierry Reding <thierry.reding@gmail.com>, =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= <u.kleine-koenig@pengutronix.de>, Rob Herring <robh+dt@kernel.org>, 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 Cc: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Subject: [PATCH] dt-bindings: pwm: drop unneeded quotes Date: Fri, 9 Jun 2023 16:07:09 +0200 Message-Id: <20230609140709.64655-1-krzysztof.kozlowski@linaro.org> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED 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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1768234977252006735?= X-GMAIL-MSGID: =?utf-8?q?1768234977252006735?= |
Series |
dt-bindings: pwm: drop unneeded quotes
|
|
Commit Message
Krzysztof Kozlowski
June 9, 2023, 2:07 p.m. UTC
Cleanup bindings dropping unneeded quotes. Once all these are fixed,
checking for this can be enabled in yamllint.
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
---
Documentation/devicetree/bindings/pwm/atmel,at91sam-pwm.yaml | 2 +-
Documentation/devicetree/bindings/pwm/mxs-pwm.yaml | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
Comments
On 09.06.2023 17:07, Krzysztof Kozlowski wrote: > EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe > > Cleanup bindings dropping unneeded quotes. Once all these are fixed, > checking for this can be enabled in yamllint. > > Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Reviewed-by: Claudiu Beznea <claudiu.beznea@microchip.com> > --- > Documentation/devicetree/bindings/pwm/atmel,at91sam-pwm.yaml | 2 +- > Documentation/devicetree/bindings/pwm/mxs-pwm.yaml | 2 +- > 2 files changed, 2 insertions(+), 2 deletions(-) > > diff --git a/Documentation/devicetree/bindings/pwm/atmel,at91sam-pwm.yaml b/Documentation/devicetree/bindings/pwm/atmel,at91sam-pwm.yaml > index ab45df80345d..d84268b59784 100644 > --- a/Documentation/devicetree/bindings/pwm/atmel,at91sam-pwm.yaml > +++ b/Documentation/devicetree/bindings/pwm/atmel,at91sam-pwm.yaml > @@ -11,7 +11,7 @@ maintainers: > - Claudiu Beznea <claudiu.beznea@microchip.com> > > allOf: > - - $ref: "pwm.yaml#" > + - $ref: pwm.yaml# > > properties: > compatible: > diff --git a/Documentation/devicetree/bindings/pwm/mxs-pwm.yaml b/Documentation/devicetree/bindings/pwm/mxs-pwm.yaml > index a34cbc13f691..6ffbed204c25 100644 > --- a/Documentation/devicetree/bindings/pwm/mxs-pwm.yaml > +++ b/Documentation/devicetree/bindings/pwm/mxs-pwm.yaml > @@ -25,7 +25,7 @@ properties: > const: 3 > > fsl,pwm-number: > - $ref: '/schemas/types.yaml#/definitions/uint32' > + $ref: /schemas/types.yaml#/definitions/uint32 > description: u32 value representing the number of PWM devices > > required: > -- > 2.34.1 >
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. 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). So at least in my bubble the general hint is to *always* quote strings. Note that required: true is also the default for yamllint's quoted-strings setting, proably for pitfalls like these. Best regards Uwe
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. > So at least in my bubble the general > hint is to *always* quote strings. Note that required: true is also the > default for yamllint's quoted-strings setting, proably for pitfalls like > these. We're so far gone the other direction from quoting everything, that's not going to happen. Plus, if I liked everything quoted, I would have used JSON. My preference here is I don't want to care about this in reviews. I want yamllint to check it and not have to think about it again. Rob
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#
On Fri, 09 Jun 2023 16:07:09 +0200, Krzysztof Kozlowski wrote: > Cleanup bindings dropping unneeded quotes. Once all these are fixed, > checking for this can be enabled in yamllint. > > Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> > --- > Documentation/devicetree/bindings/pwm/atmel,at91sam-pwm.yaml | 2 +- > Documentation/devicetree/bindings/pwm/mxs-pwm.yaml | 2 +- > 2 files changed, 2 insertions(+), 2 deletions(-) > Applied, thanks!
diff --git a/Documentation/devicetree/bindings/pwm/atmel,at91sam-pwm.yaml b/Documentation/devicetree/bindings/pwm/atmel,at91sam-pwm.yaml index ab45df80345d..d84268b59784 100644 --- a/Documentation/devicetree/bindings/pwm/atmel,at91sam-pwm.yaml +++ b/Documentation/devicetree/bindings/pwm/atmel,at91sam-pwm.yaml @@ -11,7 +11,7 @@ maintainers: - Claudiu Beznea <claudiu.beznea@microchip.com> allOf: - - $ref: "pwm.yaml#" + - $ref: pwm.yaml# properties: compatible: diff --git a/Documentation/devicetree/bindings/pwm/mxs-pwm.yaml b/Documentation/devicetree/bindings/pwm/mxs-pwm.yaml index a34cbc13f691..6ffbed204c25 100644 --- a/Documentation/devicetree/bindings/pwm/mxs-pwm.yaml +++ b/Documentation/devicetree/bindings/pwm/mxs-pwm.yaml @@ -25,7 +25,7 @@ properties: const: 3 fsl,pwm-number: - $ref: '/schemas/types.yaml#/definitions/uint32' + $ref: /schemas/types.yaml#/definitions/uint32 description: u32 value representing the number of PWM devices required: