Commit f2fd4d9f authored by Colin Ian King's avatar Colin Ian King Committed by Vinod Koul

dmaengine: stm32: remove redundant initialization of hwdesc

hwdesc is being initialized to desc->hwdesc but this is never read
as hwdesc is overwritten in a for-loop.  Remove the redundant
initialization and move the declaration of hwdesc into the for-loop.

Cleans up clang warning:
Value stored to 'hwdesc' during its initialization is never read
Signed-off-by: default avatarColin Ian King <colin.king@canonical.com>
Acked-by: default avatarPierre-Yves MORDRET <pierre-yves.mordret@st.com>
Signed-off-by: default avatarVinod Koul <vinod.koul@intel.com>
parent ea62e2cc
...@@ -1252,13 +1252,13 @@ static size_t stm32_mdma_desc_residue(struct stm32_mdma_chan *chan, ...@@ -1252,13 +1252,13 @@ static size_t stm32_mdma_desc_residue(struct stm32_mdma_chan *chan,
u32 curr_hwdesc) u32 curr_hwdesc)
{ {
struct stm32_mdma_device *dmadev = stm32_mdma_get_dev(chan); struct stm32_mdma_device *dmadev = stm32_mdma_get_dev(chan);
struct stm32_mdma_hwdesc *hwdesc = desc->hwdesc;
u32 cbndtr, residue, modulo, burst_size; u32 cbndtr, residue, modulo, burst_size;
int i; int i;
residue = 0; residue = 0;
for (i = curr_hwdesc + 1; i < desc->count; i++) { for (i = curr_hwdesc + 1; i < desc->count; i++) {
hwdesc = &desc->hwdesc[i]; struct stm32_mdma_hwdesc *hwdesc = &desc->hwdesc[i];
residue += STM32_MDMA_CBNDTR_BNDT(hwdesc->cbndtr); residue += STM32_MDMA_CBNDTR_BNDT(hwdesc->cbndtr);
} }
cbndtr = stm32_mdma_read(dmadev, STM32_MDMA_CBNDTR(chan->id)); cbndtr = stm32_mdma_read(dmadev, STM32_MDMA_CBNDTR(chan->id));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment