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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <5a571236-7de0-42bc-bfb2-52a57e210852@app.fastmail.com>
Date: Tue, 24 Jun 2025 12:20:01 +0200
From: "Arnd Bergmann" <arnd@...db.de>
To: "Jon Hunter" <jonathanh@...dia.com>, "Arnd Bergmann" <arnd@...nel.org>,
 "Daniel Lezcano" <daniel.lezcano@...aro.org>,
 "Thomas Gleixner" <tglx@...utronix.de>,
 "Thierry Reding" <thierry.reding@...il.com>,
 "Pohsun Su" <pohsuns@...dia.com>, "Robert Lin" <robelin@...dia.com>,
 "Guenter Roeck" <linux@...ck-us.net>
Cc: linux-kernel@...r.kernel.org, linux-tegra@...r.kernel.org
Subject: Re: [PATCH] clocksource: tegra186: avoid 64-bit division

On Tue, Jun 24, 2025, at 12:06, Jon Hunter wrote:
> On 20/06/2025 12:19, Arnd Bergmann wrote:

>> @@ -267,7 +267,7 @@ static unsigned int tegra186_wdt_get_timeleft(struct watchdog_device *wdd)
>>   	 * counter value to the time of the counter expirations that
>>   	 * remain.
>>   	 */
>> -	timeleft += (((u64)wdt->base.timeout * USEC_PER_SEC) / 5) * (4 - expiration);
>> +	timeleft += (u64)wdt->base.timeout * (USEC_PER_SEC / 5) * (4 - expiration);
>>   
>>   	/*
>>   	 * Convert the current counter value to seconds,
>
>
> Guenter has also posted a fix for this here [0].
>

Right, that one looks better than mine, as it avoids another
division entirely.

     Arnd

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ