Re: [PATCH v3] staging: iio: frequency: ad9832/ad9834: add comment explaining do_div usage

Joshua Crofts <[email protected]>
Newsgroups org.kernel.vger.linux-iio,dev.linux.lists.linux-staging,org.kernel.vger.linux-kernel
Message-ID <[email protected]>
On Fri,  7 Aug 2026 11:33:48 +0530
Mohamad Raizudeen <[email protected]> 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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.