public inbox for linux-staging@lists.linux.dev
 help / color / mirror / Atom feed
From: Andy Shevchenko <andriy.shevchenko@intel.com>
To: Jonathan Cameron <jic23@kernel.org>
Cc: Archit Anant <architanant5@gmail.com>,
	lars@metafoo.de, Michael.Hennerich@analog.com,
	gregkh@linuxfoundation.org, dlechner@baylibre.com,
	nuno.sa@analog.com, andy@kernel.org, linux-iio@vger.kernel.org,
	linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] staging: iio: impedance-analyzer: ad5933: use div64_ul() instead of do_div()
Date: Mon, 23 Feb 2026 10:37:11 +0200	[thread overview]
Message-ID: <aZwRt7ws7PeHyuPM@smile.fi.intel.com> (raw)
In-Reply-To: <20260222134326.7fc1f45a@jic23-huawei>

On Sun, Feb 22, 2026 at 01:43:26PM +0000, Jonathan Cameron wrote:
> On Wed, 18 Feb 2026 15:51:14 +0200
> Andy Shevchenko <andriy.shevchenko@intel.com> wrote:
> > On Wed, Feb 18, 2026 at 06:23:27PM +0530, Archit Anant wrote:
> > > Replace do_div() with div64_ul() since the remainder is not used.
> > > div64_ul() is the preferred API for 64-bit by 32-bit division when
> > > only the quotient is needed.
> > > 
> > > Also replace explicit casting and shifting with the BIT_ULL(27) macro
> > > for clarity.
> > > 
> > > Note: A mathematical simplification to `(freq * BIT_ULL(29)) / mclk` was
> > > suggested during review to improve precision. However, as confirmed by
> > > maintainers, the original driver's truncation via `(mclk / 4)` might
> > > be intentional or relied upon by userspace. Since hardware is not
> > > available for verification, this patch preserves the original logic
> > > to avoid regression risk in the absence of testing.
> > > 
> > > Issue identified by coccicheck using do_div.cocci.  
> > 
> > > Changes in v2:
> > > - Replaced explicit `(u64)(1 << 27)` with `BIT_ULL(27)` as suggested by Andy Shevchenko.
> > > - Kept original arithmetic logic `(mclk / 4)` to preserve behavior.  
> > 
> > The place for changelog (and comments)...
> > 
> > > Signed-off-by: Archit Anant <architanant5@gmail.com>
> > > ---  
> > 
> > ...is here.
> > 
> > But do not resend until maintainers explicitly ask for that.
> > 
> Tweaked commit message as Andy pointed out was needed.
> 
> Applied to the togreg branch of iio.git
> 
> Andy, if you want to give a tag I can role that in for now as need
> to rebase anyway on rc1.  This mail felt like an 'almost tag' ;)

I think you are talking about my Rb? Sure
Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>

-- 
With Best Regards,
Andy Shevchenko



  reply	other threads:[~2026-02-23  8:37 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-18 12:53 [PATCH v2] staging: iio: impedance-analyzer: ad5933: use div64_ul() instead of do_div() Archit Anant
2026-02-18 13:51 ` Andy Shevchenko
2026-02-22 13:43   ` Jonathan Cameron
2026-02-23  8:37     ` Andy Shevchenko [this message]
2026-02-23 20:44       ` Jonathan Cameron
2026-02-24  3:41         ` Archit Anant

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=aZwRt7ws7PeHyuPM@smile.fi.intel.com \
    --to=andriy.shevchenko@intel.com \
    --cc=Michael.Hennerich@analog.com \
    --cc=andy@kernel.org \
    --cc=architanant5@gmail.com \
    --cc=dlechner@baylibre.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=jic23@kernel.org \
    --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 \
    /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