Commit ab1fb455 authored by Paul Cercueil's avatar Paul Cercueil Committed by Jonathan Cameron

iio: buffer-dma: Use round_down() instead of rounddown()

We know that the buffer's alignment will always be a power of two;
therefore, we can use the faster round_down() macro.
Signed-off-by: default avatarPaul Cercueil <paul@crapouillou.net>
Reviewed-by: default avatarAlexandru Ardelean <ardeleanalex@gmail.com>
Link: https://lore.kernel.org/r/20211115141925.60164-4-paul@crapouillou.netSigned-off-by: default avatarJonathan Cameron <Jonathan.Cameron@huawei.com>
parent ed14e769
......@@ -67,7 +67,7 @@ static int iio_dmaengine_buffer_submit_block(struct iio_dma_buffer_queue *queue,
dma_cookie_t cookie;
block->bytes_used = min(block->size, dmaengine_buffer->max_size);
block->bytes_used = rounddown(block->bytes_used,
block->bytes_used = round_down(block->bytes_used,
dmaengine_buffer->align);
desc = dmaengine_prep_slave_single(dmaengine_buffer->chan,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment