Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Peter Ujfalusi and committed by
Vinod Koul
e3b9fef8 f5e84eae

+10 -5
+10 -5
drivers/dma/ti/edma.c
··· 1832 1832 struct dma_tx_state *txstate) 1833 1833 { 1834 1834 struct edma_chan *echan = to_edma_chan(chan); 1835 - struct virt_dma_desc *vdesc; 1836 1835 struct dma_tx_state txstate_tmp; 1837 1836 enum dma_status ret; 1838 1837 unsigned long flags; ··· 1845 1846 if (!txstate) 1846 1847 txstate = &txstate_tmp; 1847 1848 1848 - txstate->residue = 0; 1849 1849 spin_lock_irqsave(&echan->vchan.lock, flags); 1850 - if (echan->edesc && echan->edesc->vdesc.tx.cookie == cookie) 1850 + if (echan->edesc && echan->edesc->vdesc.tx.cookie == cookie) { 1851 1851 txstate->residue = edma_residue(echan->edesc); 1852 - else if ((vdesc = vchan_find_desc(&echan->vchan, cookie))) 1853 - txstate->residue = to_edma_desc(&vdesc->tx)->residue; 1852 + } else { 1853 + struct virt_dma_desc *vdesc = vchan_find_desc(&echan->vchan, 1854 + cookie); 1855 + 1856 + if (vdesc) 1857 + txstate->residue = to_edma_desc(&vdesc->tx)->residue; 1858 + else 1859 + txstate->residue = 0; 1860 + } 1854 1861 1855 1862 /* 1856 1863 * Mark the cookie completed if the residue is 0 for non cyclic