Subject: Re: [PATCH net 2/2] net: stmmac: fix multiplication overflow when reading timestamp

From: Alexis Lothoré <[email-masked]>
Date: Tue, 22 Apr 2025 18:06:18 +0200

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