All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stanislaw Gruszka <stanislaw.gruszka@linux.intel.com>
To: Sakari Ailus <sakari.ailus@linux.intel.com>
Cc: linux-media@vger.kernel.org, hans@jjverkuil.nl,
	Hans de Goede <hansg@kernel.org>,
	Bryan O'Donoghue <bod@kernel.org>
Subject: Re: [PATCH 1/1] media: ov02c10: Use div_u64 to divide a 64-bit number
Date: Fri, 9 May 2025 08:43:51 +0200	[thread overview]
Message-ID: <aB2kJ6rOoAac3M8Z@linux.intel.com> (raw)
In-Reply-To: <20250509062511.1092490-1-sakari.ailus@linux.intel.com>

On Fri, May 09, 2025 at 09:25:11AM +0300, Sakari Ailus wrote:
> 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>

> ---
>  drivers/media/i2c/ov02c10.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/media/i2c/ov02c10.c b/drivers/media/i2c/ov02c10.c
> index 9e3d4a4e12ce..089a4fd9627c 100644
> --- a/drivers/media/i2c/ov02c10.c
> +++ b/drivers/media/i2c/ov02c10.c
> @@ -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,
> -- 
> 2.39.5
> 
> 

  reply	other threads:[~2025-05-09  6:43 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-05-09  6:25 [PATCH 1/1] media: ov02c10: Use div_u64 to divide a 64-bit number Sakari Ailus
2025-05-09  6:43 ` Stanislaw Gruszka [this message]
2025-05-09  8:20 ` Hans de Goede

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=aB2kJ6rOoAac3M8Z@linux.intel.com \
    --to=stanislaw.gruszka@linux.intel.com \
    --cc=bod@kernel.org \
    --cc=hans@jjverkuil.nl \
    --cc=hansg@kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=sakari.ailus@linux.intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.