[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <YsUmVBXWPojz0woT@hovoldconsulting.com>
Date: Wed, 6 Jul 2022 08:06:12 +0200
From: Johan Hovold <johan@...nel.org>
To: Krzysztof Kozlowski <krzysztof.kozlowski@...aro.org>
Cc: Johan Hovold <johan+linaro@...nel.org>,
Vinod Koul <vkoul@...nel.org>,
Rob Herring <robh+dt@...nel.org>,
Krzysztof Kozlowski <krzysztof.kozlowski+dt@...aro.org>,
Andy Gross <agross@...nel.org>,
Bjorn Andersson <bjorn.andersson@...aro.org>,
Kishon Vijay Abraham I <kishon@...com>,
linux-arm-msm@...r.kernel.org, linux-phy@...ts.infradead.org,
devicetree@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 17/43] dt-bindings: phy: qcom,qmp-pcie: add missing child
node schema
On Tue, Jul 05, 2022 at 08:21:12PM +0200, Krzysztof Kozlowski wrote:
> On 05/07/2022 14:11, Johan Hovold wrote:
> > Ok, so you want to flatten this by repeating also the register
> > descriptions?
> >
> > That wouldn't hurt readability as much, but doing so would be more error
> > prone as it's easy to miss adding a new compatible in every group of
> > conditionals and there's no else clause to catch the mistake.
> >
> > Right know the logic is
> >
> > if dual-lane
> > items = 6
> > else
> > items = 3 or 4
> > if single-lane-exception
> > items = 3
> > else
> > items = 4
> >
> > Flattening this gives
> >
> > if dual-lane
> > items = 6
> > if single-lane-normal
> > items = 4
> > if single-lane-exception
> > items = 3
> >
> > Which means that every compatible must now be listed in one of the
> > conditionals.
>
> Yes, because it's explicit and easy to read. Handling compatibles in
> 'else' makes it opposite - one cannot use grep and cannot easily find
> what is actually covered by maxItems:4 (you need to check all 7
> compatibles to find what is not covered here).
I'll go with that then.
Johan
Powered by blists - more mailing lists