[PATCH net 2/2] net: stmmac: fix multiplication overflow when reading timestamp
Alexis Lothoré
alexis.lothore at bootlin.com
Tue Apr 22 09:06:18 PDT 2025
Hello Russell,
On Tue Apr 22, 2025 at 5:32 PM CEST, Russell King (Oracle) wrote:
> On Tue, Apr 22, 2025 at 05:07:23PM +0200, Alexis Lothoré wrote:
>> ns = readl(ptpaddr + GMAC_PTP_ATNR);
>> - ns += readl(ptpaddr + GMAC_PTP_ATSR) * NSEC_PER_SEC;
>> + ns += (u64)(readl(ptpaddr + GMAC_PTP_ATSR)) * NSEC_PER_SEC;
>
> I'm not sure what the extra parens around readl() are actually trying to
> do. Please drop them if they're not useful.
They are indeed not specifically useful in this case, they will be dropped
in v2.
Thanks,
Alexis
--
Alexis Lothoré, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
More information about the linux-arm-kernel
mailing list