summaryrefslogtreecommitdiff
path: root/crypto
diff options
context:
space:
mode:
authorWu Bo <wubo40@huawei.com>2021-05-25 16:15:19 +0800
committerHerbert Xu <herbert@gondor.apana.org.au>2021-06-03 20:24:04 +0800
commit7551a074700a4093f5556a5ae51c1f83ea6b96ba (patch)
treefcfe55c52471518d35cb7cdce82605c314e0d9dc /crypto
parente9009fb227fa66a66cef02a36fb51c288f411e0d (diff)
crypto: af_alg - use DIV_ROUND_UP helper macro for calculations
Replace open coded divisor calculations with the DIV_ROUND_UP kernel macro for better readability. Signed-off-by: Wu Bo <wubo40@huawei.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'crypto')
-rw-r--r--crypto/af_alg.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/crypto/af_alg.c b/crypto/af_alg.c
index 18cc82dc4a42..8bd288d2b089 100644
--- a/crypto/af_alg.c
+++ b/crypto/af_alg.c
@@ -411,7 +411,7 @@ int af_alg_make_sg(struct af_alg_sgl *sgl, struct iov_iter *iter, int len)
if (n < 0)
return n;
- npages = (off + n + PAGE_SIZE - 1) >> PAGE_SHIFT;
+ npages = DIV_ROUND_UP(off + n, PAGE_SIZE);
if (WARN_ON(npages == 0))
return -EINVAL;
/* Add one extra for linking */