From: sashiko-bot@kernel.org
To: "Udaya Kiran Challa" <challauday369@gmail.com>
Cc: conor+dt@kernel.org, robh@kernel.org, devicetree@vger.kernel.org
Subject: Re: [PATCH v2] dt-bindings: pinctrl: microchip,pic32mzda-pinctrl: Convert to DT schema
Date: Tue, 07 Jul 2026 14:50:40 +0000 [thread overview]
Message-ID: <20260707145040.D53651F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260707144223.120417-1-challauday369@gmail.com>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] The regular expressions used for matching pin configuration nodes are fundamentally flawed, intercepting standard devicetree properties and improperly restricting valid node names.
--
--- Patch [1]: [PATCH v2] dt-bindings: pinctrl: microchip,pic32mzda-pinctrl: Convert to DT schema ---
commit 016f4a5779d5338a039594d73c69d1421ff3e20f
Author: Udaya Kiran Challa <challauday369@gmail.com>
dt-bindings: pinctrl: microchip,pic32mzda-pinctrl: Convert to DT schema
Convert Microchip PIC32 Pin Controller devicetree binding from legacy
text format to DT schema.
Link: https://lore.kernel.org/all/20260705132521.159522-1-challauday369@gmail.com/
> diff --git a/Documentation/devicetree/bindings/pinctrl/microchip,pic32mzda-pinctrl.yaml b/Documentation/devicetree/bindings/pinctrl/microchip,pic32mzda-pinctrl.yaml
> new file mode 100644
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/pinctrl/microchip,pic32mzda-pinctrl.yaml
[ ... ]
> +properties:
> + compatible:
> + const: microchip,pic32mzda-pinctrl
> +
> + reg:
> + maxItems: 1
> +
> + clocks:
> + maxItems: 1
> +
> + '#address-cells':
> + const: 1
> +
> + '#size-cells':
> + const: 1
[Severity: High]
Are these properties usable given the regex constraints on child nodes?
Since the patternProperties regexes below forbid the '@' symbol, it doesn't
appear possible to create child nodes with unit addresses to utilize this
address space mapping.
> +patternProperties:
> + '^[a-z0-9]+[_-][a-z0-9_-]*$':
> + type: object
[Severity: High]
Could this regex unintentionally intercept standard properties?
In JSON schema, patternProperties evaluates against every key in the object,
including property names. Because this regex matches any string with a dash or
underscore, standard properties like "pinctrl-names" or "gpio-controller" will
match it and be forced to validate as an object. This will cause
dt_binding_check to fail when they are used.
Additionally, does this pattern inadvertently prevent the use of standard
generic node names that don't contain dashes (like "uart" or "tx")? Since
additionalProperties is false, names without dashes will be rejected.
> + description: |
> + Pin configuration node with pin muxing and configuration properties.
> + Can be either a direct pin configuration node or a container node
> + with child pin configuration nodes.
[ ... ]
> + patternProperties:
> + '^(?!bias-|input-|output-)[a-z0-9]+[_-][a-z0-9_-]*$':
> + type: object
[Severity: High]
Similar to the parent node pattern, will this regex incorrectly intercept
standard devicetree properties that contain dashes, and reject standard generic
node names without dashes?
Also, does this negative lookahead incorrectly reject valid devicetree node
names just because they happen to start with "bias-", "input-", or "output-"?
> + description: |
> + Child pin configuration node.
> +
> + properties:
> + pins:
> + items:
[ ... ]
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260707144223.120417-1-challauday369@gmail.com?part=1
prev parent reply other threads:[~2026-07-07 14:50 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-07 14:42 [PATCH v2] dt-bindings: pinctrl: microchip,pic32mzda-pinctrl: Convert to DT schema Udaya Kiran Challa
2026-07-07 14:50 ` sashiko-bot [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=20260707145040.D53651F000E9@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=challauday369@gmail.com \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox