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>
This commit is contained in:

committed by
Vinod Koul

parent
aa570be6de
commit
360af35b08
@@ -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);
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user