staging: kpc2000: Change to use DIV_ROUND_UP
authorNishka Dasgupta <nishkadg.linux@gmail.com>
Wed, 29 May 2019 13:11:53 +0000 (18:41 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 30 May 2019 21:02:52 +0000 (14:02 -0700)
Use macro DIV_ROUND_UP instead of an equivalent sequence of operations.

Signed-off-by: Nishka Dasgupta <nishkadg.linux@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/kpc2000/kpc_dma/fileops.c

index 254fee59339989d05a51a0f308b8bff2820686a6..7b17362461b8214fb22b660f04c27298ee1e56b9 100644 (file)
@@ -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  **********/