]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
media: ov02c10: Use div_u64 to divide a 64-bit number
authorSakari Ailus <sakari.ailus@linux.intel.com>
Fri, 9 May 2025 06:25:11 +0000 (09:25 +0300)
committerHans Verkuil <hverkuil@xs4all.nl>
Fri, 9 May 2025 09:55:09 +0000 (11:55 +0200)
The ov02c10 driver divides a 64-bit number but reply relies on division
operator to do that. Use div_u64() so this will compile everywhere.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Reviewed-by: Stanislaw Gruszka <stanislaw.gruszka@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
drivers/media/i2c/ov02c10.c

index 9e3d4a4e12cedca3fc1239625b8c0ce0b5fa5402..089a4fd9627cf6c13efa65c104caeac370b53bc0 100644 (file)
@@ -497,8 +497,8 @@ static int ov02c10_init_controls(struct ov02c10 *ov02c10)
                ov02c10->link_freq->flags |= V4L2_CTRL_FLAG_READ_ONLY;
 
        /* MIPI lanes are DDR -> use link-freq * 2 */
-       pixel_rate = link_freq_menu_items[ov02c10->link_freq_index] * 2 *
-                    ov02c10->mipi_lanes / OV02C10_RGB_DEPTH;
+       pixel_rate = div_u64(link_freq_menu_items[ov02c10->link_freq_index] *
+                            2 * ov02c10->mipi_lanes, OV02C10_RGB_DEPTH);
 
        ov02c10->pixel_rate = v4l2_ctrl_new_std(ctrl_hdlr, &ov02c10_ctrl_ops,
                                                V4L2_CID_PIXEL_RATE, 0,