Re: [PATCH v1 2/4] iio: light: opt4001: Fix incompatible pointer type passed to div_u64_rem()

From: Nikhil Gautam

Date: Sun Jul 12 2026 - 23:31:56 EST




On 13-07-2026 06:13 am, Jonathan Cameron wrote:
On Mon, 13 Jul 2026 01:54:49 +0530
Nikhil Gautam <nikhilgtr@xxxxxxxxx> wrote:

div_u64_rem() takes a u32 * for the remainder but is passed val2,
which is an int *. Use a local u32 for the remainder and assign the
result to *val2.
State what affect (if any) that has.
There is no functional impact, int and u32 have the same size and
representation on all supported architectures, and the remainder is
always smaller than the divisor (10000000) so it fits in the positive
range of int.  I will state this in the commit message and add the tag in v2.
Signed-off-by: Nikhil Gautam <nikhilgtr@xxxxxxxxx>
Fix looks good, just add the tag for v2.
Sure, will add Fixes tags to every patch.
---
drivers/iio/light/opt4001.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
...
return IIO_VAL_INT_PLUS_NANO;
}

L
Thanks for the quick review.

Regards,
Nikhil