Re: [PATCH v3] staging: iio: frequency: ad9832/ad9834: add comment explaining do_div usage
From: Joshua Crofts
Date: Fri Aug 07 2026 - 03:37:00 EST
On Fri, 7 Aug 2026 11:33:48 +0530
Mohamad Raizudeen <raizudeen.kerneldev@xxxxxxxxx> wrote:
> diff --git a/drivers/staging/iio/frequency/ad9834.c b/drivers/staging/iio/frequency/ad9834.c
> index 33dfd723923c..85f39ceb3c4c 100644
> --- a/drivers/staging/iio/frequency/ad9834.c
> +++ b/drivers/staging/iio/frequency/ad9834.c
> @@ -103,6 +103,12 @@ static unsigned int ad9834_calc_freqreg(unsigned long mclk, unsigned long fout)
> {
> unsigned long long freqreg = (u64)fout * (u64)BIT(AD9834_FREQ_BITS);
>
> + /*
> + * mclk is an unsigned long, which triggers a Coccinelle false positive
> + * warning about using a do_div() for 64-by-32 division. However, mclk
> + * for this hardware will always fir within 32 bits, so do_div() is
You have a typo here, fir -> fit.
--
Kind regards,
Joshua Crofts