Re: [PATCH] dma: sh/shdma-base.c: remove unnecessary null pointercheck

From: Vinod Koul
Date: Sun Jan 20 2013 - 09:20:10 EST


On Tue, Jan 15, 2013 at 01:23:48AM +0100, Cong Ding wrote:
> the variable chan is dereferenced in line 635, so it is no reason to check
> null again in line 641.
>
> Signed-off-by: Cong Ding <dinggnu@xxxxxxxxx>
> ---
> drivers/dma/sh/shdma-base.c | 3 ---
> 1 file changed, 3 deletions(-)
>
> diff --git a/drivers/dma/sh/shdma-base.c b/drivers/dma/sh/shdma-base.c
> index f4cd946..4acb85a 100644
> --- a/drivers/dma/sh/shdma-base.c
> +++ b/drivers/dma/sh/shdma-base.c
> @@ -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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/