All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Russell King (Oracle)" <linux@armlinux.org.uk>
To: Andrew Lunn <andrew@lunn.ch>
Cc: Yi Cong <cong.yi@linux.dev>,
	Frank.Sae@motor-comm.com, andrew+netdev@lunn.ch,
	davem@davemloft.net, hkallweit1@gmail.com, kuba@kernel.org,
	netdev@vger.kernel.org, stable@vger.kernel.org,
	yicong@kylinos.cn
Subject: Re: [PATCH] net: phy: motorcomm: Fix the issue in the code regarding the incorrect use of time units
Date: Tue, 28 Oct 2025 12:19:32 +0000	[thread overview]
Message-ID: <aQC01GDPr-WclcZS@shell.armlinux.org.uk> (raw)
In-Reply-To: <2610bc26-44e6-48a3-87c6-acfa30f60dad@lunn.ch>

On Tue, Oct 28, 2025 at 01:07:34PM +0100, Andrew Lunn wrote:
> > > >  #define YT8521_CCR_RXC_DLY_EN			BIT(8)
> > > > -#define YT8521_CCR_RXC_DLY_1_900_NS		1900
> > > > +#define YT8521_CCR_RXC_DLY_1_900_PS		1900
> > >
> > > This could be down to interpretation.
> > >
> > > #define YT8521_CCR_RXC_DLY_1.900_NS		1900
> > >
> > > would be technically correct, but not valid for cpp(1). So the . is
> > > replaced with a _ .
> > >
> > > #define YT8521_CCR_RXC_DLY_1900_PS		1900
> > >
> > > would also be correct, but that is not what you have in your patch,
> > > you leave the _ in place.
> > 
> > Alright, I didn't realize that 1_950 represents 1.950;
> > I thought the underscores were used for code neatness,
> > making numbers like 900 and 1050 the same length, for example:
> > #define YT8521_RC1R_RGMII_0_900_PS
> > #define YT8521_RC1R_RGMII_1_050_PS
> > 
> > In that case, is my patch still necessary?
> 
> I think it is unnecessary.
> 
> If you want, you could add a comment which explains that the _ should
> be read as a .  However, this does appear elsewhere in Linux, it is
> one of those things you learn with time.

Hang on.

Is the "1900" 1.9ns or 1.9ps ?

If YT8521_CCR_RXC_DLY_1_900_NS means 1.9ns, and the value is in ps,
then surely if it's being renamed to _PS, then it _must_ become
YT8521_CCR_RXC_DLY_1900_NS, because 1.900ps is wrong?

-- 
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!

  reply	other threads:[~2025-10-28 12:19 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-28  1:59 [PATCH] net: phy: motorcomm: Fix the issue in the code regarding the incorrect use of time units Yi Cong
2025-10-28  2:51 ` Andrew Lunn
2025-10-28  6:21   ` Yi Cong
2025-10-28 12:07     ` Andrew Lunn
2025-10-28 12:19       ` Russell King (Oracle) [this message]
2025-10-28 12:46         ` Yi Cong
  -- strict thread matches above, loose matches on Subject: below --
2025-10-28  1:53 Yi Cong

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=aQC01GDPr-WclcZS@shell.armlinux.org.uk \
    --to=linux@armlinux.org.uk \
    --cc=Frank.Sae@motor-comm.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=andrew@lunn.ch \
    --cc=cong.yi@linux.dev \
    --cc=davem@davemloft.net \
    --cc=hkallweit1@gmail.com \
    --cc=kuba@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=stable@vger.kernel.org \
    --cc=yicong@kylinos.cn \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.