summaryrefslogtreecommitdiffstats
path: root/crypto
diff options
context:
space:
mode:
authorWu Bo <wubo40@huawei.com>2021-05-25 10:15:19 +0200
committerHerbert Xu <herbert@gondor.apana.org.au>2021-06-03 14:24:04 +0200
commit7551a074700a4093f5556a5ae51c1f83ea6b96ba (patch)
treefcfe55c52471518d35cb7cdce82605c314e0d9dc /crypto
parenthwrng: ks-sa - Use pm_runtime_resume_and_get() to replace open coding (diff)
downloadlinux-7551a074700a4093f5556a5ae51c1f83ea6b96ba.tar.xz
linux-7551a074700a4093f5556a5ae51c1f83ea6b96ba.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 '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 */