All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Bhargav Joshi" <j.bhargav.u@gmail.com>
Cc: conor+dt@kernel.org, robh@kernel.org, devicetree@vger.kernel.org
Subject: Re: [PATCH v4 2/2] spi: dt-bindings: ti,davinci-spi: Convert to DT schema
Date: Mon, 31 Aug 2026 23:44:59 +0000	[thread overview]
Message-ID: <20260831234500.6B17B1F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260901-ti-davinci-spi-v4-2-92e9c0b2e1d4@gmail.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] The schema uses `const: ti,keystone-spi` within the `if` block checking the `compatible` property. Because `compatible` is parsed and evaluated as an array of strings by dt-schema, comparing it directly to a scalar string using `const` will always evaluate to false. This silently bypasses the schema constraint, allowing device tree nodes with `ti,keystone-spi` to pass validation even when they omit the required `power-domains` property (as demonstrated by the first example in the schema, which lacks `power-domains`). The correct match operator is `contains: const: ti,keystone-spi`.
--

commit 1f217c9462f9b9ccc473fed6ad4bc95248f60b00
Author: Bhargav Joshi <j.bhargav.u@gmail.com>

spi: dt-bindings: ti,davinci-spi: Convert to DT schema

This commit converts the TI DaVinci/Keystone SPI controller binding
from text format to DT schema. It creates a separate peripheral schema
for the ti,spi-wdelay property and adds missing DMA properties.

> diff --git a/Documentation/devicetree/bindings/spi/ti,davinci-spi.yaml b/Documentation/devicetree/bindings/spi/ti,davinci-spi.yaml
> new file mode 100644
> index 0000000000000..672d03d2492b3
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/spi/ti,davinci-spi.yaml

[ ... ]

> +allOf:
> +  - $ref: spi-controller.yaml#
> +  - if:
> +      properties:
> +        compatible:
> +          const: ti,keystone-spi

[Severity: Medium]
Does this const check correctly evaluate the compatible property?

Since compatible is parsed and evaluated as an array of strings by
dt-schema, comparing it directly to a scalar string using const will
always silently evaluate to false. This bypasses the schema constraint
and allows device tree nodes with ti,keystone-spi to pass validation
even when they omit the required power-domains property.

Should this match against the array by using contains:
        compatible:
          contains:
            const: ti,keystone-spi
instead?

> +    then:
> +      required:
> +        - power-domains
> +
> +unevaluatedProperties: false

[ ... ]

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260901-ti-davinci-spi-v4-0-92e9c0b2e1d4@gmail.com?part=2

  reply	other threads:[~2026-08-31 23:45 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-31 23:32 [PATCH v4 0/2] spi: davinci: Convert bindings to DT schema and clean up DTS Bhargav Joshi
2026-08-31 23:32 ` [PATCH v4 1/2] ARM: dts: ti: keystone-k2l: Rename ti,davinci-spi-num-cs to num-cs Bhargav Joshi
2026-08-31 23:32 ` [PATCH v4 2/2] spi: dt-bindings: ti,davinci-spi: Convert to DT schema Bhargav Joshi
2026-08-31 23:44   ` sashiko-bot [this message]
2026-09-04 15:59 ` (subset) [PATCH v4 0/2] spi: davinci: Convert bindings to DT schema and clean up DTS Nishanth Menon

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=20260831234500.6B17B1F000E9@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=j.bhargav.u@gmail.com \
    --cc=robh@kernel.org \
    --cc=sashiko-reviews@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.