Skip to content

Commit

Permalink
dma: of: Remove unnecessary list_empty check
Browse files Browse the repository at this point in the history
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>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
  • Loading branch information
Lars-Peter Clausen authored and Vinod Koul committed Apr 15, 2013
1 parent 9a188eb commit af31826
Showing 1 changed file with 0 additions and 5 deletions.
5 changes: 0 additions & 5 deletions drivers/dma/of-dma.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand Down

0 comments on commit af31826

Please sign in to comment.