* [PATCH] staging: kpc2000: Change to use DIV_ROUND_UP
@ 2019-05-29 13:11 Nishka Dasgupta
0 siblings, 0 replies; only message in thread
From: Nishka Dasgupta @ 2019-05-29 13:11 UTC (permalink / raw)
To: gregkh, bnvandana, madhumithabiw, matt.sickler, devel, linux-kernel
Cc: Nishka Dasgupta
Use macro DIV_ROUND_UP instead of an equivalent sequence of operations.
Signed-off-by: Nishka Dasgupta <nishkadg.linux@gmail.com>
---
drivers/staging/kpc2000/kpc_dma/fileops.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/drivers/staging/kpc2000/kpc_dma/fileops.c b/drivers/staging/kpc2000/kpc_dma/fileops.c
index 254fee593399..7b17362461b8 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 **********/
--
2.19.1
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2019-05-29 13:12 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-05-29 13:11 [PATCH] staging: kpc2000: Change to use DIV_ROUND_UP Nishka Dasgupta
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).