All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] engine: mv_xor: remove redundant null check on cd
@ 2017-03-01 14:07 ` Colin King
  0 siblings, 0 replies; 4+ messages in thread
From: Colin King @ 2017-03-01 14:07 UTC (permalink / raw)
  To: Vinod Koul, Dan Williams, dmaengine; +Cc: kernel-janitors, linux-kernel

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

The check to see if cd is null is redundant, pdata->channels is
never null at this point, and hence &pdata->channels[i] cannot
be null, so remove the null check.

Detected by CoverityScan, CID#1357194 ("Logically Dead Code")

Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 drivers/dma/mv_xor.c | 5 -----
 1 file changed, 5 deletions(-)

diff --git a/drivers/dma/mv_xor.c b/drivers/dma/mv_xor.c
index 0cb951b..ea53b87 100644
--- a/drivers/dma/mv_xor.c
+++ b/drivers/dma/mv_xor.c
@@ -1580,11 +1580,6 @@ static int mv_xor_probe(struct platform_device *pdev)
 			int irq;
 
 			cd = &pdata->channels[i];
-			if (!cd) {
-				ret = -ENODEV;
-				goto err_channel_add;
-			}
-
 			irq = platform_get_irq(pdev, i);
 			if (irq < 0) {
 				ret = irq;
-- 
2.10.2

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

* [PATCH] engine: mv_xor: remove redundant null check on cd
@ 2017-03-01 14:07 ` Colin King
  0 siblings, 0 replies; 4+ messages in thread
From: Colin King @ 2017-03-01 14:07 UTC (permalink / raw)
  To: Vinod Koul, Dan Williams, dmaengine; +Cc: kernel-janitors, linux-kernel

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

The check to see if cd is null is redundant, pdata->channels is
never null at this point, and hence &pdata->channels[i] cannot
be null, so remove the null check.

Detected by CoverityScan, CID#1357194 ("Logically Dead Code")

Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 drivers/dma/mv_xor.c | 5 -----
 1 file changed, 5 deletions(-)

diff --git a/drivers/dma/mv_xor.c b/drivers/dma/mv_xor.c
index 0cb951b..ea53b87 100644
--- a/drivers/dma/mv_xor.c
+++ b/drivers/dma/mv_xor.c
@@ -1580,11 +1580,6 @@ static int mv_xor_probe(struct platform_device *pdev)
 			int irq;
 
 			cd = &pdata->channels[i];
-			if (!cd) {
-				ret = -ENODEV;
-				goto err_channel_add;
-			}
-
 			irq = platform_get_irq(pdev, i);
 			if (irq < 0) {
 				ret = irq;
-- 
2.10.2


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

* Re: [PATCH] engine: mv_xor: remove redundant null check on cd
  2017-03-01 14:07 ` Colin King
@ 2017-03-14  2:42   ` Vinod Koul
  -1 siblings, 0 replies; 4+ messages in thread
From: Vinod Koul @ 2017-03-14  2:30 UTC (permalink / raw)
  To: Colin King; +Cc: Dan Williams, dmaengine, kernel-janitors, linux-kernel

On Wed, Mar 01, 2017 at 02:07:21PM +0000, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
> 
> The check to see if cd is null is redundant, pdata->channels is
> never null at this point, and hence &pdata->channels[i] cannot
> be null, so remove the null check.
> 
> Detected by CoverityScan, CID#1357194 ("Logically Dead Code")

Applied after fixing subsystem name

-- 
~Vinod

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

* Re: [PATCH] engine: mv_xor: remove redundant null check on cd
@ 2017-03-14  2:42   ` Vinod Koul
  0 siblings, 0 replies; 4+ messages in thread
From: Vinod Koul @ 2017-03-14  2:42 UTC (permalink / raw)
  To: Colin King; +Cc: Dan Williams, dmaengine, kernel-janitors, linux-kernel

On Wed, Mar 01, 2017 at 02:07:21PM +0000, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
> 
> The check to see if cd is null is redundant, pdata->channels is
> never null at this point, and hence &pdata->channels[i] cannot
> be null, so remove the null check.
> 
> Detected by CoverityScan, CID#1357194 ("Logically Dead Code")

Applied after fixing subsystem name

-- 
~Vinod

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

end of thread, other threads:[~2017-03-14  2:42 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-03-01 14:07 [PATCH] engine: mv_xor: remove redundant null check on cd Colin King
2017-03-01 14:07 ` Colin King
2017-03-14  2:30 ` Vinod Koul
2017-03-14  2:42   ` Vinod Koul

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.