summaryrefslogtreecommitdiff
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
commit509855e1c436a508dec850ec0834dba5c4656ff4 (patch)
tree9668d2ce5747a651110857b7856f48055499c373
parent8afbda8b8264baac327e297aa4b94b4107531fd2 (diff)
downloadlinux-crypto-509855e1c436a508dec850ec0834dba5c4656ff4.tar.gz
linux-crypto-509855e1c436a508dec850ec0834dba5c4656ff4.zip
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 '')
-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 18cc82dc..8bd288d2 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 */