diff options
author | Masahiro Yamada <yamada.masahiro@socionext.com> | 2016-09-13 03:08:17 +0900 |
---|---|---|
committer | Vinod Koul <vinod.koul@intel.com> | 2016-09-14 19:10:46 +0530 |
commit | 360af35b08da9def3be8b67398f4e0f90c292e37 (patch) | |
tree | 8afea3d372107ddc4f45b4c903fad056f58a0626 /drivers/dma/coh901318.c | |
parent | aa570be6de67f3772cc850a7bfbe659214aa9ee4 (diff) | |
download | talos-op-linux-360af35b08da9def3be8b67398f4e0f90c292e37.tar.gz talos-op-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 'drivers/dma/coh901318.c')
-rw-r--r-- | drivers/dma/coh901318.c | 22 |
1 files changed, 4 insertions, 18 deletions
diff --git a/drivers/dma/coh901318.c b/drivers/dma/coh901318.c index e4acd63e42aa..a373ecacfaba 100644 --- a/drivers/dma/coh901318.c +++ b/drivers/dma/coh901318.c @@ -1553,15 +1553,8 @@ coh901318_desc_submit(struct coh901318_chan *cohc, struct coh901318_desc *desc) static struct coh901318_desc * coh901318_first_active_get(struct coh901318_chan *cohc) { - struct coh901318_desc *d; - - if (list_empty(&cohc->active)) - return NULL; - - d = list_first_entry(&cohc->active, - struct coh901318_desc, - node); - return d; + return list_first_entry_or_null(&cohc->active, struct coh901318_desc, + node); } static void @@ -1579,15 +1572,8 @@ coh901318_desc_queue(struct coh901318_chan *cohc, struct coh901318_desc *desc) static struct coh901318_desc * coh901318_first_queued(struct coh901318_chan *cohc) { - struct coh901318_desc *d; - - if (list_empty(&cohc->queue)) - return NULL; - - d = list_first_entry(&cohc->queue, - struct coh901318_desc, - node); - return d; + return list_first_entry_or_null(&cohc->queue, struct coh901318_desc, + node); } static inline u32 coh901318_get_bytes_in_lli(struct coh901318_lli *in_lli) |