dma: remove unnecessary null pointer check in mmp_pdma.c
PATCH 1/1 dma: remove unnecessary null pointer check in mmp_pdma.c
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 <[email protected]>
--- drivers/dma/mmp_pdma.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/dma/mmp_pdma.c +2 -4
@@ -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 :
Signature · 1 line
1.7.10.4
Vinod Koul
AppliedQuoted 15 lines · 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 <[email protected]>--- drivers/dma/mmp_pdma.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)drivers/dma/mmp_pdma.c +0
-0@@ -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 ;
drivers/dma/mmp_pdma.c static int mmp_pdma_control(struct dma_chan *dchan, enum dma_ctrl_cmd cmd, · line 624
Quoted 10 lines
drivers/dma/mmp_pdma.c +2
-4-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