All of lore.kernel.org
 help / color / mirror / Atom feed
From: Vinod Koul <vinod.koul@intel.com>
To: Lars-Peter Clausen <lars@metafoo.de>
Cc: Dan Williams <djbw@fb.com>, Jon Hunter <jon-hunter@ti.com>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] dma: of: Remove unnecessary list_empty check
Date: Sat, 30 Mar 2013 04:37:18 +0530	[thread overview]
Message-ID: <20130329230718.GC10326@intel.com> (raw)
In-Reply-To: <1364217862-32677-1-git-send-email-lars@metafoo.de>

On Mon, Mar 25, 2013 at 02:24:22PM +0100, Lars-Peter Clausen wrote:
> list_for_each_entry is able to handle empty lists just fine, there is no need
> to make sure that the list is non empty.
> 
> Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Applied thanks
> ---
>  drivers/dma/of-dma.c | 5 -----
>  1 file changed, 5 deletions(-)
> 
> diff --git a/drivers/dma/of-dma.c b/drivers/dma/of-dma.c
> index 7cad4d7..6679020 100644
> --- a/drivers/dma/of-dma.c
> +++ b/drivers/dma/of-dma.c
> @@ -36,11 +36,6 @@ static struct of_dma *of_dma_get_controller(struct of_phandle_args *dma_spec)
>  
>  	spin_lock(&of_dma_lock);
>  
> -	if (list_empty(&of_dma_list)) {
> -		spin_unlock(&of_dma_lock);
> -		return NULL;
> -	}
> -
>  	list_for_each_entry(ofdma, &of_dma_list, of_dma_controllers)
>  		if ((ofdma->of_node == dma_spec->np) &&
>  		    (ofdma->of_dma_nbcells == dma_spec->args_count)) {
> -- 
> 1.8.0
> 

      reply	other threads:[~2013-03-29 23:34 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-25 13:24 [PATCH] dma: of: Remove unnecessary list_empty check Lars-Peter Clausen
2013-03-29 23:07 ` Vinod Koul [this message]

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=20130329230718.GC10326@intel.com \
    --to=vinod.koul@intel.com \
    --cc=djbw@fb.com \
    --cc=jon-hunter@ti.com \
    --cc=lars@metafoo.de \
    --cc=linux-kernel@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.