[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20211207075002.4009-1-guozhengkui@vivo.com>
Date: Tue, 7 Dec 2021 15:50:02 +0800
From: Guo Zhengkui <guozhengkui@...o.com>
To: Vinod Koul <vkoul@...nel.org>,
dmaengine@...r.kernel.org (open list:DMA GENERIC OFFLOAD ENGINE
SUBSYSTEM), linux-kernel@...r.kernel.org (open list)
Cc: kernel@...o.com, Guo Zhengkui <guozhengkui@...o.com>
Subject: [PATCH] dmaengine: use IS_ERR_OR_NULL before PTR_ERR
fix following cocci warning:
./drivers/dma/dmaengine.c:825:5-12: ERROR: PTR_ERR applied after
initialization to constant on line 815.
Signed-off-by: Guo Zhengkui <guozhengkui@...o.com>
---
drivers/dma/dmaengine.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/dma/dmaengine.c b/drivers/dma/dmaengine.c
index 2cfa8458b51b..0e6ff875c34e 100644
--- a/drivers/dma/dmaengine.c
+++ b/drivers/dma/dmaengine.c
@@ -822,10 +822,10 @@ struct dma_chan *dma_request_chan(struct device *dev, const char *name)
if (has_acpi_companion(dev) && !chan)
chan = acpi_dma_request_slave_chan_by_name(dev, name);
- if (PTR_ERR(chan) == -EPROBE_DEFER)
- return chan;
-
- if (!IS_ERR_OR_NULL(chan))
+ if (IS_ERR_OR_NULL(chan)) {
+ if (PTR_ERR(chan) == -EPROBE_DEFER)
+ return chan;
+ } else
goto found;
/* Try to find the channel via the DMA filter map(s) */
--
2.20.1
Powered by blists - more mailing lists