Commit 4400c3a1 authored by Wan Jiabing's avatar Wan Jiabing Committed by Dmitry Baryshkov

drm/msm: Use div64_ul instead of do_div

Fix following coccicheck warning:
drivers/gpu/drm/msm/msm_gpu_devfreq.c:72:1-7: WARNING: do_div() does a 64-by-32 division, please consider using div64_ul instead.

Use div64_ul instead of do_div to avoid a possible truncation.
Signed-off-by: default avatarWan Jiabing <wanjiabing@vivo.com>
Reviewed-by: default avatarDmitry Baryshkov <dmitry.baryshkov@linaro.org>
Acked-by: default avatarTvrtko Ursulin <tvrtko.ursulin@intel.com>
Patchwork: https://patchwork.freedesktop.org/patch/483499/
Link: https://lore.kernel.org/r/20220426132126.686447-1-wanjiabing@vivo.comSigned-off-by: default avatarDmitry Baryshkov <dmitry.baryshkov@linaro.org>
parent cfebe3fd
......@@ -69,7 +69,7 @@ static void get_raw_dev_status(struct msm_gpu *gpu,
df->time = time;
busy_time *= USEC_PER_SEC;
do_div(busy_time, sample_rate);
busy_time = div64_ul(busy_time, sample_rate);
if (WARN_ON(busy_time > ~0LU))
busy_time = ~0LU;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment