From df899fded01193987803a4e80d7e6f4a26637f14 Mon Sep 17 00:00:00 2001 From: Joseph Burt Date: Wed, 10 Feb 2021 15:06:31 +0100 Subject: [PATCH] Use DIV_ROUND_UP() macro Replace some open coding with the new macro Signed-off-by: Joseph Burt --- src/ipc/ipc-host-ptable.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ipc/ipc-host-ptable.c b/src/ipc/ipc-host-ptable.c index b2bcc3fc1..9860326f6 100644 --- a/src/ipc/ipc-host-ptable.c +++ b/src/ipc/ipc-host-ptable.c @@ -116,7 +116,7 @@ static int ipc_get_page_descriptors(struct dma *dmac, uint8_t *page_table, tr_err(&ipc_tr, "ipc_get_page_descriptors(): dma_get_attribute() failed"); goto out; } - elem.size = (ring->pages * 20 + 7) / 8; + elem.size = DIV_ROUND_UP(ring->pages * 20, 8); elem.size = ALIGN_UP(elem.size, dma_copy_align); config.elem_array.elems = &elem; config.elem_array.count = 1;