All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] dmaengine: fsl-edma: remove redundant assignment to pointer last_sg
@ 2022-06-14 18:47 Colin Ian King
  2022-07-01 16:39 ` Vinod Koul
  0 siblings, 1 reply; 2+ messages in thread
From: Colin Ian King @ 2022-06-14 18:47 UTC (permalink / raw)
  To: Vinod Koul, Nathan Chancellor, dmaengine; +Cc: kernel-janitors, linux-kernel

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]

Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
---
 drivers/dma/fsl-edma-common.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/drivers/dma/fsl-edma-common.c b/drivers/dma/fsl-edma-common.c
index 3ae05d1446a5..a06a1575a2a5 100644
--- a/drivers/dma/fsl-edma-common.c
+++ b/drivers/dma/fsl-edma-common.c
@@ -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;
-- 
2.35.3


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] dmaengine: fsl-edma: remove redundant assignment to pointer last_sg
  2022-06-14 18:47 [PATCH] dmaengine: fsl-edma: remove redundant assignment to pointer last_sg Colin Ian King
@ 2022-07-01 16:39 ` Vinod Koul
  0 siblings, 0 replies; 2+ messages in thread
From: Vinod Koul @ 2022-07-01 16:39 UTC (permalink / raw)
  To: Colin Ian King
  Cc: Nathan Chancellor, dmaengine, kernel-janitors, linux-kernel

On 14-06-22, 19:47, Colin Ian King wrote:
> 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

> 
> 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]
> 
> Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
> ---
>  drivers/dma/fsl-edma-common.c | 3 ---
>  1 file changed, 3 deletions(-)
> 
> diff --git a/drivers/dma/fsl-edma-common.c b/drivers/dma/fsl-edma-common.c
> index 3ae05d1446a5..a06a1575a2a5 100644
> --- a/drivers/dma/fsl-edma-common.c
> +++ b/drivers/dma/fsl-edma-common.c
> @@ -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;
> -- 
> 2.35.3

-- 
~Vinod

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-07-01 16:39 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-14 18:47 [PATCH] dmaengine: fsl-edma: remove redundant assignment to pointer last_sg Colin Ian King
2022-07-01 16:39 ` Vinod Koul

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.