diff options
author | Masahiro Yamada <yamada.masahiro@socionext.com> | 2016-09-12 20:08:17 +0200 |
---|---|---|
committer | Vinod Koul <vinod.koul@intel.com> | 2016-09-14 15:40:46 +0200 |
commit | 360af35b08da9def3be8b67398f4e0f90c292e37 (patch) | |
tree | 8afea3d372107ddc4f45b4c903fad056f58a0626 /drivers/dma/virt-dma.h | |
parent | dmaengine: NO_IRQ removal from powerpc-only drivers (diff) | |
download | linux-360af35b08da9def3be8b67398f4e0f90c292e37.tar.xz linux-360af35b08da9def3be8b67398f4e0f90c292e37.zip |
dmaengine: cleanup with list_first_entry_or_null()
The combo of list_empty() check and return list_first_entry()
can be replaced with list_first_entry_or_null().
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Diffstat (limited to '')
-rw-r--r-- | drivers/dma/virt-dma.h | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/dma/virt-dma.h b/drivers/dma/virt-dma.h index d9731ca5e262..a030ae7b1df2 100644 --- a/drivers/dma/virt-dma.h +++ b/drivers/dma/virt-dma.h @@ -123,10 +123,8 @@ static inline void vchan_cyclic_callback(struct virt_dma_desc *vd) */ static inline struct virt_dma_desc *vchan_next_desc(struct virt_dma_chan *vc) { - if (list_empty(&vc->desc_issued)) - return NULL; - - return list_first_entry(&vc->desc_issued, struct virt_dma_desc, node); + return list_first_entry_or_null(&vc->desc_issued, + struct virt_dma_desc, node); } /** |