[PATCH net-next 4/4] checkpatch: check for comment explaining rgmii(|-rxid|-txid) PHY modes
Matthias Schiffer
matthias.schiffer at ew.tq-group.com
Wed Apr 16 00:48:12 PDT 2025
On Tue, 2025-04-15 at 09:11 -0700, Joe Perches wrote:
>
> On 2025-04-15 03:18, Matthias Schiffer wrote:
> > Historially, the RGMII PHY modes specified in Device Trees have been
> > used inconsistently, often referring to the usage of delays on the PHY
> > side rather than describing the board; many drivers still implement
> > this
> > incorrectly.
> >
> > Require a comment in Devices Trees using these modes (usually
> > mentioning
> > that the delay is relalized
>
> realized
>
> > diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
> > index 784912f570e9d..57fcbd4b63ede 100755
> > --- a/scripts/checkpatch.pl
> > +++ b/scripts/checkpatch.pl
> > @@ -3735,6 +3735,17 @@ sub process {
> > }
> > }
> >
> > +# Check for RGMII phy-mode with delay on PCB
> > + if ($realfile =~ /\.dtsi?$/ && $line =~
> > /^\+\s*(phy-mode|phy-connection-type)\s*=\s*"/ &&
> > + !ctx_has_comment($first_line, $linenr)) {
>
> Not sure where $first_line comes from and unsure if this works on
> patches rather than complete files.
>
> Does it?
Yes, it works both with patches and full files. I'm using ctx_has_comment() the
same way existing checks do - I think $first_line refers to the start of the
current context for patch files. I have also verified that it only matches on
comments directly above the phy-mode line in question.
Best,
Matthias
--
TQ-Systems GmbH | Mühlstraße 2, Gut Delling | 82229 Seefeld, Germany
Amtsgericht München, HRB 105018
Geschäftsführer: Detlef Schneider, Rüdiger Stahl, Stefan Schneider
https://www.tq-group.com/
More information about the linux-arm-kernel
mailing list