[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20250616-test-v7-5-b8c0f98494fa@chromium.org>
Date: Mon, 16 Jun 2025 15:29:18 +0000
From: Ricardo Ribalda <ribalda@...omium.org>
To: Vikash Garodia <quic_vgarodia@...cinc.com>,
Dikshita Agarwal <quic_dikshita@...cinc.com>,
Bryan O'Donoghue <bryan.odonoghue@...aro.org>,
Mauro Carvalho Chehab <mchehab@...nel.org>,
Stanimir Varbanov <stanimir.varbanov@...aro.org>,
Hans Verkuil <hans.verkuil@...co.com>
Cc: linux-media@...r.kernel.org, linux-arm-msm@...r.kernel.org,
linux-kernel@...r.kernel.org, Ricardo Ribalda <ribalda@...omium.org>
Subject: [PATCH v7 5/5] media: venus: vdec: Make the range of us_per_frame
explicit
Fps bigger than 0.000232829 fps, this fits in a 32 bit us_per_frame.
There is no need to do a 64 bit division here.
Also, the driver only works with whole fps.
Found by cocci:
drivers/media/platform/qcom/venus/vdec.c:488:1-7: WARNING: do_div() does a 64-by-32 division, please consider using div64_u64 instead.
Reviewed-by: Vikash Garodia <quic_vgarodia@...cinc.com>
Reviewed-by: Bryan O'Donoghue <bryan.odonoghue@...aro.org>
Tested-by: Bryan O'Donoghue <bryan.odonoghue@...aro.org> # qrb5615-rb5
Signed-off-by: Ricardo Ribalda <ribalda@...omium.org>
---
drivers/media/platform/qcom/venus/vdec.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/media/platform/qcom/venus/vdec.c b/drivers/media/platform/qcom/venus/vdec.c
index 7d6612234d18a49573dc502d48ee61a900b63194..6042eb1e8705196b754dffc16bdb714378bb4cd4 100644
--- a/drivers/media/platform/qcom/venus/vdec.c
+++ b/drivers/media/platform/qcom/venus/vdec.c
@@ -484,8 +484,7 @@ static int vdec_s_parm(struct file *file, void *fh, struct v4l2_streamparm *a)
do_div(us_per_frame, timeperframe->denominator);
us_per_frame = clamp(us_per_frame, 1, USEC_PER_SEC);
- fps = (u64)USEC_PER_SEC;
- do_div(fps, us_per_frame);
+ fps = USEC_PER_SEC / (u32)us_per_frame;
fps = min(VENUS_MAX_FPS, fps);
inst->fps = fps;
--
2.50.0.rc1.591.g9c95f17f64-goog
Powered by blists - more mailing lists