Re: [PATCH] iio: frequency: ad983x: replace do_div() with div64_ul().
From: David Laight
Date: Fri Apr 10 2026 - 04:16:42 EST
On Fri, 10 Apr 2026 08:58:10 +0200
Joshua Crofts <joshua.crofts1@xxxxxxxxx> wrote:
> On Fri, 10 Apr 2026 at 06:30, Andy Shevchenko
> <andriy.shevchenko@xxxxxxxxx> wrote:
> > > The clk struct in linux/clk.h explicitly uses an unsigned long to represent
> > > the clock value, which is used in this driver. Using an unsigned long
> > > ensures platform independent usage without type mismatching.
> >
> > ...which effectively means the frequency most likely fits 32-bit. Otherwise
> > would it ever work on 32-bit platform? This is a mistake in CLK design.
>
> So we keep the do_div() macro and cast mclk to u32.
>
There is no need for a cast, just ignore coccineal.
David