Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp2539445rdh; Sun, 26 Nov 2023 09:48:40 -0800 (PST) X-Google-Smtp-Source: AGHT+IExWFEw3MB+Gk6nWOOuAT/sd6Hp8psSaDnpwHQRjRD4Hy9HN2HsfRCzLvxcZ342Apie6R2I X-Received: by 2002:a17:903:2684:b0:1cf:959d:8cd with SMTP id jf4-20020a170903268400b001cf959d08cdmr6876701plb.22.1701020919864; Sun, 26 Nov 2023 09:48:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701020919; cv=none; d=google.com; s=arc-20160816; b=twpgvscQBfpNXplV83bmGFKI9NFhhF4bWkYgDx9zSgDQdKANXsjaoOccRi2c6XsTwT +U17y/gdVAyXICJtHBv6cLX8p6HohLYp2ffBHNB634oh1UgLGGsBTdYVsXb0MwGa0AS8 gbGEpnXW32N0sgBU8uttLp3egUYxf98ZbKOB3pnUV+vZ7BxgfcWzK8EeQ6x/MQojy+1B VRFd7GNnwJpy3oOGNrehnrsJ84RjM3js1Tv+Ja9CvnEjcoeQW8Fpze7VwPDzOEUsFuBB 68BkFfFl0sJ1c/jKSzARyu2vdG1chES9/Cx3FYFTF+TkJmxxC9O8spMfVYnTn6d48Z2/ FBdg== 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-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=P+MMY/H9HFvWRq/TZPXfzpfMq3RLmEgdkEE9wrSqusE=; fh=aLp+ctzarGjyLkZPc3X62gV2OM4I3QQNrD/oOnQ+9qo=; b=hUHarui9PpwHSJAPi7NBOoinSXPaHzMdNMcZbRbkIhE1Jp28b0inmQasIkRELkL8DG a7+LQbXn8dJzYMhz1rT+6yVqhm/1fwpXemiRBapMVe60YhBMTvWWviszIjsc0w/WYait fm/gkP+4b7NDPGEYi6mRMII4WlMZbpy0suXCcR4ANMjDXeGSbVcAdE8r0Hha0FrvBh1O AIIc9N2cH9+xlcx76mxZkEz4yENGvJcjlym5h4yUxfAq1BVEvtQ/IuGRhBCL5H+L5n5u GRTla3h0Vf2uif5/CCRyvW8UtzpFcYcqO5rZwbgIDwT/z+62+oDIvL2AlwUollKiq7My KtUg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lunn.ch header.s=20171124 header.b=ZK1Xn+aV; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=lunn.ch Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [23.128.96.33]) by mx.google.com with ESMTPS id ji14-20020a170903324e00b001cc32bdb35csi2474763plb.1.2023.11.26.09.48.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 26 Nov 2023 09:48:39 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) client-ip=23.128.96.33; Authentication-Results: mx.google.com; dkim=pass header.i=@lunn.ch header.s=20171124 header.b=ZK1Xn+aV; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=lunn.ch Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id 51F82807FC2F; Sun, 26 Nov 2023 09:48:37 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229456AbjKZRsZ (ORCPT + 99 others); Sun, 26 Nov 2023 12:48:25 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41598 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229436AbjKZRsY (ORCPT ); Sun, 26 Nov 2023 12:48:24 -0500 Received: from vps0.lunn.ch (vps0.lunn.ch [156.67.10.101]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CC2C1DD; Sun, 26 Nov 2023 09:48:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lunn.ch; s=20171124; h=In-Reply-To:Content-Disposition:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:From:Sender:Reply-To:Subject: Date:Message-ID:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding: Content-ID:Content-Description:Content-Disposition:In-Reply-To:References; bh=P+MMY/H9HFvWRq/TZPXfzpfMq3RLmEgdkEE9wrSqusE=; b=ZK1Xn+aVbP+grqplmNoNPl/JFs tdqVCS3ZE4Jt1ffDtrPn4OMhzm4zhF1OO/YzWxla+LZx6dFXZPsIuvOEz/1WMe8lk47VLg12prwn2 Tl1HVsDqUmWdr6SlgvLkVUkqNY0LGcaMsQis5uj6R/afxgJMm+a5uq60ZNlRtVNdWnaU=; Received: from andrew by vps0.lunn.ch with local (Exim 4.94.2) (envelope-from ) id 1r7JEr-001GJ7-Ig; Sun, 26 Nov 2023 18:48:13 +0100 Date: Sun, 26 Nov 2023 18:48:13 +0100 From: Andrew Lunn To: Krzysztof Kozlowski Cc: Rob Herring , Krzysztof Kozlowski , Conor Dooley , Matthias Brugger , AngeloGioacchino Del Regno , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, Andrew Davis , Arnd Bergmann , Bjorn Andersson , Chen-Yu Tsai , Dmitry Baryshkov , Geert Uytterhoeven , Heiko Stuebner , Jonathan Corbet , Konrad Dybcio , Michal Simek , Neil Armstrong , Nishanth Menon , Olof Johansson , =?utf-8?B?UmFmYcWCIE1pxYJlY2tp?= , linux-rockchip@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-amlogic@lists.infradead.org, linux-arm-msm@vger.kernel.org, workflows@vger.kernel.org, linux-doc@vger.kernel.org Subject: Re: [PATCH v3] docs: dt-bindings: add DTS Coding Style document Message-ID: <4fa1e860-48bd-456b-ab0b-88215c2b8d1b@lunn.ch> References: <20231125184422.12315-1-krzysztof.kozlowski@linaro.org> <15292222-39b3-4e9e-a6c1-26fba8f5efcd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <15292222-39b3-4e9e-a6c1-26fba8f5efcd@linaro.org> X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Sun, 26 Nov 2023 09:48:37 -0800 (PST) On Sun, Nov 26, 2023 at 11:38:38AM +0100, Krzysztof Kozlowski wrote: > On 25/11/2023 20:47, Andrew Lunn wrote: > >> +===================================== > >> +Devicetree Sources (DTS) Coding Style > >> +===================================== > >> + > >> +When writing Devicetree Sources (DTS) please observe below guidelines. They > >> +should be considered complementary to any rules expressed already in Devicetree > >> +Specification and dtc compiler (including W=1 and W=2 builds). > >> + > >> +Individual architectures and sub-architectures can add additional rules, making > >> +the style stricter. > > > > It would be nice to add a pointer where such rules are documented. > > Subsystem profile or any other place. The generic doc should not point > to specific ones. That is not so friendly for a developer. A reviewer points out that a file is not consistent with the coding style. So they go away and fix it, as described here. They then get a second review which say, no, you to do X, Y and Z, despite them actually following the coding style. Maybe add to the paragraph above: These further restrictions are voluntary, until added to this document. This should encourage those architectures to document their coding style. > The root node is a bit special, but other than that mixing nodes with > and without unit address is discouraged practice. If the root node is special, maybe it needs a few rules of its own? All properties without an address come first, then properties with addresses. Sorting within these classes follow the normal rules already stated? > >> +Indentation > >> +----------- > >> + > >> +1. Use indentation according to :ref:`codingstyle`. > >> +2. For arrays spanning across lines, it is preferred to align the continued > >> + entries with opening < from the first line. > >> +3. Each entry in arrays with multiple cells (e.g. "reg" with two IO addresses) > >> + shall be enclosed in <>. > >> + > >> +Example:: > >> + > >> + thermal-sensor@c271000 { > >> + compatible = "qcom,sm8550-tsens", "qcom,tsens-v2"; > >> + reg = <0x0 0x0c271000 0x0 0x1000>, > >> + <0x0 0x0c222000 0x0 0x1000>; > >> + }; > > > > I'm not sure i understand this. Is this example correct? > > > > gpio-fan,speed-map = <0 0 > > 3000 1 > > 6000 2>; > > > > It exists a lot in todays files. > > Depends on the binidng. Is it matrix? If yes, then it is not correct. It seems to me, rules 2 and 3 should be swapped. You can only align the <, if you have <. So logically, the rule about having < should come first. Andrew