kernel-janitors.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH][V2] dmaengine: bcm-scm-raid: remove redundant null check on req
@ 2017-05-17 21:58 Colin King
  2017-05-19  3:37 ` Vinod Koul
  0 siblings, 1 reply; 2+ messages in thread
From: Colin King @ 2017-05-17 21:58 UTC (permalink / raw)
  To: Anup Patel, Dan Williams, Vinod Koul, dmaengine
  Cc: kernel-janitors, linux-kernel

From: Colin Ian King <colin.king@canonical.com>

Req is never null on at the point of the null check, so
remove this redundant check and just return &req->tx.

Detected by CoverityScan, CID#1436147 ("Logically dead code")

Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 drivers/dma/bcm-sba-raid.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/dma/bcm-sba-raid.c b/drivers/dma/bcm-sba-raid.c
index 7daa883eeded..8246c26eabe5 100644
--- a/drivers/dma/bcm-sba-raid.c
+++ b/drivers/dma/bcm-sba-raid.c
@@ -582,7 +582,7 @@ sba_prep_dma_interrupt(struct dma_chan *dchan, unsigned long flags)
 	req->tx.flags = flags;
 	req->tx.cookie = -EBUSY;
 
-	return (req) ? &req->tx : NULL;
+	return &req->tx;
 }
 
 static void sba_fillup_memcpy_msg(struct sba_request *req,
-- 
2.11.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH][V2] dmaengine: bcm-scm-raid: remove redundant null check on req
  2017-05-17 21:58 [PATCH][V2] dmaengine: bcm-scm-raid: remove redundant null check on req Colin King
@ 2017-05-19  3:37 ` Vinod Koul
  0 siblings, 0 replies; 2+ messages in thread
From: Vinod Koul @ 2017-05-19  3:37 UTC (permalink / raw)
  To: Colin King
  Cc: Anup Patel, Dan Williams, dmaengine, kernel-janitors,
	linux-kernel

On Wed, May 17, 2017 at 10:58:50PM +0100, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
> 
> Req is never null on at the point of the null check, so
> remove this redundant check and just return &req->tx.
> 
> Detected by CoverityScan, CID#1436147 ("Logically dead code")


Applied, thanks

-- 
~Vinod

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-05-19  3:37 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-05-17 21:58 [PATCH][V2] dmaengine: bcm-scm-raid: remove redundant null check on req Colin King
2017-05-19  3:37 ` Vinod Koul

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).