From: Nishka Dasgupta Date: Wed, 29 May 2019 13:11:53 +0000 (+0530) Subject: staging: kpc2000: Change to use DIV_ROUND_UP X-Git-Tag: v5.4-rc1~602^2~385 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=4a932d90b1541a0862be61371658b8f28b3b792e;p=platform%2Fkernel%2Flinux-rpi.git staging: kpc2000: Change to use DIV_ROUND_UP Use macro DIV_ROUND_UP instead of an equivalent sequence of operations. Signed-off-by: Nishka Dasgupta Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/kpc2000/kpc_dma/fileops.c b/drivers/staging/kpc2000/kpc_dma/fileops.c index 254fee5..7b17362 100644 --- a/drivers/staging/kpc2000/kpc_dma/fileops.c +++ b/drivers/staging/kpc2000/kpc_dma/fileops.c @@ -28,10 +28,7 @@ unsigned int count_pages(unsigned long iov_base, size_t iov_len) static inline unsigned int count_parts_for_sge(struct scatterlist *sg) { - unsigned int sg_length = sg_dma_len(sg); - - sg_length += (0x80000-1); - return (sg_length / 0x80000); + return DIV_ROUND_UP(sg_dma_len(sg), 0x80000); } /********** Transfer Helpers **********/