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

dmaengine: ti: omap-dma: 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/20190730132015.2863-1-peter.ujfalusi@ti.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>

authored by

Peter Ujfalusi and committed by
Vinod Koul
7a09c09c e3b9fef8

+7 -4
+7 -4
drivers/dma/ti/omap-dma.c
··· 814 814 dma_cookie_t cookie, struct dma_tx_state *txstate) 815 815 { 816 816 struct omap_chan *c = to_omap_dma_chan(chan); 817 - struct virt_dma_desc *vd; 818 817 enum dma_status ret; 819 818 unsigned long flags; 820 819 struct omap_desc *d = NULL; ··· 840 841 pos = 0; 841 842 842 843 txstate->residue = omap_dma_desc_size_pos(d, pos); 843 - } else if ((vd = vchan_find_desc(&c->vc, cookie))) { 844 - txstate->residue = omap_dma_desc_size(to_omap_dma_desc(&vd->tx)); 845 844 } else { 846 - txstate->residue = 0; 845 + struct virt_dma_desc *vd = vchan_find_desc(&c->vc, cookie); 846 + 847 + if (vd) 848 + txstate->residue = omap_dma_desc_size( 849 + to_omap_dma_desc(&vd->tx)); 850 + else 851 + txstate->residue = 0; 847 852 } 848 853 849 854 out: