Skip to content

Commit 8a88712

Browse files
CharlesWu465Mina-Chou
authored andcommitted
dmaengine: andes: atcdmac300: add the content of the follow-up changes for PR torvalds#156 (torvalds#176)
The content of PR torvalds#156 was already merged in a previous commit (de3c459c26). The follow-up changes [1] are added here. [1] https://gitea.andestech.com/RD-SW/linux/compare/01d1ae22c9ab20726915cab6c82d386d4d27062a..c94d7e80569465af5feb2cb652b7e8dad2a7679c Signed-off-by: charles <[email protected]> Reviewed-on: https://gitea.andestech.com/RD-SW/linux/pulls/176 Reviewed-by: CL Chin-Long Wang <[email protected]> Reviewed-by: randolph <[email protected]> Co-authored-by: charles <[email protected]> Co-committed-by: charles <[email protected]>
1 parent 76a3d97 commit 8a88712

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

drivers/dma/atcdmac300.c

100755100644
Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,13 @@
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

3738
static unsigned int init_nr_desc_per_channel = 64;
3839
module_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
}

drivers/dma/atcdmac300.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ enum v5_status {
237237
* .device_config
238238
* @lock: serializes enqueue/dequeue operations to descriptors lists
239239
* @chan_used: This variable shows that the DMA channel is in use and
240-
prevents new DMA operations on it.
240+
* prevents new DMA operations on it.
241241
* @active_list: list of descriptors dmaengine is being running on
242242
* @queue: list of descriptors ready to be submitted to engine
243243
* @free_list: list of descriptors usable by the channel

0 commit comments

Comments
 (0)