diff options
author | Markus Elfring <elfring@users.sourceforge.net> | 2016-09-17 15:40:05 +0200 |
---|---|---|
committer | Vinod Koul <vinod.koul@intel.com> | 2016-09-26 23:06:18 +0530 |
commit | 444fa14746c1c19384f91490ed4c19c67517949e (patch) | |
tree | 5d4cd6cf9da9f92657305be94ea9de39b1398aa3 /drivers/dma | |
parent | 78c6e1a5943b464c47e864ca1092287fa4aa219b (diff) | |
download | linux-444fa14746c1c19384f91490ed4c19c67517949e.tar.gz linux-444fa14746c1c19384f91490ed4c19c67517949e.tar.bz2 linux-444fa14746c1c19384f91490ed4c19c67517949e.zip |
ste_dma40: Move two assignments in d40_prep_sg()
Move assignments for two local variables so that their setting
will only be performed after corresponding data processing succeeded
by this function.
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Diffstat (limited to 'drivers/dma')
-rw-r--r-- | drivers/dma/ste_dma40.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/dma/ste_dma40.c b/drivers/dma/ste_dma40.c index d587fd3a98a4..43f4e25c5aa2 100644 --- a/drivers/dma/ste_dma40.c +++ b/drivers/dma/ste_dma40.c @@ -2238,8 +2238,8 @@ d40_prep_sg(struct dma_chan *dchan, struct scatterlist *sg_src, enum dma_transfer_direction direction, unsigned long dma_flags) { struct d40_chan *chan = container_of(dchan, struct d40_chan, chan); - dma_addr_t src_dev_addr = 0; - dma_addr_t dst_dev_addr = 0; + dma_addr_t src_dev_addr; + dma_addr_t dst_dev_addr; struct d40_desc *desc; unsigned long flags; int ret; @@ -2258,6 +2258,8 @@ d40_prep_sg(struct dma_chan *dchan, struct scatterlist *sg_src, if (sg_next(&sg_src[sg_len - 1]) == sg_src) desc->cyclic = true; + src_dev_addr = 0; + dst_dev_addr = 0; if (direction == DMA_DEV_TO_MEM) src_dev_addr = chan->runtime_addr; else if (direction == DMA_MEM_TO_DEV) |