Skip to content

Commit d777313

Browse files
ribaldamchehab
authored andcommitted
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/[email protected] Signed-off-by: Ricardo Ribalda <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
1 parent 22dccf0 commit d777313

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

drivers/media/i2c/tc358746.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -844,8 +844,7 @@ static unsigned long tc358746_find_pll_settings(struct tc358746 *tc358746,
844844
continue;
845845

846846
tmp = fout * postdiv;
847-
do_div(tmp, fin);
848-
mul = tmp;
847+
mul = div64_ul(tmp, fin);
849848
if (mul > 511)
850849
continue;
851850

0 commit comments

Comments
 (0)