]> git.baikalelectronics.ru Git - kernel.git/commit
drm: use DIV_ROUND_UP helper macro for calculations
authorWambui Karuga <wambui.karugax@gmail.com>
Fri, 25 Oct 2019 09:49:07 +0000 (12:49 +0300)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Mon, 4 Nov 2019 17:17:36 +0000 (18:17 +0100)
commitce8b84013969e8210cd17aed864fee19c6e7891c
treedeaa09614582890f97c8ee842c5ff3a9b808974f
parent1815171e3d63e52431ee629ee91961c9e82bae48
drm: use DIV_ROUND_UP helper macro for calculations

Replace open coded divisor calculations with the DIV_ROUND_UP kernel
macro for better readability.
Issue found using coccinelle:
@@
expression n,d;
@@
(
- ((n + d - 1) / d)
+ DIV_ROUND_UP(n,d)
|
- ((n + (d - 1)) / d)
+ DIV_ROUND_UP(n,d)
)

Signed-off-by: Wambui Karuga <wambui.karugax@gmail.com>
Acked-by: Julia Lawall <julia.lawall@lip6.fr>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: https://patchwork.freedesktop.org/patch/msgid/20191025094907.3582-1-wambui.karugax@gmail.com
drivers/gpu/drm/drm_agpsupport.c