Linux IIO development
 help / color / mirror / Atom feed
From: Andy Shevchenko <andriy.shevchenko@intel.com>
To: Joshua Crofts <joshua.crofts1@gmail.com>
Cc: Mohamad Raizudeen <raizudeen.kerneldev@gmail.com>,
	lars@metafoo.de, Michael.Hennerich@analog.com, jic23@kernel.org,
	dlechner@baylibre.com, nuno.sa@analog.com, andy@kernel.org,
	gregkh@linuxfoundation.org, skhan@linuxfoundation.org,
	linux-iio@vger.kernel.org, linux-staging@lists.linux.dev,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] staging: iio: frequency: ad9832/ad9834: use div64_ul instead of do_div
Date: Tue, 30 Jun 2026 15:02:02 +0300	[thread overview]
Message-ID: <akOwOpTIBFmSvquX@ashevche-desk.local> (raw)
In-Reply-To: <20260630093931.00006eca@gmail.com>

On Tue, Jun 30, 2026 at 09:39:31AM +0200, Joshua Crofts wrote:
> On Tue, 30 Jun 2026 08:53:22 +0530
> Mohamad Raizudeen <raizudeen.kerneldev@gmail.com> wrote:

...

> >  {
> >  	unsigned long long freqreg = (u64)fout *
> >  				     (u64)((u64)1L << AD9832_FREQ_BITS);
> > -	do_div(freqreg, mclk);
> > -	return freqreg;
> > +	return div64_ul(freqreg, mclk);
> >  }
> 
> I've actually sent a patch for this previously, however the
> discussion ended with the fact that there really isn't a point in
> doing this, since mclk will always be a value that can fit
> into a 32-bit unsigned type, therefore truncation isn't possible.

Since we are getting more "fixes" in the area, perhaps it's a time to add
a comment in the code summarizing the mentioned discussion?

> See here:
> https://lore.kernel.org/all/20260409182755.499a419c@pumpkin/

-- 
With Best Regards,
Andy Shevchenko



  reply	other threads:[~2026-06-30 12:02 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-30  3:23 [PATCH] staging: iio: frequency: ad9832/ad9834: use div64_ul instead of do_div Mohamad Raizudeen
2026-06-30  7:39 ` Joshua Crofts
2026-06-30 12:02   ` Andy Shevchenko [this message]
2026-06-30 13:07     ` Joshua Crofts
2026-06-30 13:27       ` Dan Carpenter

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=akOwOpTIBFmSvquX@ashevche-desk.local \
    --to=andriy.shevchenko@intel.com \
    --cc=Michael.Hennerich@analog.com \
    --cc=andy@kernel.org \
    --cc=dlechner@baylibre.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=jic23@kernel.org \
    --cc=joshua.crofts1@gmail.com \
    --cc=lars@metafoo.de \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-staging@lists.linux.dev \
    --cc=nuno.sa@analog.com \
    --cc=raizudeen.kerneldev@gmail.com \
    --cc=skhan@linuxfoundation.org \
    /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