public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] dma: of: Remove unnecessary list_empty check
@ 2013-03-25 13:24 Lars-Peter Clausen
  2013-03-29 23:07 ` Vinod Koul
  0 siblings, 1 reply; 2+ messages in thread
From: Lars-Peter Clausen @ 2013-03-25 13:24 UTC (permalink / raw)
  To: Vinod Koul, Dan Williams; +Cc: Jon Hunter, linux-kernel, Lars-Peter Clausen

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>
---
 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


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-03-29 23:34 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-03-25 13:24 [PATCH] dma: of: Remove unnecessary list_empty check Lars-Peter Clausen
2013-03-29 23:07 ` Vinod Koul

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox