From: Christian Lütke-Stetzkamp Date: Wed, 21 Mar 2018 22:25:35 +0000 (+0100) Subject: staging: mt7621-dma: Remove assignment in if X-Git-Url: http://git.cdn.openwrt.org/?a=commitdiff_plain;h=c48f6ac12cb5233ce767fdff5d92be551f194d61;p=openwrt%2Fstaging%2Fblogic.git staging: mt7621-dma: Remove assignment in if Fixes checkpatch error: ASSIGN_IN_IF by adding an inner if in the else path, this also avoids calling vchan_find_desc when not needed. Signed-off-by: Christian Lütke-Stetzkamp Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/mt7621-dma/ralink-gdma.c b/drivers/staging/mt7621-dma/ralink-gdma.c index 9548ce4afb77..5646a09dd8c9 100644 --- a/drivers/staging/mt7621-dma/ralink-gdma.c +++ b/drivers/staging/mt7621-dma/ralink-gdma.c @@ -689,8 +689,11 @@ static enum dma_status gdma_dma_tx_status(struct dma_chan *c, ((chan->next_sg - 1) * desc->sg[0].len); else state->residue = desc->residue; - } else if ((vdesc = vchan_find_desc(&chan->vchan, cookie))) - state->residue = to_gdma_dma_desc(vdesc)->residue; + } else { + vdesc = vchan_find_desc(&chan->vchan, cookie); + if (vdesc) + state->residue = to_gdma_dma_desc(vdesc)->residue; + } spin_unlock_irqrestore(&chan->vchan.lock, flags); dev_dbg(c->device->dev, "tx residue %d bytes\n", state->residue);