dmaengine: ti: edma: Remove 'Assignment in if condition'

While the compiler does not have problem with how it is implemented,
checkpatch does give en ERROR for this arrangement.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Link: https://lore.kernel.org/r/20190730132006.2790-1-peter.ujfalusi@ti.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
This commit is contained in:
Peter Ujfalusi 2019-07-30 16:20:06 +03:00 committed by Vinod Koul
parent f5e84eae79
commit e3b9fef8dd
1 changed files with 10 additions and 5 deletions

View File

@ -1832,7 +1832,6 @@ static enum dma_status edma_tx_status(struct dma_chan *chan,
struct dma_tx_state *txstate) struct dma_tx_state *txstate)
{ {
struct edma_chan *echan = to_edma_chan(chan); struct edma_chan *echan = to_edma_chan(chan);
struct virt_dma_desc *vdesc;
struct dma_tx_state txstate_tmp; struct dma_tx_state txstate_tmp;
enum dma_status ret; enum dma_status ret;
unsigned long flags; unsigned long flags;
@ -1846,12 +1845,18 @@ static enum dma_status edma_tx_status(struct dma_chan *chan,
if (!txstate) if (!txstate)
txstate = &txstate_tmp; txstate = &txstate_tmp;
txstate->residue = 0;
spin_lock_irqsave(&echan->vchan.lock, flags); spin_lock_irqsave(&echan->vchan.lock, flags);
if (echan->edesc && echan->edesc->vdesc.tx.cookie == cookie) if (echan->edesc && echan->edesc->vdesc.tx.cookie == cookie) {
txstate->residue = edma_residue(echan->edesc); txstate->residue = edma_residue(echan->edesc);
else if ((vdesc = vchan_find_desc(&echan->vchan, cookie))) } else {
txstate->residue = to_edma_desc(&vdesc->tx)->residue; struct virt_dma_desc *vdesc = vchan_find_desc(&echan->vchan,
cookie);
if (vdesc)
txstate->residue = to_edma_desc(&vdesc->tx)->residue;
else
txstate->residue = 0;
}
/* /*
* Mark the cookie completed if the residue is 0 for non cyclic * Mark the cookie completed if the residue is 0 for non cyclic