Skip to content

Commit a2ab704

Browse files
pcercueivinodkoul
authored andcommitted
dmaengine: axi-dmac: Small code cleanup
Use a for() loop instead of a while() loop in axi_dmac_fill_linear_sg(). This makes the code leaner and cleaner overall, and does not introduce any functional change. Signed-off-by: Paul Cercueil <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Vinod Koul <[email protected]>
1 parent 71e7d3c commit a2ab704

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

drivers/dma/dma-axi-dmac.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -508,16 +508,13 @@ static struct axi_dmac_sg *axi_dmac_fill_linear_sg(struct axi_dmac_chan *chan,
508508
segment_size = ((segment_size - 1) | chan->length_align_mask) + 1;
509509

510510
for (i = 0; i < num_periods; i++) {
511-
len = period_len;
512-
513-
while (len > segment_size) {
511+
for (len = period_len; len > segment_size; sg++) {
514512
if (direction == DMA_DEV_TO_MEM)
515513
sg->dest_addr = addr;
516514
else
517515
sg->src_addr = addr;
518516
sg->x_len = segment_size;
519517
sg->y_len = 1;
520-
sg++;
521518
addr += segment_size;
522519
len -= segment_size;
523520
}

0 commit comments

Comments
 (0)