lkml.org 
[lkml]   [2022]   [Jul]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [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

\
 
 \ /
  Last update: 2022-07-06 08:07    [W:0.117 / U:0.440 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site