diff options
author | Ricardo Ribalda <ribalda@chromium.org> | 2024-04-29 18:05:01 +0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@kernel.org> | 2024-05-03 13:16:08 +0300 |
commit | d77731382f57b9c18664a13c7e197285060ebf93 (patch) | |
tree | 12caf3b8ddfee61e2216fab39a5541f368cb06a2 | |
parent | 22dccf029e4a67ad5aa62537c47ece9f24c8f970 (diff) | |
download | linux-d77731382f57b9c18664a13c7e197285060ebf93.tar.xz |
media: tc358746: Use the correct div_ function
fin does not fit in 32 bits in some arches.
Found by cocci:
drivers/media/i2c/tc358746.c:847:2-8: WARNING: do_div() does a 64-by-32 division, please consider using div64_ul instead.
Link: https://lore.kernel.org/linux-media/20240429-fix-cocci-v3-22-3c4865f5a4b0@chromium.org
Signed-off-by: Ricardo Ribalda <ribalda@chromium.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
-rw-r--r-- | drivers/media/i2c/tc358746.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/media/i2c/tc358746.c b/drivers/media/i2c/tc358746.c index d676adc4401b..edf79107adc5 100644 --- a/drivers/media/i2c/tc358746.c +++ b/drivers/media/i2c/tc358746.c @@ -844,8 +844,7 @@ static unsigned long tc358746_find_pll_settings(struct tc358746 *tc358746, continue; tmp = fout * postdiv; - do_div(tmp, fin); - mul = tmp; + mul = div64_ul(tmp, fin); if (mul > 511) continue; |