drm/radeon: Use DIV_ROUND_UP()
authorVille Syrjälä <[email protected]>
Fri, 18 Nov 2016 19:52:39 +0000 (21:52 +0200)
committerVille Syrjälä <[email protected]>
Wed, 14 Dec 2016 20:36:23 +0000 (22:36 +0200)
Use DIV_ROUND_UP() instead of hand rolling it. Just a drive-by change.

Cc: Alex Deucher <[email protected]>
Cc: "Christian König" <[email protected]>
Signed-off-by: Ville Syrjälä <[email protected]>
Reviewed-by: Alex Deucher <[email protected]>
Reviewed-by: Christian König <[email protected]>
Link: http://patchwork.freedesktop.org/patch/msgid/[email protected]
drivers/gpu/drm/radeon/radeon_legacy_crtc.c

index bb5346812de4e50098d1f084d2cff53795d62622..31c03e32a6b5c068620851f8c1171290faa3ff1f 100644 (file)
@@ -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;