From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B61E1C433E1 for ; Fri, 17 Jul 2020 18:36:14 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 97F5C20704 for ; Fri, 17 Jul 2020 18:36:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1595010974; bh=6IhYIKmVZDeZrypbI87Kz8pgaQhaQha5rJV8Ik5J7bk=; h=References:In-Reply-To:From:Date:Subject:To:Cc:List-ID:From; b=OUzI3PEhPv+p3r6cLzP2niS7f9Qt/OoihM4uinEmxZB2xZELVlGpWf1x/uCHKs4wF 06+av8+YyWEDBxApgagA4vL6b1RwbxFY5k1HqbrzIPDC4Rxxmz4XlyLdA8+bqoueEX 4h+QkLKqqWBim9JESL048fn7L17hXU/eamuXnwqg= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728291AbgGQSgN (ORCPT ); Fri, 17 Jul 2020 14:36:13 -0400 Received: from mail.kernel.org ([198.145.29.99]:50222 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728022AbgGQSgN (ORCPT ); Fri, 17 Jul 2020 14:36:13 -0400 Received: from mail-ot1-f54.google.com (mail-ot1-f54.google.com [209.85.210.54]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 38FFD21702; Fri, 17 Jul 2020 18:36:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1595010972; bh=6IhYIKmVZDeZrypbI87Kz8pgaQhaQha5rJV8Ik5J7bk=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=s6sCGYdNX1R9qYXHHidspLXuFmtNrCsbL2kIbUlxAtc26Ua7C0ChuGqSMrMxcE/Q+ 6R3kR+qo1eQ0iYYDZl4fMNgTUOl7lQplKoP3nbgBhX//diF+tyyahGvPnveim25CdD lam63/GQ/3vp0/VXdRFp6dtfix15TcFPGvmcIEkQ= Received: by mail-ot1-f54.google.com with SMTP id 5so7518586oty.11; Fri, 17 Jul 2020 11:36:12 -0700 (PDT) X-Gm-Message-State: AOAM532ccMUB4I4bDaCcANMdFqCID3aqLE4EdwqVDSHuIUfU19qaeaMx wOI+Ng6jQ9/cneSIIK6OwO6loVCxdhtgSQPM6g== X-Google-Smtp-Source: ABdhPJwvWVISrMjnm+UoMBRoocoox6vjA7uZZ0i4pJ9VBySQKqf+ek0xvhn+opfsWguYonw/q0Q7Q/bIE/Tx5LV1iO8= X-Received: by 2002:a05:6830:3104:: with SMTP id b4mr10161318ots.192.1595010971464; Fri, 17 Jul 2020 11:36:11 -0700 (PDT) MIME-Version: 1.0 References: <20200707102338.989660-1-yamada.masahiro@socionext.com> <20200716230451.GA3041278@bogus> In-Reply-To: From: Rob Herring Date: Fri, 17 Jul 2020 12:36:00 -0600 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] dt-bindings: uniphier-thermal: add minItems to socionext,tmod-calibration To: Masahiro Yamada Cc: Frank Rowand , DTML , Amit Kucheria , Daniel Lezcano , Kunihiko Hayashi , Zhang Rui , linux-arm-kernel , Linux Kernel Mailing List , Linux PM mailing list Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jul 16, 2020 at 10:54 PM Masahiro Yamada wrote: > > On Fri, Jul 17, 2020 at 8:09 AM Rob Herring wrote: > > > > On Tue, Jul 07, 2020 at 07:23:38PM +0900, Masahiro Yamada wrote: > > > As the description says, this property contains a pair of calibration > > > values. The number of items must be exactly 2. > > > > > > Add minItems to check a too short property. > > > > > > While I was here, I also added this property to the example because > > > this is the case in the real DT file, > > > arch/arm64/boot/dts/socionext/uniphier-ld20.dtsi > > > > > > Also, fix the interrupt type (edge -> level) to align with the > > > real DT. > > > > > > Signed-off-by: Masahiro Yamada > > > --- > > > > > > .../bindings/thermal/socionext,uniphier-thermal.yaml | 4 +++- > > > 1 file changed, 3 insertions(+), 1 deletion(-) > > > > > > diff --git a/Documentation/devicetree/bindings/thermal/socionext,uniphier-thermal.yaml b/Documentation/devicetree/bindings/thermal/socionext,uniphier-thermal.yaml > > > index 553c9dcdaeeb..57ffd0c4c474 100644 > > > --- a/Documentation/devicetree/bindings/thermal/socionext,uniphier-thermal.yaml > > > +++ b/Documentation/devicetree/bindings/thermal/socionext,uniphier-thermal.yaml > > > @@ -29,6 +29,7 @@ properties: > > > > > > socionext,tmod-calibration: > > > $ref: /schemas/types.yaml#/definitions/uint32-array > > > + minItems: 2 > > > > The intent was if minItems is not defined, then the default is the same > > as maxItems. This is not the default for json-schema, so the tooling is > > supposed to add it. > > > This implication is unclear. > > maxItems should literally only define the max, and > we should stick to json-schema as much as possible, IMHO. Yes, but we already deviate a bit as the default json-schema behavior is a bit different than DT defaults. For example, with just: items: - const: a - const: b - const: c All of these pass validation: [] [ a ] [ a, b, c, 1, 2, true ] when we really only want [ a, b, c ] to pass (by default). So we add minItems, maxItems, and additionalItems if not specified. > It would be nice if json-schema had something like: > > numItems: 2 > > as a shorthand for > > minItems: 2 > maxItems: 2 Yes, I've been thinking the same thing. It wouldn't be unprecedented as they added 'const' to shorten 'enum: [ one_entry ]'. We can add our own keywords too, but I try to avoid that so far. The only ones we have are internal to dtschema (typeSize and phandle). Rob From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 93AAFC433E1 for ; Fri, 17 Jul 2020 18:37:51 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 48DF220704 for ; Fri, 17 Jul 2020 18:37:51 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="VGfUDUBM"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="s6sCGYdN" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 48DF220704 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:To:Subject:Message-ID:Date:From:In-Reply-To: References:MIME-Version:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=KtFTrFdTok7c3dC3BsVlMwjhnzF/Kpi77vgFqR0Vyys=; b=VGfUDUBMMwEEOlkqMJc8emtUi m5iW4rHJrx25K0Ukoz7ulxKhVzjwHPKGR21Iwm3S91qkPjZUBzYjjmR5OxN5F3rHhJ2lPz+5lf7xf Ou7regm6x8XhkzEsJddaBCSkwjGMdIk1GzMK0C6x7/Y7flXNj9AS2hvqSlxdTN4dvzEWMlYgLsKOW cjwKGuaFesh3DViZkJs8pEk6VshuPu/8ZsgTnNmrn34ekRxo/lK49CGa/87w5/t6VJR3ppq+4+dzn mfkVAuDG209XYehMd/DXr8CgzAsAa5FQ+RAo8kifzn08t4LtuU3r/OS8aXlWxDq8hQQVSw93OF/Bp f8qwa+APA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jwVDV-0008Vx-9A; Fri, 17 Jul 2020 18:36:17 +0000 Received: from mail.kernel.org ([198.145.29.99]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jwVDR-0008V6-I1 for linux-arm-kernel@lists.infradead.org; Fri, 17 Jul 2020 18:36:14 +0000 Received: from mail-ot1-f45.google.com (mail-ot1-f45.google.com [209.85.210.45]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 24CA72076D for ; Fri, 17 Jul 2020 18:36:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1595010972; bh=6IhYIKmVZDeZrypbI87Kz8pgaQhaQha5rJV8Ik5J7bk=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=s6sCGYdNX1R9qYXHHidspLXuFmtNrCsbL2kIbUlxAtc26Ua7C0ChuGqSMrMxcE/Q+ 6R3kR+qo1eQ0iYYDZl4fMNgTUOl7lQplKoP3nbgBhX//diF+tyyahGvPnveim25CdD lam63/GQ/3vp0/VXdRFp6dtfix15TcFPGvmcIEkQ= Received: by mail-ot1-f45.google.com with SMTP id 72so7568333otc.3 for ; Fri, 17 Jul 2020 11:36:12 -0700 (PDT) X-Gm-Message-State: AOAM532z2FE9EVwFI3W++jpRh2qZ+0r6DHEVoIAarK/1QOPdfyDJI1S1 ihkZtkWqE9Fno1L4SW2osN8MaL+mWJPNlOP/tg== X-Google-Smtp-Source: ABdhPJwvWVISrMjnm+UoMBRoocoox6vjA7uZZ0i4pJ9VBySQKqf+ek0xvhn+opfsWguYonw/q0Q7Q/bIE/Tx5LV1iO8= X-Received: by 2002:a05:6830:3104:: with SMTP id b4mr10161318ots.192.1595010971464; Fri, 17 Jul 2020 11:36:11 -0700 (PDT) MIME-Version: 1.0 References: <20200707102338.989660-1-yamada.masahiro@socionext.com> <20200716230451.GA3041278@bogus> In-Reply-To: From: Rob Herring Date: Fri, 17 Jul 2020 12:36:00 -0600 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] dt-bindings: uniphier-thermal: add minItems to socionext, tmod-calibration To: Masahiro Yamada X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200717_143613_719034_A6F423B4 X-CRM114-Status: GOOD ( 28.25 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: DTML , Amit Kucheria , Kunihiko Hayashi , Linux PM mailing list , Daniel Lezcano , Linux Kernel Mailing List , Zhang Rui , Frank Rowand , linux-arm-kernel Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Thu, Jul 16, 2020 at 10:54 PM Masahiro Yamada wrote: > > On Fri, Jul 17, 2020 at 8:09 AM Rob Herring wrote: > > > > On Tue, Jul 07, 2020 at 07:23:38PM +0900, Masahiro Yamada wrote: > > > As the description says, this property contains a pair of calibration > > > values. The number of items must be exactly 2. > > > > > > Add minItems to check a too short property. > > > > > > While I was here, I also added this property to the example because > > > this is the case in the real DT file, > > > arch/arm64/boot/dts/socionext/uniphier-ld20.dtsi > > > > > > Also, fix the interrupt type (edge -> level) to align with the > > > real DT. > > > > > > Signed-off-by: Masahiro Yamada > > > --- > > > > > > .../bindings/thermal/socionext,uniphier-thermal.yaml | 4 +++- > > > 1 file changed, 3 insertions(+), 1 deletion(-) > > > > > > diff --git a/Documentation/devicetree/bindings/thermal/socionext,uniphier-thermal.yaml b/Documentation/devicetree/bindings/thermal/socionext,uniphier-thermal.yaml > > > index 553c9dcdaeeb..57ffd0c4c474 100644 > > > --- a/Documentation/devicetree/bindings/thermal/socionext,uniphier-thermal.yaml > > > +++ b/Documentation/devicetree/bindings/thermal/socionext,uniphier-thermal.yaml > > > @@ -29,6 +29,7 @@ properties: > > > > > > socionext,tmod-calibration: > > > $ref: /schemas/types.yaml#/definitions/uint32-array > > > + minItems: 2 > > > > The intent was if minItems is not defined, then the default is the same > > as maxItems. This is not the default for json-schema, so the tooling is > > supposed to add it. > > > This implication is unclear. > > maxItems should literally only define the max, and > we should stick to json-schema as much as possible, IMHO. Yes, but we already deviate a bit as the default json-schema behavior is a bit different than DT defaults. For example, with just: items: - const: a - const: b - const: c All of these pass validation: [] [ a ] [ a, b, c, 1, 2, true ] when we really only want [ a, b, c ] to pass (by default). So we add minItems, maxItems, and additionalItems if not specified. > It would be nice if json-schema had something like: > > numItems: 2 > > as a shorthand for > > minItems: 2 > maxItems: 2 Yes, I've been thinking the same thing. It wouldn't be unprecedented as they added 'const' to shorten 'enum: [ one_entry ]'. We can add our own keywords too, but I try to avoid that so far. The only ones we have are internal to dtschema (typeSize and phandle). Rob _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel