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

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.net


Signed-off-by: default avatarJonathan Cameron <Jonathan.Cameron@huawei.com>
parent ed14e769
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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,