Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp2199191ybh; Fri, 17 Jul 2020 11:40:03 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyI/QiRN1J0epQ1ERk3uGZlOhh76pTGvYrFfj1xXImtvqsI9rhALh7g95rqdsUeA2UjpSny X-Received: by 2002:a17:906:c1c3:: with SMTP id bw3mr10451688ejb.8.1595011202830; Fri, 17 Jul 2020 11:40:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595011202; cv=none; d=google.com; s=arc-20160816; b=cbViBekGPD6706+caVI6oBURuVcrwdqiyo/er32f2pxqygBAamYPEfqwie3nQ3+lSS V4rR47bXkWQZaVS166GUbOiLfkTG/A50PSgGljUp+oErekZQczjXucvD7hQNQC85RXyw lrlpmqhMlI06T+JO5ikKqw02divBrtroj8IpJbUBR+dhuOG7bxoDUrbIS9igFM71FTl4 wDS0wnQkL0N45S+cy8mOYHz/1ftOa3BIUkx8m2mUTnYrLFWspWRnZxRmyTZLoNaVrq3p reB5n035BFbtdoTVmEhH/+XLQKEIzvWiwQkZyXqL4i8vUcm41UzdAKzoOqJ5S4dO9zEP YygQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=ejMsAZ02d41zn/z9whWMNNMkkb/wp5aU/0t04zhy0nM=; b=dqw6U1L4vqBlNGxDvjGJyF1IG6CTy5q+iQnLbNaaLF1evAjefzym9I94VJI4WWCjFn Wsp8gRwCZt0NLf+XAysAdnohPdtUnztkcAkBooGVzq6JxGdlZE8gw97H6d4ASAJXL4CW SwhC96wvPp5jcI+3sOi/T9mSVHub10dcsLJUW67Mju+zZoY3+IHx9rNptk1fC5Q7ZKMI UD/wi6gGuNx8eagXcog4f0IMJic1y1xrm8q/zeEtZoCurlUBQU3sT1hW0QeoprygXS+N fjBnxiacnO7elSs+M1PZGkE0TQ9C9nwSjlpDU5yUEUgwAYnKiNK9A0RCdSU7LuNO5S/u KDyg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=s6sCGYdN; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id lo14si5473982ejb.244.2020.07.17.11.39.40; Fri, 17 Jul 2020 11:40:02 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=s6sCGYdN; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S1728284AbgGQSgN (ORCPT + 99 others); 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-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