public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] dma: remove unnecessary null pointer check in mmp_pdma.c
@ 2013-01-15  0:19 Cong Ding
  2013-01-20 13:55 ` Vinod Koul
  0 siblings, 1 reply; 2+ messages in thread
From: Cong Ding @ 2013-01-15  0:19 UTC (permalink / raw)
  To: Vinod Koul, Dan Williams, linux-kernel; +Cc: Cong Ding

the pointer cfg is dereferenced in line 594, so it's no reason to check null
again in line 620.

Signed-off-by: Cong Ding <dinggnu@gmail.com>
---
 drivers/dma/mmp_pdma.c |    6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/dma/mmp_pdma.c b/drivers/dma/mmp_pdma.c
index c6d98c0..81d7b89 100644
--- a/drivers/dma/mmp_pdma.c
+++ b/drivers/dma/mmp_pdma.c
@@ -617,10 +617,8 @@ static int mmp_pdma_control(struct dma_chan *dchan, enum dma_ctrl_cmd cmd,
 		else if (maxburst == 32)
 			chan->dcmd |= DCMD_BURST32;
 
-		if (cfg) {
-			chan->dir = cfg->direction;
-			chan->drcmr = cfg->slave_id;
-		}
+		chan->dir = cfg->direction;
+		chan->drcmr = cfg->slave_id;
 		chan->dev_addr = addr;
 		break;
 	default:
-- 
1.7.10.4


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

* Re: [PATCH] dma: remove unnecessary null pointer check in mmp_pdma.c
  2013-01-15  0:19 [PATCH] dma: remove unnecessary null pointer check in mmp_pdma.c Cong Ding
@ 2013-01-20 13:55 ` Vinod Koul
  0 siblings, 0 replies; 2+ messages in thread
From: Vinod Koul @ 2013-01-20 13:55 UTC (permalink / raw)
  To: Cong Ding; +Cc: Dan Williams, linux-kernel

On Tue, Jan 15, 2013 at 01:19:48AM +0100, Cong Ding wrote:
> the pointer cfg is dereferenced in line 594, so it's no reason to check null
> again in line 620.
> 
> Signed-off-by: Cong Ding <dinggnu@gmail.com>
> ---
>  drivers/dma/mmp_pdma.c |    6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/dma/mmp_pdma.c b/drivers/dma/mmp_pdma.c
> index c6d98c0..81d7b89 100644
> --- a/drivers/dma/mmp_pdma.c
> +++ b/drivers/dma/mmp_pdma.c
> @@ -617,10 +617,8 @@ static int mmp_pdma_control(struct dma_chan *dchan, enum dma_ctrl_cmd cmd,
>  		else if (maxburst == 32)
>  			chan->dcmd |= DCMD_BURST32;
>  
> -		if (cfg) {
> -			chan->dir = cfg->direction;
> -			chan->drcmr = cfg->slave_id;
> -		}
> +		chan->dir = cfg->direction;
> +		chan->drcmr = cfg->slave_id;
>  		chan->dev_addr = addr;
>  		break;
>  	default:
Applied, Thanks

--
~Vinod

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

end of thread, other threads:[~2013-01-20 14:19 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-01-15  0:19 [PATCH] dma: remove unnecessary null pointer check in mmp_pdma.c Cong Ding
2013-01-20 13:55 ` Vinod Koul

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox