mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Sascha Hauer <s.hauer@pengutronix.de>
To: Sachin Kamat <sachin.kamat@linaro.org>
Cc: linux-kernel@vger.kernel.org, vinod.koul@intel.com, djbw@fb.com
Subject: Re: [PATCH 1/1] dma: imx-dma: Remove redundant NULL check
Date: Mon, 2 Sep 2013 10:19:14 +0200	[thread overview]
Message-ID: <20130902081914.GN30088@pengutronix.de> (raw)
In-Reply-To: <1378108278-4051-1-git-send-email-sachin.kamat@linaro.org>

On Mon, Sep 02, 2013 at 01:21:18PM +0530, Sachin Kamat wrote:
> kfree on a NULL pointer is a no-op. Null pointer check is
> not necessary.
> 
> Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
> Cc: Sascha Hauer <s.hauer@pengutronix.de>

Acked-by: Sascha Hauer <s.hauer@pengutronix.de>

Sascha

> ---
>  drivers/dma/imx-dma.c |    6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/dma/imx-dma.c b/drivers/dma/imx-dma.c
> index ff2aab9..78f8ca5 100644
> --- a/drivers/dma/imx-dma.c
> +++ b/drivers/dma/imx-dma.c
> @@ -805,10 +805,8 @@ static void imxdma_free_chan_resources(struct dma_chan *chan)
>  	}
>  	INIT_LIST_HEAD(&imxdmac->ld_free);
>  
> -	if (imxdmac->sg_list) {
> -		kfree(imxdmac->sg_list);
> -		imxdmac->sg_list = NULL;
> -	}
> +	kfree(imxdmac->sg_list);
> +	imxdmac->sg_list = NULL;
>  }
>  
>  static struct dma_async_tx_descriptor *imxdma_prep_slave_sg(
> -- 
> 1.7.9.5
> 
> 

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

  reply	other threads:[~2013-09-02  8:19 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-02  7:51 Sachin Kamat
2013-09-02  8:19 ` Sascha Hauer [this message]
2013-09-02 10:46 ` Vinod Koul

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20130902081914.GN30088@pengutronix.de \
    --to=s.hauer@pengutronix.de \
    --cc=djbw@fb.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sachin.kamat@linaro.org \
    --cc=vinod.koul@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®