Skip to contentSkip to conversation

drm/rockchip: use DIV_ROUND_UP macro for calculations.

PATCH Applied Wambui Karuga 2 participants 2 messages Jan 9, 2020 – Jan 13, 2020

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/rockchip: use DIV_ROUND_UP macro for calculations.

Replace the open coded calculation with the more concise and readable DIV_ROUND_UP macro.

---
 drivers/gpu/drm/rockchip/rockchip_drm_vop.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/rockchip/rockchip_drm_vop.h +1 -1
index 0b3d18c457b2..cc672620d6e0 100644
@@ -328,7 +328,7 @@ static inline uint16_t scl_get_bili_dn_vskip(int src_h, int dst_h,
 {
 	int act_height;
 
-	act_height = (src_h + vskiplines - 1) / vskiplines;
+	act_height = DIV_ROUND_UP(src_h, vskiplines);
 
 	if (act_height == dst_h)
 		return GET_SCL_FT_BILI_DN(src_h, dst_h) / vskiplines;
Signature · 1 line
2.17.1
maintainer Applied
#1 lore raw

Am Donnerstag, 9. Januar 2020, 15:20:57 CET schrieb Wambui Karuga:

Quoted 4 lines

Replace the open coded calculation with the more concise and readable DIV_ROUND_UP macro.

applied to drm-misc-next

Thanks
Heiko