Skip to contentSkip to conversation

dma: sh/shdma-base.c: remove unnecessary null pointer check

PATCH Applied Cong Ding 2 participants 2 messages Jan 15, 2013 – Jan 20, 2013 dmaengine

lore
Share & tools
lore

Cong Ding

author
#0 lore raw

PATCH 1/1 dma: sh/shdma-base.c: remove unnecessary null pointer check

the variable chan is dereferenced in line 635, so it is no reason to check null again in line 641.

---
 drivers/dma/sh/shdma-base.c |    3 ---
 1 file changed, 3 deletions(-)
drivers/dma/sh/shdma-base.c +0 -3
index f4cd946..4acb85a 100644
@@ -638,9 +638,6 @@ static int shdma_control(struct dma_chan *chan, enum dma_ctrl_cmd cmd,
 	unsigned long flags;
 	int ret;
 
-	if (!chan)
-		return -EINVAL;
-
 	switch (cmd) {
 	case DMA_TERMINATE_ALL:
 		spin_lock_irqsave(&schan->chan_lock, flags);
Signature · 1 line
1.7.10.4
Applied
#1 lore raw
Quoted 13 lines · Cong Ding

the variable chan is dereferenced in line 635, so it is no reason to check null again in line 641.

---
 drivers/dma/sh/shdma-base.c |    3 ---
 1 file changed, 3 deletions(-)
drivers/dma/sh/shdma-base.c +0 -0
index f4cd946..4acb85a 100644

drivers/dma/sh/shdma-base.c static int shdma_control(struct dma_chan *chan, enum dma_ctrl_cmd cmd, · line 643

Quoted 9 lines
drivers/dma/sh/shdma-base.c +0 -3
@@ -638,9 +638,6 @@ static int shdma_control(struct dma_chan *chan, enum dma_ctrl_cmd cmd,
 	unsigned long flags;
 	int ret;
 
-	if (!chan)
-		return -EINVAL;
-
 	switch (cmd) {
 	case DMA_TERMINATE_ALL:
 		spin_lock_irqsave(&schan->chan_lock, flags);

Applied, Thanks

--
~Vinod