Re: [PATCH v3 2/2] iio: frequency: ad9832: simplify bitwise math
From: Dan Carpenter
Date: Tue Apr 14 2026 - 09:02:49 EST
On Tue, Apr 14, 2026 at 03:33:52PM +0300, Andy Shevchenko wrote:
> On Tue, Apr 14, 2026 at 12:45:31PM +0200, Joshua Crofts wrote:
> > On Tue, 14 Apr 2026 at 11:57, Andy Shevchenko
> > <andriy.shevchenko@xxxxxxxxx> wrote:
> > > 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!)
>
> > If I'm not mistaken, the compiler would always do a type promotion of the
> > "smaller" operand (in this case fout). By casting at this point we're just doing
> > the work for it, so I guess it doesn't matter.
>
> Yes, and the problem here that BIT_ULL() is (semi)hidden on what it returns for
> smaller values.
There is no way we'd implement a BIT_ULL() that doesn't give you a ULL.
regards,
dan carpenter