Devicetree
 help / color / mirror / Atom feed
From: Conor Dooley <conor@kernel.org>
To: sashiko@lists.linux.dev
Cc: Udaya Kiran Challa <challauday369@gmail.com>,
	krzk+dt@kernel.org, conor+dt@kernel.org,
	devicetree@vger.kernel.org, robh@kernel.org
Subject: Re: [PATCH v3] dt-bindings: rtc: epson,rx6110: Convert to DT Schema
Date: Sat, 9 May 2026 19:32:20 +0100	[thread overview]
Message-ID: <20260509-heaving-giggle-d9684940eb1c@spud> (raw)
In-Reply-To: <20260509182830.40C25C2BCB2@smtp.kernel.org>

[-- Attachment #1: Type: text/plain, Size: 2003 bytes --]

On Sat, May 09, 2026 at 06:28:29PM +0000, sashiko-bot@kernel.org 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 <challauday369@gmail.com>
> 
> 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.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

      reply	other threads:[~2026-05-09 18:32 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-09 18:18 [PATCH v3] dt-bindings: rtc: epson,rx6110: Convert to DT Schema Udaya Kiran Challa
2026-05-09 18:28 ` sashiko-bot
2026-05-09 18:32   ` Conor Dooley [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260509-heaving-giggle-d9684940eb1c@spud \
    --to=conor@kernel.org \
    --cc=challauday369@gmail.com \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=krzk+dt@kernel.org \
    --cc=robh@kernel.org \
    --cc=sashiko@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox