lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <20251028124635.362957-1-cong.yi@linux.dev>
Date: Tue, 28 Oct 2025 20:46:35 +0800
From: Yi Cong <cong.yi@...ux.dev>
To: linux@...linux.org.uk
Cc: Frank.Sae@...or-comm.com,
	andrew@...n.ch,
	davem@...emloft.net,
	hkallweit1@...il.com,
	kuba@...nel.org,
	netdev@...r.kernel.org,
	stable@...r.kernel.org,
	yicong@...inos.cn
Subject: Re: [PATCH] net: phy: motorcomm: Fix the issue in the code regarding the incorrect use of time units

On Tue, 28 Oct 2025 12:19:32 +0000, "Russell King (Oracle)" <linux@...linux.org.uk> wrote:
>
> 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?

According to the information I obtained from the manufacturer,
the unit in the register is PS.
In the code, both 1900_PS and 1_900_NS are correct,as they both
represent 1900ps (=1.9ns).
Therefore, there is no need to change the existing 1_900_NS.


Regards,
    Yi Cong

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ