From: Ville Syrjälä Date: Fri, 18 Nov 2016 19:52:39 +0000 (+0200) Subject: drm/radeon: Use DIV_ROUND_UP() X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=3a6176e7febb6a7b67fb15d99481795941b9e707;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git drm/radeon: Use DIV_ROUND_UP() Use DIV_ROUND_UP() instead of hand rolling it. Just a drive-by change. Cc: Alex Deucher Cc: "Christian König" Signed-off-by: Ville Syrjälä Reviewed-by: Alex Deucher Reviewed-by: Christian König Link: http://patchwork.freedesktop.org/patch/msgid/1479498793-31021-4-git-send-email-ville.syrjala@linux.intel.com --- diff --git a/drivers/gpu/drm/radeon/radeon_legacy_crtc.c b/drivers/gpu/drm/radeon/radeon_legacy_crtc.c index bb5346812de4..31c03e32a6b5 100644 --- a/drivers/gpu/drm/radeon/radeon_legacy_crtc.c +++ b/drivers/gpu/drm/radeon/radeon_legacy_crtc.c @@ -477,9 +477,8 @@ retry: crtc_offset_cntl = 0; pitch_pixels = target_fb->pitches[0] / (target_fb->bits_per_pixel / 8); - crtc_pitch = (((pitch_pixels * target_fb->bits_per_pixel) + - ((target_fb->bits_per_pixel * 8) - 1)) / - (target_fb->bits_per_pixel * 8)); + crtc_pitch = DIV_ROUND_UP(pitch_pixels * target_fb->bits_per_pixel, + target_fb->bits_per_pixel * 8); crtc_pitch |= crtc_pitch << 16; crtc_offset_cntl |= RADEON_CRTC_GUI_TRIG_OFFSET_LEFT_EN;