Skip to contentSkip to conversation

dmaengine: ti: omap-dma: Remove 'Assignment in if condition'

PATCH Applied Peter Ujfalusi 2 participants 2 messages Jul 30, 2019 – Sep 4, 2019

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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.

---
 drivers/dma/ti/omap-dma.c | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)
drivers/dma/ti/omap-dma.c +7 -4
index a4a63425dc0b..3b57b68df896 100644
@@ -814,7 +814,6 @@ static enum dma_status omap_dma_tx_status(struct dma_chan *chan,
 	dma_cookie_t cookie, struct dma_tx_state *txstate)
 {
 	struct omap_chan *c = to_omap_dma_chan(chan);
-	struct virt_dma_desc *vd;
 	enum dma_status ret;
 	unsigned long flags;
 	struct omap_desc *d = NULL;
@@ -841,10 +840,14 @@ static enum dma_status omap_dma_tx_status(struct dma_chan *chan,
 			pos = 0;
 
 		txstate->residue = omap_dma_desc_size_pos(d, pos);
-	} else if ((vd = vchan_find_desc(&c->vc, cookie))) {
-		txstate->residue = omap_dma_desc_size(to_omap_dma_desc(&vd->tx));
 	} else {
-		txstate->residue = 0;
+		struct virt_dma_desc *vd = vchan_find_desc(&c->vc, cookie);
+
+		if (vd)
+			txstate->residue = omap_dma_desc_size(
+						to_omap_dma_desc(&vd->tx));
+		else
+			txstate->residue = 0;
 	}
 
 out:
Signature · 4 lines
Peter

Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki.
Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki
maintainer Applied
#1 lore raw
Quoted 2 lines · Peter Ujfalusi

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

Applied, thanks

Signature · 1 line
~Vinod