media: tegra-video: tegra210: remove redundant NULL check in dequeue_buf_done
Subsystems (4)
PATCH 1/1 media: tegra-video: tegra210: remove redundant NULL check in dequeue_buf_done
list_first_entry() does not returns NULL when the list is known to be non-empty. The NULL check before list_del_init() is therefore redundant.
Remove the unnecessary check.
Signed-off-by Hungyu Lin <[email protected]>
--- drivers/staging/media/tegra-video/tegra210.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/staging/media/tegra-video/tegra210.c +1 -2
@@ -362,8 +362,7 @@ dequeue_buf_done(struct tegra_vi_channel *chan) buf =list_first_entry (&chan->done, struct tegra_channel_buffer, queue); -if (buf) -list_del_init (&buf->queue); +list_del_init (&buf->queue);spin_unlock (&chan->done_lock);return buf;
Signature · 1 line
2.34.1
Quoted 8 lines · Hungyu Lin
list_first_entry()does not returns NULL when the list is known to be non-empty. The NULL check beforelist_del_init()is therefore redundant.Remove the unnecessary check.
Signed-off-by Hungyu Lin <[email protected]>---
Thanks!
Reviewed-by Dan Carpenter <[email protected]>
regards,
dan carpenter