Skip to contentSkip to conversation

staging: kpc2000: Change to use DIV_ROUND_UP

PATCH New Nishka Dasgupta 1 participant 1 message May 29, 2019 Staging

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 staging: kpc2000: Change to use DIV_ROUND_UP

Use macro DIV_ROUND_UP instead of an equivalent sequence of operations.

---
 drivers/staging/kpc2000/kpc_dma/fileops.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
drivers/staging/kpc2000/kpc_dma/fileops.c +1 -4
index 254fee593399..7b17362461b8 100644
@@ -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  **********/
Signature · 1 line
2.19.1