* [PATCH] checkpatch: Don't emit warnings for USB & PCI device DT compatible prefixes
@ 2026-05-14 10:51 Chen-Yu Tsai
0 siblings, 0 replies; only message in thread
From: Chen-Yu Tsai @ 2026-05-14 10:51 UTC (permalink / raw)
To: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Andy Whitcroft,
Joe Perches, Dwaipayan Ray, Lukas Bulwahn
Cc: Chen-Yu Tsai, devicetree, linux-kernel, Brian Norris,
Yingying Tang
The USB and PCI device bindings define some compatible patterns based
on device IDs that use the comma to separate vendor and product IDs.
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.
Signed-off-by: Chen-Yu Tsai <wenst@chromium.org>
---
This is a simplified version of what Brian Norris previously posted [1],
but more comprehensive and more perl-y than what Yingying Tang posted
[2], which only covered the second pattern.
Hopefully everyone likes this version.
This is based on next-20260508.
[1] https://lore.kernel.org/all/20190223022440.146915-1-briannorris@chromium.org/
[2] https://lore.kernel.org/all/20251210073812.1380803-1-yingying.tang@oss.qualcomm.com/
scripts/checkpatch.pl | 3 +++
1 file changed, 3 insertions(+)
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 3727156e4cca..ccedf152acfd 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}$/;
`grep -Eq "\\"\\^\Q$vendor\E,\\.\\*\\":" $vp_file`;
if ( $? >> 8 ) {
WARN("UNDOCUMENTED_DT_STRING",
--
2.54.0.563.g4f69b47b94-goog
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2026-05-14 10:52 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-14 10:51 [PATCH] checkpatch: Don't emit warnings for USB & PCI device DT compatible prefixes Chen-Yu Tsai
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox