aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging/kpc2000/kpc_dma/fileops.c
diff options
context:
space:
mode:
authorNishka Dasgupta <nishkadg.linux@gmail.com>2019-05-29 18:41:53 +0530
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-05-30 14:02:52 -0700
commit4a932d90b1541a0862be61371658b8f28b3b792e (patch)
tree79faf509ac7bfe14841298472a98c584a49c2b36 /drivers/staging/kpc2000/kpc_dma/fileops.c
parentstaging: kpc2000: fix typo in Kconfig (diff)
downloadlinux-dev-4a932d90b1541a0862be61371658b8f28b3b792e.tar.xz
linux-dev-4a932d90b1541a0862be61371658b8f28b3b792e.zip
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 <nishkadg.linux@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/kpc2000/kpc_dma/fileops.c')
-rw-r--r--drivers/staging/kpc2000/kpc_dma/fileops.c5
1 files changed, 1 insertions, 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 **********/