All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Omer PALA" <palaomer100@gmail.com>
Cc: devicetree@vger.kernel.org, robh@kernel.org, conor+dt@kernel.org
Subject: Re: [PATCH v3] dt-bindings: iio: adc: Add dt binding to xlnx,xadc
Date: Fri, 18 Sep 2026 19:07:20 +0000	[thread overview]
Message-ID: <20260918190720.E26511F000FF@smtp.kernel.org> (raw)
In-Reply-To: <20260918185813.5070-1-palaomer100@gmail.com>

Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
- [Medium] dt-bindings: validation bypass for default xlnx,external-mux mode
- [Medium] dt-bindings: ineffective minimum/maximum constraints on reg array
--

commit d006447af566b762c0496dc6711694fae6c9194a
Author: Omer PALA <palaomer100@gmail.com>

dt-bindings: iio: adc: Add dt binding to xlnx,xadc

Add yaml devicetree binding for xlnx,zynq-xadc-1.00.a,
xlnx,axi-xadc-1.00.a and xlnx,system-management-wiz-1.3 from
xilinx-xadc.txt file.

> diff --git a/Documentation/devicetree/bindings/iio/adc/xlnx,xadc.yaml b/Documentation/devicetree/bindings/iio/adc/xlnx,xadc.yaml
> new file mode 100644
> index 0000000000000..ffaada52f9a6e
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/iio/adc/xlnx,xadc.yaml
> @@ -0,0 +1,191 @@

[ ... ]

> +  xlnx,channels:
> +    type: object
> +    description: List of external channels that are connected to the ADC.
> +    properties:
> +      "#address-cells":
> +        const: 1
> +      "#size-cells":
> +        const: 0
> +    required:
> +      - "#address-cells"
> +      - "#size-cells"
> +    patternProperties:
> +      "^channel@[0-9a-f]+$":
> +        type: object
> +        properties:
> +          reg:
> +            description: Pair of pins the channel is connected to
> +            minimum: 0
> +            maximum: 16

[Severity: Medium]
Will these constraints actually provide bounds checking?

Because dt-schema treats standard properties like reg as arrays,
applying numeric constraints like minimum and maximum directly to the
property rather than its items results in them being silently ignored
by the validator.

Could invalid reg values silently pass schema validation here?

> +          xlnx,bipolar:
> +            description: If set the channel is used in bipolar mode.
> +            $ref: /schemas/types.yaml#/definitions/flag

[ ... ]

> +allOf:
> +  - if:
> +      properties:
> +        xlnx,external-mux:
> +          const: none
> +      required:
> +        - xlnx,external-mux
> +    then:
> +      properties:
> +        xlnx,external-mux-channel: false

[Severity: Medium]
Does this conditionally restrict xlnx,external-mux-channel correctly when
xlnx,external-mux is omitted?

Because none is the default external mux mode, it seems a device tree could
omit xlnx,external-mux entirely.

However, the required array containing xlnx,external-mux in the if block
causes the block to evaluate as false and be skipped when the property
is absent.

Will this allow a device tree with xlnx,external-mux-channel specified but
xlnx,external-mux omitted to erroneously pass validation?

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260918185813.5070-1-palaomer100@gmail.com?part=1

  reply	other threads:[~2026-09-18 19:07 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-18 14:58 [PATCH] dt-bindings: iio: adc: Add dt binding to xlnx,xadc Omer PALA
2026-09-18 15:03 ` sashiko-bot
2026-09-18 17:48 ` [PATCH v2] " Omer PALA
2026-09-18 18:02   ` sashiko-bot
2026-09-18 18:58   ` [PATCH v3] " Omer PALA
2026-09-18 19:07     ` sashiko-bot [this message]
2026-09-18 19:44     ` [PATCH v4] " Omer PALA
2026-09-18 19:53       ` sashiko-bot
2026-09-18 20:32       ` [PATCH v5] " Omer PALA
2026-09-19  7:25         ` Krzysztof Kozlowski
2026-09-19  8:07           ` Omer PALA
2026-09-19  8:30             ` Krzysztof Kozlowski
2026-09-19  7:32   ` [PATCH v2] " Krzysztof Kozlowski

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=20260918190720.E26511F000FF@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=palaomer100@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.