Skip to contentSkip to conversation

dmaengine: xilinx: xdma: remove redundant check on ret

PATCH Applied Colin Ian King 2 participants 2 messages Nov 7, 2024 – Dec 2, 2024

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

PATCH 1/1 dmaengine: xilinx: xdma: remove redundant check on ret

The variable ret is being checked for an error and returning ret and the following statement returns ret too. The if check is redundant, and remove it. Just return the value returned from the call to regmap_write.

---
 drivers/dma/xilinx/xdma.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)
drivers/dma/xilinx/xdma.c +2 -6
index 93772abc3b49..0d88b1a670e1 100644
@@ -390,15 +390,11 @@ static int xdma_xfer_start(struct xdma_chan *xchan)
  */
 static int xdma_xfer_stop(struct xdma_chan *xchan)
 {
-	int ret;
 	struct xdma_device *xdev = xchan->xdev_hdl;
 
 	/* clear run stop bit to prevent any further auto-triggering */
-	ret = regmap_write(xdev->rmap, xchan->base + XDMA_CHAN_CONTROL_W1C,
-			   CHAN_CTRL_RUN_STOP);
-	if (ret)
-		return ret;
-	return ret;
+	return regmap_write(xdev->rmap, xchan->base + XDMA_CHAN_CONTROL_W1C,
+			    CHAN_CTRL_RUN_STOP);
 }
 
 /**
Signature · 1 line
2.39.5
maintainer Applied
#1 lore raw
Quoted 6 lines · Colin Ian King

The variable ret is being checked for an error and returning ret and the following statement returns ret too. The if check is redundant, and remove it. Just return the value returned from the call to regmap_write.

Applied, thanks!

[1/1] dmaengine: xilinx: xdma: remove redundant check on ret

      commit: 0f31c0912286f84b34b15e39b286db8f4765ced8

Best regards,

Signature · 1 line
~Vinod