summaryrefslogtreecommitdiffstats
path: root/net/rds/message.c
diff options
context:
space:
mode:
authorJacob Wen <jian.w.wen@oracle.com>2019-01-07 09:59:59 +0800
committerDavid S. Miller <davem@davemloft.net>2019-01-07 07:22:36 -0800
commiteeb2c4fb6a3d0ebed35fbc13a255f691c8b8d7e5 (patch)
treea6a3fd94a38cd29cddb7b6ce6cf3f90fbf45f3ba /net/rds/message.c
parent10262b0b53666cbc506989b17a3ead1e9c3b43b4 (diff)
downloadlinux-eeb2c4fb6a3d0ebed35fbc13a255f691c8b8d7e5.tar.gz
linux-eeb2c4fb6a3d0ebed35fbc13a255f691c8b8d7e5.tar.bz2
linux-eeb2c4fb6a3d0ebed35fbc13a255f691c8b8d7e5.zip
rds: use DIV_ROUND_UP instead of ceil
Yes indeed, DIV_ROUND_UP is in kernel.h. Signed-off-by: Jacob Wen <jian.w.wen@oracle.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/rds/message.c')
-rw-r--r--net/rds/message.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/net/rds/message.c b/net/rds/message.c
index f139420ba1f6..50f13f1d4ae0 100644
--- a/net/rds/message.c
+++ b/net/rds/message.c
@@ -341,7 +341,7 @@ struct rds_message *rds_message_map_pages(unsigned long *page_addrs, unsigned in
{
struct rds_message *rm;
unsigned int i;
- int num_sgs = ceil(total_len, PAGE_SIZE);
+ int num_sgs = DIV_ROUND_UP(total_len, PAGE_SIZE);
int extra_bytes = num_sgs * sizeof(struct scatterlist);
int ret;
@@ -351,7 +351,7 @@ struct rds_message *rds_message_map_pages(unsigned long *page_addrs, unsigned in
set_bit(RDS_MSG_PAGEVEC, &rm->m_flags);
rm->m_inc.i_hdr.h_len = cpu_to_be32(total_len);
- rm->data.op_nents = ceil(total_len, PAGE_SIZE);
+ rm->data.op_nents = DIV_ROUND_UP(total_len, PAGE_SIZE);
rm->data.op_sg = rds_message_alloc_sgs(rm, num_sgs, &ret);
if (!rm->data.op_sg) {
rds_message_put(rm);