Re: [PATCH v15 07/22] dt-bindings: media: i2c: max96712: add support for I2C ATR

[email protected]
Newsgroups org.kernel.vger.linux-devicetree
Message-ID <[email protected]>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Low] The `reg` property constraint inside `patternProperties: ^i2c@[0-3]$` incorrectly uses `items: minimum: 0, maximum: 3` without `maxItems: 1`, rendering the value constraint ineffective and allowing multiple array entries.
--

--- Patch [7]: [PATCH v15 07/22] dt-bindings: media: i2c: max96712: add support for I2C ATR ---
commit 28aa89070be3ca4f5f4875a6e067a29ad02052e7
Author: Cosmin Tanislav <[email protected]>

dt-bindings: media: i2c: max96712: add support for I2C ATR

This commit adds support for changing the I2C address of connected serializers 
by documenting the I2C ATR capabilities for MAX96712 and MAX96724 devices.

> diff --git a/Documentation/devicetree/bindings/media/i2c/maxim,max96712.yaml b/Documentation/devicetree/bindings/media/i2c/maxim,max96712.yaml
> index 583bbd60157c6..abacc3c874a9f 100644
> --- a/Documentation/devicetree/bindings/media/i2c/maxim,max96712.yaml
> +++ b/Documentation/devicetree/bindings/media/i2c/maxim,max96712.yaml

[ ... ]

> +    patternProperties:
> +      '^i2c@[0-3]$':
> +        $ref: /schemas/i2c/i2c-controller.yaml#
> +        unevaluatedProperties: false
> +        properties:
> +          reg:
> +            items:
> +              minimum: 0
> +              maximum: 3

[Severity: Low]
Does this constraint fully validate the reg property?

Because dt-schema treats the reg property as a matrix (an array of region
arrays), applying an items object with numeric constraints like minimum and
maximum attempts to apply those rules to the inner arrays. The JSON Schema
specification silently ignores numeric constraints applied to non-numeric types.

Additionally, without maxItems: 1, multiple reg entries are permitted. Should
maxItems: 1 be added here, and should the numeric constraints target the inner
array items instead?

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=7
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.