Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

iio: buffer-dma: Fix coding style complains

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

Signed-off-by: Nuno Sá <nuno.sa@analog.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>

authored by

Nuno Sá and committed by
Jonathan Cameron
0c1316b9 247a357a

+21 -19
+11 -13
drivers/iio/buffer/industrialio-buffer-dma.c
··· 169 169 return container_of(buf, struct iio_dma_buffer_queue, buffer); 170 170 } 171 171 172 - static struct iio_dma_buffer_block *iio_dma_buffer_alloc_block( 173 - struct iio_dma_buffer_queue *queue, size_t size, bool fileio) 172 + static struct iio_dma_buffer_block * 173 + iio_dma_buffer_alloc_block(struct iio_dma_buffer_queue *queue, size_t size, 174 + bool fileio) 174 175 { 175 176 struct iio_dma_buffer_block *block __free(kfree) = 176 177 kzalloc(sizeof(*block), GFP_KERNEL); ··· 255 254 * hand the blocks back to the queue. 256 255 */ 257 256 void iio_dma_buffer_block_list_abort(struct iio_dma_buffer_queue *queue, 258 - struct list_head *list) 257 + struct list_head *list) 259 258 { 260 259 struct iio_dma_buffer_block *block, *_block; 261 260 bool cookie; ··· 435 434 } 436 435 437 436 static void iio_dma_buffer_submit_block(struct iio_dma_buffer_queue *queue, 438 - struct iio_dma_buffer_block *block) 437 + struct iio_dma_buffer_block *block) 439 438 { 440 439 int ret; 441 440 ··· 479 478 * 480 479 * This will allocate the DMA buffers and start the DMA transfers. 481 480 */ 482 - int iio_dma_buffer_enable(struct iio_buffer *buffer, 483 - struct iio_dev *indio_dev) 481 + int iio_dma_buffer_enable(struct iio_buffer *buffer, struct iio_dev *indio_dev) 484 482 { 485 483 struct iio_dma_buffer_queue *queue = iio_buffer_to_queue(buffer); 486 484 struct iio_dma_buffer_block *block, *_block; ··· 503 503 * Needs to be called when the device that the buffer is attached to stops 504 504 * sampling. Typically should be the iio_buffer_access_ops disable callback. 505 505 */ 506 - int iio_dma_buffer_disable(struct iio_buffer *buffer, 507 - struct iio_dev *indio_dev) 506 + int iio_dma_buffer_disable(struct iio_buffer *buffer, struct iio_dev *indio_dev) 508 507 { 509 508 struct iio_dma_buffer_queue *queue = iio_buffer_to_queue(buffer); 510 509 ··· 518 519 EXPORT_SYMBOL_NS_GPL(iio_dma_buffer_disable, "IIO_DMA_BUFFER"); 519 520 520 521 static void iio_dma_buffer_enqueue(struct iio_dma_buffer_queue *queue, 521 - struct iio_dma_buffer_block *block) 522 + struct iio_dma_buffer_block *block) 522 523 { 523 524 if (block->state == IIO_BLOCK_STATE_DEAD) { 524 525 iio_buffer_block_put(block); ··· 530 531 } 531 532 } 532 533 533 - static struct iio_dma_buffer_block *iio_dma_buffer_dequeue( 534 - struct iio_dma_buffer_queue *queue) 534 + static struct iio_dma_buffer_block * 535 + iio_dma_buffer_dequeue(struct iio_dma_buffer_queue *queue) 535 536 { 536 537 struct iio_dma_buffer_block *block; 537 538 unsigned int idx; ··· 660 661 for (i = 0; i < ARRAY_SIZE(queue->fileio.blocks); i++) { 661 662 block = queue->fileio.blocks[i]; 662 663 663 - if (block != queue->fileio.active_block 664 - && block->state == IIO_BLOCK_STATE_DONE) 664 + if (block != queue->fileio.active_block && block->state == IIO_BLOCK_STATE_DONE) 665 665 data_available += block->size; 666 666 } 667 667
+10 -6
include/linux/iio/buffer-dma.h
··· 119 119 struct device *dev; 120 120 const struct iio_dma_buffer_ops *ops; 121 121 122 + /* 123 + * A mutex to protect accessing, configuring (eg: enqueuing DMA blocks) 124 + * and do file IO on struct iio_dma_buffer_queue objects. 125 + */ 122 126 struct mutex lock; 127 + /* A spin lock to protect adding/removing blocks to the queue list */ 123 128 spinlock_t list_lock; 124 129 struct list_head incoming; 125 130 ··· 141 136 */ 142 137 struct iio_dma_buffer_ops { 143 138 int (*submit)(struct iio_dma_buffer_queue *queue, 144 - struct iio_dma_buffer_block *block); 139 + struct iio_dma_buffer_block *block); 145 140 void (*abort)(struct iio_dma_buffer_queue *queue); 146 141 }; 147 142 148 143 void iio_dma_buffer_block_done(struct iio_dma_buffer_block *block); 149 144 void iio_dma_buffer_block_list_abort(struct iio_dma_buffer_queue *queue, 150 - struct list_head *list); 145 + struct list_head *list); 151 146 152 - int iio_dma_buffer_enable(struct iio_buffer *buffer, 153 - struct iio_dev *indio_dev); 147 + int iio_dma_buffer_enable(struct iio_buffer *buffer, struct iio_dev *indio_dev); 154 148 int iio_dma_buffer_disable(struct iio_buffer *buffer, 155 - struct iio_dev *indio_dev); 149 + struct iio_dev *indio_dev); 156 150 int iio_dma_buffer_read(struct iio_buffer *buffer, size_t n, 157 - char __user *user_buffer); 151 + char __user *user_buffer); 158 152 int iio_dma_buffer_write(struct iio_buffer *buffer, size_t n, 159 153 const char __user *user_buffer); 160 154 size_t iio_dma_buffer_usage(struct iio_buffer *buffer);