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: Paul Cercueil <paul@crapouillou.net> Reviewed-by: Alexandru Ardelean <ardeleanalex@gmail.com> Link: https://lore.kernel.org/r/20211115141925.60164-4-paul@crapouillou.net Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
This commit is contained in:
parent
ed14e769f6
commit
ab1fb45579
@ -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,
|
||||
|
Loading…
Reference in New Issue
Block a user