RE: [PATCH] staging: iio: ad5933: Use div64_ul instead of do_div

Sa, Nuno
2022-10-28T11:55:27Z

> -----Original Message-----
> From: Deepak R Varma <drv@mailo.com>
> Sent: Thursday, October 27, 2022 11:29 PM
> To: outreachy@lists.linux.dev; Lars-Peter Clausen <lars@metafoo.de>;
> Hennerich, Michael <Michael.Hennerich@analog.com>; Jonathan Cameron
> <jic23@kernel.org>; Greg Kroah-Hartman <gregkh@linuxfoundation.org>;
> linux-iio@vger.kernel.org; linux-staging@lists.linux.dev; linux-
> kernel@vger.kernel.org
> Subject: [PATCH] staging: iio: ad5933: Use div64_ul instead of do_div
>
> [External]
>
> do_div() does a 64-by-32 division. Here the divisor is an unsigned long
> which on some platforms is 64 bit wide. So use div64_ul instead of do_div
> to avoid a possible truncation. Issue was identified using the
> coccicheck tool.
>
> Signed-off-by: Deepak R Varma <drv@mailo.com>
> ---

Reviewed-by: Nuno Sá <nuno.sa@analog.com>