Skip to contentSkip to conversation

dmaengine: fsl-edma: remove redundant assignment to pointer last_sg

PATCH Applied Colin Ian King 2 participants 2 messages Jun 14, 2022 – Jul 1, 2022

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 dmaengine: fsl-edma: remove redundant assignment to pointer last_sg

The pointer last_sg is being assigned a value at the start of a loop however it is never read and is being re-assigned later on in both brances of an if-statement. The assignment is redundant and can be removed.

Cleans up clang scan-build warning:
drivers/dma/fsl-edma-common.c:563:3: warning: Value stored to 'last_sg' is never read [deadcode.DeadStores]

---
 drivers/dma/fsl-edma-common.c | 3 ---
 1 file changed, 3 deletions(-)
drivers/dma/fsl-edma-common.c +0 -3
index 3ae05d1446a5..a06a1575a2a5 100644
@@ -559,9 +559,6 @@ struct dma_async_tx_descriptor *fsl_edma_prep_slave_sg(
 	}
 
 	for_each_sg(sgl, sg, sg_len, i) {
-		/* get next sg's physical address */
-		last_sg = fsl_desc->tcd[(i + 1) % sg_len].ptcd;
-
 		if (direction == DMA_MEM_TO_DEV) {
 			src_addr = sg_dma_address(sg);
 			dst_addr = fsl_chan->dma_dev_addr;
Signature · 1 line
2.35.3
maintainer Applied
#1 lore raw
Quoted 4 lines · Colin Ian King

The pointer last_sg is being assigned a value at the start of a loop however it is never read and is being re-assigned later on in both brances of an if-statement. The assignment is redundant and can be removed.

Applied, thanks

Quoted 26 lines

Cleans up clang scan-build warning:
drivers/dma/fsl-edma-common.c:563:3: warning: Value stored to 'last_sg' is never read [deadcode.DeadStores]

---
 drivers/dma/fsl-edma-common.c | 3 ---
 1 file changed, 3 deletions(-)
drivers/dma/fsl-edma-common.c +0 -3
index 3ae05d1446a5..a06a1575a2a5 100644
@@ -559,9 +559,6 @@ struct dma_async_tx_descriptor *fsl_edma_prep_slave_sg(
 	}
 
 	for_each_sg(sgl, sg, sg_len, i) {
-		/* get next sg's physical address */
-		last_sg = fsl_desc->tcd[(i + 1) % sg_len].ptcd;
-
 		if (direction == DMA_MEM_TO_DEV) {
 			src_addr = sg_dma_address(sg);
 			dst_addr = fsl_chan->dma_dev_addr;
Signature · 1 line
2.35.3
Signature · 1 line
~Vinod