lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:	Sat, 30 Mar 2013 04:37:18 +0530
From:	Vinod Koul <vinod.koul@...el.com>
To:	Lars-Peter Clausen <lars@...afoo.de>
Cc:	Dan Williams <djbw@...com>, Jon Hunter <jon-hunter@...com>,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH] dma: of: Remove unnecessary list_empty check

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@...afoo.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
> 
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ