2727 BIT(DMA_SLAVE_BUSWIDTH_2_BYTES) |\
2828 BIT(DMA_SLAVE_BUSWIDTH_4_BYTES))
2929
30- #define INIT_DESC (desc ) do { \
31- desc->at = NULL; \
32- desc->cyclic = false; \
33- desc->num_sg = 0; \
34- INIT_LIST_HEAD(&desc->tx_list); \
35- } while (0)
30+ #define INIT_DESC (desc ) \
31+ do { \
32+ desc->at = NULL; \
33+ desc->cyclic = false; \
34+ desc->num_sg = 0; \
35+ INIT_LIST_HEAD(&desc->tx_list); \
36+ } while (0)
3637
3738static unsigned int init_nr_desc_per_channel = 64 ;
3839module_param (init_nr_desc_per_channel , uint , 0644 );
@@ -144,8 +145,9 @@ static struct v5_desc *v5_desc_get(struct v5_dma_chan *v5chan)
144145/**
145146 * v5_desc_put_nolock - move a descriptor to the free list.
146147 *
147- * This function does not use a lock to protect the free linked list,
148- * so please remember to add a proper lock when calling the function.
148+ * This function does not use a lock to protect any linked lists in
149+ * 'struct v5_dma_chan', so please remember to add a proper lock when
150+ * calling the function.
149151 *
150152 * @v5chan: channel we work on
151153 * @desc: descriptor, at the head of a chain, to move to free list
@@ -164,13 +166,11 @@ static void v5_desc_put_nolock(struct v5_dma_chan *v5chan, struct v5_desc *desc)
164166 INIT_DESC (desc );
165167 list_add_tail (& desc -> desc_node , & v5chan -> free_list );
166168
167- index = 1 ;
168- while (index < num_sg ) {
169+ for (index = 1 ; index < num_sg ; index ++ ) {
169170 desc = list_entry (next_node , struct v5_desc , desc_node );
170171 next_node = desc -> desc_node .next ;
171172 INIT_DESC (desc );
172173 list_add_tail (& desc -> desc_node , & v5chan -> free_list );
173- index ++ ;
174174 }
175175 }
176176}
0 commit comments