Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp10024158rwd; Wed, 21 Jun 2023 15:20:19 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4vc99zC4o0jzxJ/kRHcTJhe//AAHt53Zm/Hm5ihfZ1+nn6obRwj1/aRQHzNKGx/2Q3n3Bg X-Received: by 2002:a05:6a20:4299:b0:121:9672:1c14 with SMTP id o25-20020a056a20429900b0012196721c14mr12567176pzj.55.1687386019423; Wed, 21 Jun 2023 15:20:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687386019; cv=none; d=google.com; s=arc-20160816; b=p9WQLbtCSCoM9SoDHPcj39NwpDMzr8C9l+hDZhkLqx876TVnN1kpu86ZvGtP8nO0Wn 5ba3Zc+qetHf1JTCzCoWqCVMfqoJPljhyOHEjvL08JDqUJ14RaXrXV4sNahVYYYg736N twi4ef+uEsZzSt8wUs9/JxLIZdsGO7pd7HaTh+/hLjn10PG8uzFUb5AL206SA9BA0tYG GjldFBN3qKfeuRz/aOTxc976oW55kiiMrE2sszW0r3Stp34VmR+nGjO2S0rTmpbklGbL 6+B6or0fQU4BLBxl5E+e8RFlEFuqigGn/MC+MNNVks89alG/VD8F2aarz+li5U45pGUL YcPg== 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-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=4h3svhbv7w/46gguZ6sS+epoOSJySQs0s/cQe2gdmzk=; b=d0bz6Y6FcBmJa34+n9b6ueh5kfT6J1XRiqcHXGbVG/gvm0PbSuAIU+rRcYtxWlicy+ GrCIXYjlepcAg8xf8P4UWGdKVMdJU83vALVWv+n2LO2pr17uCssvEzKmGE6rkfyYizCw ZP+dV8cHOGbH76UPLFHeVt/ObL/bjuHnPP+G/suRepsH0rDa2CDDnMDbK2H0B/es82JH IJMb0evoMX+J2qnGio41SfJj0ik0wNaJznJdNkLqS4qtzV2bXrd0tsU94kerfHiAJPl1 7PsLCk9dbxxXc0Ke02vOVN7awvNM2+DAUrirABxnZl+EDzYqY9dq+ypD5xaCTmo2flt4 +pUQ== ARC-Authentication-Results: i=1; mx.google.com; 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=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 24-20020a631258000000b0050726756edesi994334pgs.76.2023.06.21.15.20.06; Wed, 21 Jun 2023 15:20:19 -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; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230063AbjFUV6c (ORCPT + 99 others); Wed, 21 Jun 2023 17:58:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58280 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229657AbjFUV6b (ORCPT ); Wed, 21 Jun 2023 17:58:31 -0400 Received: from mail-io1-f54.google.com (mail-io1-f54.google.com [209.85.166.54]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3BE7D1AC; Wed, 21 Jun 2023 14:58:30 -0700 (PDT) Received: by mail-io1-f54.google.com with SMTP id ca18e2360f4ac-780bd47ef93so36139239f.2; Wed, 21 Jun 2023 14:58:30 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687384709; x=1689976709; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=4h3svhbv7w/46gguZ6sS+epoOSJySQs0s/cQe2gdmzk=; b=lyJblzlQJHQlF5Z89pF/WTn5W9qw3HcgpRCKrtz8IJFEJ6A+hvznb7Kas7eO3YHL4V TQVmxHY0TW+h7z77IZPnB4BUme3sD0niHgHiYzxuxiUcSVArHmem04GrgqV9XNsC8ru9 tL5/AQOuq9mMyAHnIsmvMgNWtxwKiexJpbHRVY4h7/f7kPP6EouT8qLhIxO8bM4nIQ6w IHy9TDHg4MESpdXCCyT16mq/ZmKGTkLue8Qz7RKxikW18bb1HyKDrS/n38O3M45ceCiz gWjTGX0Ujpuf43S85cIMgdU9k4915Vs5+iyfs5MrUK3K+7XMdyh4bkM6QWs1hKoZxu6d uFBg== X-Gm-Message-State: AC+VfDw9HHc1o0v2HAfFF2vFvazDV3Ygk/tu9X/fjAkxwfC3vBg3EJRS QV8tA7JTaF+UOvT1aNJAQg== X-Received: by 2002:a05:6e02:806:b0:343:9a7e:9f1a with SMTP id u6-20020a056e02080600b003439a7e9f1amr6811814ilm.1.1687384709256; Wed, 21 Jun 2023 14:58:29 -0700 (PDT) Received: from robh_at_kernel.org ([64.188.179.250]) by smtp.gmail.com with ESMTPSA id f16-20020a92cb50000000b00341e5cde68dsm1597781ilq.78.2023.06.21.14.58.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Jun 2023 14:58:28 -0700 (PDT) Received: (nullmailer pid 3614634 invoked by uid 1000); Wed, 21 Jun 2023 21:58:26 -0000 Date: Wed, 21 Jun 2023 15:58:26 -0600 From: Rob Herring To: Uwe =?iso-8859-1?Q?Kleine-K=F6nig?= Cc: Krzysztof Kozlowski , Claudiu Beznea , Thierry Reding , Krzysztof Kozlowski , Conor Dooley , Nicolas Ferre , Alexandre Belloni , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , NXP Linux Team , Anson Huang , 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 Message-ID: <20230621215826.GA3555109-robh@kernel.org> References: <20230609140709.64655-1-krzysztof.kozlowski@linaro.org> <20230612093315.gbabepl5qg44xf5d@pengutronix.de> <20230621205317.GA3493078-robh@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20230621205317.GA3493078-robh@kernel.org> X-Spam-Status: No, score=-1.2 required=5.0 tests=BAYES_00, FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=no 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 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#