mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Arnav Kapoor <kapoorarnav43@gmail.com>
To: andriy.shevchenko@intel.com
Cc: jbhayana@google.com, jic23@kernel.org, dlechner@baylibre.com,
	nuno.sa@analog.com, andy@kernel.org, geert@linux-m68k.org,
	linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org,
	lkp@intel.com
Subject: Re: [PATCH] iio: common: scmi_sensors: fix truncating 64-bit divisions
Date: Sun,  4 Oct 2026 16:13:31 +0530	[thread overview]
Message-ID: <20261004104334.82610-1-kapoorarnav43@gmail.com> (raw)
In-Reply-To: <asFW-3IPAgFIDViV@ashevche-desk.local>

On Sat, Oct 03, 2026, Andy Shevchenko wrote:
> On Sat, Oct 03, 2026 at 11:25:55AM +0530, Arnav Kapoor wrote:
> > Assisted-by: Claude:claude-opus-5-5 coccinelle
>
> Assisted-by: LLM coccinelle

Right, I missed that the documented format had changed. Fixed in v2.

> > +			time_ns = div64_u64(time,
> > +					    int_pow(10, abs(tstamp_scale)));
>
> It's fine to have 82 character single line in this case.

Will do.

> > +	*hz = div64_u64_rem(NSEC_PER_SEC, interval_ns, &rem);
>
> I would expect to see this be a frequency unit to help with left side of the
> equation
>
> 	*hz = div64_u64_rem(HZ_PER_GHZ, interval_ns, &rem);
>
> > +	*uhz = div64_u64(rem * 1000000UL, interval_ns);
>
> And MICROHZ_PER_HZ here respectively.

Makes sense, I'll use both in v2.

Thanks for the review!

Arnav

      reply	other threads:[~2026-10-04 10:43 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-03  5:55 Arnav Kapoor
2026-10-03 19:26 ` Andy Shevchenko
2026-10-04 10:43   ` Arnav Kapoor [this message]

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=20261004104334.82610-1-kapoorarnav43@gmail.com \
    --to=kapoorarnav43@gmail.com \
    --cc=andriy.shevchenko@intel.com \
    --cc=andy@kernel.org \
    --cc=dlechner@baylibre.com \
    --cc=geert@linux-m68k.org \
    --cc=jbhayana@google.com \
    --cc=jic23@kernel.org \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lkp@intel.com \
    --cc=nuno.sa@analog.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®