mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Arnd Bergmann" <arnd@arndb.de>
To: "Jon Hunter" <jonathanh@nvidia.com>,
	"Arnd Bergmann" <arnd@kernel.org>,
	"Daniel Lezcano" <daniel.lezcano@linaro.org>,
	"Thomas Gleixner" <tglx@linutronix.de>,
	"Thierry Reding" <thierry.reding@gmail.com>,
	"Pohsun Su" <pohsuns@nvidia.com>,
	"Robert Lin" <robelin@nvidia.com>,
	"Guenter Roeck" <linux@roeck-us.net>
Cc: linux-kernel@vger.kernel.org, linux-tegra@vger.kernel.org
Subject: Re: [PATCH] clocksource: tegra186: avoid 64-bit division
Date: Tue, 24 Jun 2025 12:20:01 +0200	[thread overview]
Message-ID: <5a571236-7de0-42bc-bfb2-52a57e210852@app.fastmail.com> (raw)
In-Reply-To: <3099e624-4cfb-4582-94be-3c09a9fcba01@nvidia.com>

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

  reply	other threads:[~2025-06-24 10:20 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-20 11:19 Arnd Bergmann
2025-06-24 10:06 ` Jon Hunter
2025-06-24 10:20   ` Arnd Bergmann [this message]
2025-07-15 11:12 ` Daniel Lezcano
2025-07-23  7:17 ` [tip: timers/clocksource] clocksource/drivers/tegra186: Avoid " tip-bot2 for Arnd Bergmann
2025-07-25 10:31 ` tip-bot2 for Arnd Bergmann

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=5a571236-7de0-42bc-bfb2-52a57e210852@app.fastmail.com \
    --to=arnd@arndb.de \
    --cc=arnd@kernel.org \
    --cc=daniel.lezcano@linaro.org \
    --cc=jonathanh@nvidia.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tegra@vger.kernel.org \
    --cc=linux@roeck-us.net \
    --cc=pohsuns@nvidia.com \
    --cc=robelin@nvidia.com \
    --cc=tglx@linutronix.de \
    --cc=thierry.reding@gmail.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®