From: sashiko-bot@kernel.org
To: "Chen-Yu Tsai" <wenst@chromium.org>
Cc: devicetree@vger.kernel.org, robh@kernel.org, krzk+dt@kernel.org,
conor+dt@kernel.org
Subject: Re: [PATCH] checkpatch: Don't emit warnings for USB & PCI device DT compatible prefixes
Date: Thu, 14 May 2026 18:31:57 +0000 [thread overview]
Message-ID: <20260514183158.5D6FCC2BCB3@smtp.kernel.org> (raw)
In-Reply-To: <20260514105151.2771474-1-wenst@chromium.org>
Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
- [Medium] The commit introduces a hardcoded bypass for `pciclass` based on a false premise, masking an underlying bug in checkpatch.pl.
- [Medium] The code implementation silently supports the `usbif` prefix, introducing a meaningful mismatch with the commit message.
--
commit 771fab4f035f631c7cd034c709f25afb0f1dc11b
Author: Chen-Yu Tsai <wenst@chromium.org>
checkpatch: Don't emit warnings for USB & PCI device DT compatible prefixes
The USB and PCI device bindings define some compatible patterns based
on device IDs that use the comma to separate vendor and product IDs.
This commit skips these prefixes when checking vendor prefixes in
checkpatch.pl.
> These patterns include:
>
> - usb[0-9a-f]{1,4},[0-9a-f]{1,4}
> - pci[0-9a-f]{2,4},[0-9a-f]{1,4}
> - pciclass,[01][0-9a-f]{3}([0-9a-f]{2})?
>
> These are not real vendor prefixes. Don't emit warnings for them.
Is this description accurate regarding pciclass? The commit message assumes
pciclass is not a real vendor prefix. However, looking at
vendor-prefixes.yaml, it is actually defined as part of a grouped regex:
"^(pciclass|pinctrl-single|#pinctrl-single|PowerPC),.*": true
The reason the check fails in checkpatch.pl isn't because it is a fake prefix,
but because the grep command below uses a literal match:
grep -Eq "\"^\Q$vendor\E,\.*\":" $vp_file;
Does this workaround paper over the underlying issue with the grep
command not matching grouped regexes, which would also affect other valid
prefixes like pinctrl-single or exynos?
> diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
> index 3727156e4ccad..ccedf152acfd7 100755
> --- a/scripts/checkpatch.pl
> +++ b/scripts/checkpatch.pl
> @@ -3795,6 +3795,9 @@ sub process {
>
> next if $compat !~ /^([a-zA-Z0-9\-]+)\,/;
> my $vendor = $1;
> + next if $vendor eq "pciclass";
> + next if $vendor =~ /^pci[a-f0-9]{2,4}$/;
> + next if $vendor =~ /^usb(if)?[a-f0-9]{1,4}$/;
The commit message explicitly lists usb[0-9a-f]{1,4},[0-9a-f]{1,4} as the
supported pattern for USB, but the implementation here silently supports the
usbif prefix as well.
While usbif is a valid prefix for USB interface bindings, could the commit
message be updated to reflect its undocumented inclusion in this regex?
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260514105151.2771474-1-wenst@chromium.org?part=1
prev parent reply other threads:[~2026-05-14 18:31 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-14 10:51 [PATCH] checkpatch: Don't emit warnings for USB & PCI device DT compatible prefixes Chen-Yu Tsai
2026-05-14 17:40 ` Brian Norris
2026-05-14 18:10 ` Joe Perches
2026-05-14 18:31 ` 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=20260514183158.5D6FCC2BCB3@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=krzk+dt@kernel.org \
--cc=robh@kernel.org \
--cc=sashiko-reviews@lists.linux.dev \
--cc=wenst@chromium.org \
/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