Re: [PATCH v3 2/2] iio: frequency: ad9832: simplify bitwise math

Andy Shevchenko
2026-04-14T09:57:05Z

On Tue, Apr 14, 2026 at 11:51:03AM +0200, Joshua Crofts wrote:
> On Tue, 14 Apr 2026 at 11:44, Andy Shevchenko
> <andriy.shevchenko@intel.com> wrote:
> > It can even be just like this:
> >
> > u64 freqreg = fout * BIT_ULL(AD9832_FREQ_BITS);
> >
> > if I understand the integer promotion for unsigned types here
> > and the * operator correctly.
>
> Sure, at least I'll ensure that the reviewed-by tag is incorporated
> correctly.

It's up to you. (u64) casting here is not bad per se. And it's more robust
against changes in the second operand the type of which is hidden currently.
(Reading again what I just wrote, it seems I objecting my own suggestion!)

--
With Best Regards,
Andy Shevchenko