Skip to contentSkip to conversation

dmaengine: stm32-mdma: Remove redundant initialization of pointer hwdesc

PATCH In review Colin Ian King 2 participants 2 messages Dec 4, 2021 – Dec 6, 2021

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

PATCH 1/1 dmaengine: stm32-mdma: Remove redundant initialization of pointer hwdesc

The pointer hwdesc is being initialized with a value that is never read, it is being updated later in a for-loop. The assignment is redundant and can be removed.

---
 drivers/dma/stm32-mdma.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/dma/stm32-mdma.c +1 -1
index d30a4a28d3bf..805a449ff301 100644
@@ -1279,7 +1279,7 @@ static size_t stm32_mdma_desc_residue(struct stm32_mdma_chan *chan,
 				      u32 curr_hwdesc)
 {
 	struct stm32_mdma_device *dmadev = stm32_mdma_get_dev(chan);
-	struct stm32_mdma_hwdesc *hwdesc = desc->node[0].hwdesc;
+	struct stm32_mdma_hwdesc *hwdesc;
 	u32 cbndtr, residue, modulo, burst_size;
 	int i;
 
Signature · 1 line
2.33.1
Reviewed-by on v1 1/1
#1 lore raw

Hi,

Quoted 5 lines · Colin Ian King

The pointer hwdesc is being initialized with a value that is never read, it is being updated later in a for-loop. The assignment is redundant and can be removed.

Quoted 18 lines
---
  drivers/dma/stm32-mdma.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/dma/stm32-mdma.c +1 -1
index d30a4a28d3bf..805a449ff301 100644
@@ -1279,7 +1279,7 @@ static size_t stm32_mdma_desc_residue(struct stm32_mdma_chan *chan,
  				      u32 curr_hwdesc)
  {
  	struct stm32_mdma_device *dmadev = stm32_mdma_get_dev(chan);
-	struct stm32_mdma_hwdesc *hwdesc = desc->node[0].hwdesc;
+	struct stm32_mdma_hwdesc *hwdesc;
  	u32 cbndtr, residue, modulo, burst_size;
  	int i;