Re: [PATCH v3] dt-bindings: rtc: epson,rx6110: Convert to DT Schema
Conor Dooley <[email protected]> Sat, 9 May 2026 19:32:20 +0100
| Newsgroups | dev.linux.lists.sashiko,org.kernel.vger.linux-devicetree |
|---|---|
| Message-ID | <20260509-heaving-giggle-d9684940eb1c@spud> |
On Sat, May 09, 2026 at 06:28:29PM +0000, [email protected] wrote: > Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider: > - [Medium] The use of `oneOf` in the `if` condition allows invalid configurations with exactly two SPI properties to silently bypass validation. > -- > > commit 61c42b03c451c90501fbc1f5dfb0ec651bc79cc8 > Author: Udaya Kiran Challa <[email protected]> > > dt-bindings: rtc: epson,rx6110: Convert to DT Schema > > Convert the Epson RX6110 Real Time Clock devicetree binding > from the legacy text format to DT schema. > > > diff --git a/Documentation/devicetree/bindings/rtc/epson,rx6110.yaml b/Documentation/devicetree/bindings/rtc/epson,rx6110.yaml > > new file mode 100644 > > index 0000000000000..09578de45d8db > > --- /dev/null > > +++ b/Documentation/devicetree/bindings/rtc/epson,rx6110.yaml > > [ ... ] > > > +required: > > + - compatible > > + - reg > > + > > +if: > > + oneOf: > > + - required: > > + - spi-cs-high > > + - required: > > + - spi-cpha > > + - required: > > + - spi-cpol > > Does this oneOf condition allow invalid configurations with exactly two > SPI properties to silently bypass validation? > > In JSON schema, oneOf requires exactly one of the subschemas to evaluate > to true. If a device tree node provides exactly two of the three SPI > properties (e.g., spi-cs-high and spi-cpha, but omitting spi-cpol), the > node satisfies two of the required conditions. > > Because it matches two subschemas rather than one, the oneOf condition > evaluates to false. Consequently, the if condition fails, the then block > is skipped, and the schema successfully validates the incomplete node. > > Would it be better to use anyOf here instead, to correctly trigger the > requirement that all three properties must be present if at least one is > provided? ^^^ This is correct, I should have suggested anyOf not oneOf.
signature.asc
(application/pgp-signature, 228 B)
-----BEGIN PGP SIGNATURE----- iHUEABYKAB0WIQRh246EGq/8RLhDjO14tDGHoIJi0gUCaf99tAAKCRB4tDGHoIJi 0hd0AQCee7oxchox/429u9DsoEMqY26Uo/yjidxud1pGUJdDWAD9FJCU+rDfX/gQ Ckr94XDGRBEQ3qzOf1RhGXQNQXDmtg8= =G0vN -----END PGP SIGNATURE-----