]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
media: tegra-video: tegra210: remove redundant NULL check in dequeue_buf_done
authorHungyu Lin <dennylin0707@gmail.com>
Sun, 12 Apr 2026 17:24:16 +0000 (17:24 +0000)
committerHans Verkuil <hverkuil+cisco@kernel.org>
Wed, 6 May 2026 07:05:56 +0000 (09:05 +0200)
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 <dennylin0707@gmail.com>
Reviewed-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
drivers/staging/media/tegra-video/tegra210.c

index da99f19a39e7b78ffc881b5fb8660e56e31e9d7b..a6606768fa03681db5a8d7bc67e0a03779545b6c 100644 (file)
@@ -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;