diff options
author | Wan Jiabing <wanjiabing@vivo.com> | 2022-04-26 21:21:26 +0800 |
---|---|---|
committer | Dmitry Baryshkov <dmitry.baryshkov@linaro.org> | 2022-07-05 06:01:11 +0300 |
commit | 4400c3a1d48f7f7863ca65d24f99ad295b37726c (patch) | |
tree | d84f92c3a59567b690f35f76020b1bf647fb70ab /drivers/gpu/drm/msm | |
parent | cfebe3fd599634540960ec37e3a6c2eb8b5bed2f (diff) |
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: Wan Jiabing <wanjiabing@vivo.com>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Acked-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Patchwork: https://patchwork.freedesktop.org/patch/483499/
Link: https://lore.kernel.org/r/20220426132126.686447-1-wanjiabing@vivo.com
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Diffstat (limited to 'drivers/gpu/drm/msm')
-rw-r--r-- | drivers/gpu/drm/msm/msm_gpu_devfreq.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/gpu/drm/msm/msm_gpu_devfreq.c b/drivers/gpu/drm/msm/msm_gpu_devfreq.c index d2539ca78c29..c2ea978c8921 100644 --- a/drivers/gpu/drm/msm/msm_gpu_devfreq.c +++ b/drivers/gpu/drm/msm/msm_gpu_devfreq.c @@ -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; |