Skip to content

Commit 22dccf0

Browse files
ribaldamchehab
authored andcommitted
media: i2c: st-mipid02: Use the correct div function
link_freq does not fit in 32 bits. Found by cocci: drivers/media/i2c/st-mipid02.c:329:1-7: WARNING: do_div() does a 64-by-32 division, please consider using div64_s64 instead. Link: https://lore.kernel.org/linux-media/[email protected] Reviewed-by: Benjamin Mugnier <[email protected]> Reviewed-by: Sakari Ailus <[email protected]> Signed-off-by: Ricardo Ribalda <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
1 parent 7d6a8e8 commit 22dccf0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/media/i2c/st-mipid02.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,7 @@ static int mipid02_configure_from_rx_speed(struct mipid02_dev *bridge,
326326
}
327327

328328
dev_dbg(&client->dev, "detect link_freq = %lld Hz", link_freq);
329-
do_div(ui_4, link_freq);
329+
ui_4 = div64_u64(ui_4, link_freq);
330330
bridge->r.clk_lane_reg1 |= ui_4 << 2;
331331

332332
return 0;

0 commit comments

Comments
 (0)