diff options
author | Jacob Wen <jian.w.wen@oracle.com> | 2019-01-07 04:59:59 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2019-01-07 18:22:36 +0300 |
commit | eeb2c4fb6a3d0ebed35fbc13a255f691c8b8d7e5 (patch) | |
tree | a6a3fd94a38cd29cddb7b6ce6cf3f90fbf45f3ba /net/rds/message.c | |
parent | 10262b0b53666cbc506989b17a3ead1e9c3b43b4 (diff) | |
download | linux-eeb2c4fb6a3d0ebed35fbc13a255f691c8b8d7e5.tar.xz |
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.c | 4 |
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); |