lkml.org 
[lkml]   [2021]   [Nov]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 03/15] iio: buffer-dma: Use round_down() instead of rounddown()
    Date
    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>
    ---
    drivers/iio/buffer/industrialio-buffer-dmaengine.c | 2 +-
    1 file changed, 1 insertion(+), 1 deletion(-)

    diff --git a/drivers/iio/buffer/industrialio-buffer-dmaengine.c b/drivers/iio/buffer/industrialio-buffer-dmaengine.c
    index 1ac94c4e9792..f8ce26a24c57 100644
    --- a/drivers/iio/buffer/industrialio-buffer-dmaengine.c
    +++ b/drivers/iio/buffer/industrialio-buffer-dmaengine.c
    @@ -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,
    --
    2.33.0
    \
     
     \ /
      Last update: 2021-11-15 15:24    [W:4.025 / U:0.492 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site