Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1643365 > unrolled thread

[PATCH] dmaengine: remove redundant null check on req

Started byColin King <colin.king@canonical.com>
First post2017-05-17 15:40 +0200
Last post2017-05-19 05:30 +0200
Articles 3 — 3 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] dmaengine: remove redundant null check on req Colin King <colin.king@canonical.com> - 2017-05-17 15:40 +0200
    Re: [PATCH] dmaengine: remove redundant null check on req Dan Williams <dan.j.williams@intel.com> - 2017-05-17 21:20 +0200
      Re: [PATCH] dmaengine: remove redundant null check on req Vinod Koul <vinod.koul@intel.com> - 2017-05-19 05:30 +0200

#1643365 — [PATCH] dmaengine: remove redundant null check on req

FromColin King <colin.king@canonical.com>
Date2017-05-17 15:40 +0200
Subject[PATCH] dmaengine: remove redundant null check on req
Message-ID<tI7lf-3Em-9@gated-at.bofh.it>
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

[toc] | [next] | [standalone]


#1643587

FromDan Williams <dan.j.williams@intel.com>
Date2017-05-17 21:20 +0200
Message-ID<tIcEi-79q-17@gated-at.bofh.it>
In reply to#1643365
On Wed, May 17, 2017 at 6:35 AM, Colin King <colin.king@canonical.com> 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")
>
> Signed-off-by: Colin Ian King <colin.king@canonical.com>

Hi Colin,

Looks good, can you also include the driver name in your patch subjects?

For example "dmaengine, bcm-scm-raid: remove redundant null check on
req", would make it clear that this is a driver fix and not a core
dmaengine issue.

[toc] | [prev] | [next] | [standalone]


#1645165

FromVinod Koul <vinod.koul@intel.com>
Date2017-05-19 05:30 +0200
Message-ID<tIGM1-4u0-17@gated-at.bofh.it>
In reply to#1643587
On Wed, May 17, 2017 at 12:12:00PM -0700, Dan Williams wrote:
> On Wed, May 17, 2017 at 6:35 AM, Colin King <colin.king@canonical.com> 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")
> >
> > Signed-off-by: Colin Ian King <colin.king@canonical.com>
> 
> Hi Colin,
> 
> Looks good, can you also include the driver name in your patch subjects?
> 
> For example "dmaengine, bcm-scm-raid: remove redundant null check on
> req", would make it clear that this is a driver fix and not a core
> dmaengine issue.

Yeah that would help, also do the same for static patch you sent on the
driver.
-- 
~Vinod

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web