Re: [PATCH 4/6] iio: buffer-dma: Fix coding style complains

Andy Shevchenko
2025-12-03T16:29:59Z

On Wed, Dec 03, 2025 at 03:11:39PM +0000, Nuno Sá via B4 Relay wrote:

> Just making sure checkpatch is happy. No functional change intended.

...

> -static struct iio_dma_buffer_block *iio_dma_buffer_alloc_block(
> - struct iio_dma_buffer_queue *queue, size_t size, bool fileio)
> +static struct iio_dma_buffer_block *iio_dma_buffer_alloc_block(struct iio_dma_buffer_queue *queue,
> + size_t size,
> + bool fileio)

What about 80 rule?

static struct iio_dma_buffer_block *
iio_dma_buffer_alloc_block(struct iio_dma_buffer_queue *queue, size_t size,
bool fileio)

(And personally I think that in 2025 we should grow up and forget about this
and move on to 100, but... not a maintainer here :-)

...

> -static struct iio_dma_buffer_block *iio_dma_buffer_dequeue(
> - struct iio_dma_buffer_queue *queue)
> +static struct iio_dma_buffer_block *iio_dma_buffer_dequeue(struct iio_dma_buffer_queue *queue)

Ditto.

static struct iio_dma_buffer_block *
iio_dma_buffer_dequeue(struct iio_dma_buffer_queue *queue)

...

> - if (block != queue->fileio.active_block
> - && block->state == IIO_BLOCK_STATE_DONE)
> + if (block != queue->fileio.active_block && block->state == IIO_BLOCK_STATE_DONE)

Ditto.

if (block != queue->fileio.active_block &&
block->state == IIO_BLOCK_STATE_DONE)

> data_available += block->size;
> }

...

> + /*
> + * mutex to protect accessing, configuring (eg: enqueuing DMA blocks)

A mutex

e.g.:

(this is Latin exempli gratia)

> + * and do file IO on struct iio_dma_buffer_queue objects.
> + */

...

> + /* spinlock to protect adding/removing blocks to the queue list */

A spin lock

--
With Best Regards,
Andy Shevchenko