public inbox for linux-staging@lists.linux.dev
 help / color / mirror / Atom feed
* [PATCH] media: tegra-video: tegra210: remove redundant NULL check in dequeue_buf_done
@ 2026-04-12 17:24 Hungyu Lin
  2026-04-13  8:05 ` Dan Carpenter
  0 siblings, 1 reply; 2+ messages in thread
From: Hungyu Lin @ 2026-04-12 17:24 UTC (permalink / raw)
  To: thierry.reding, jonathanh, skomatineni, luca.ceresoli
  Cc: mchehab, gregkh, linux-media, linux-tegra, linux-staging,
	linux-kernel, Hungyu Lin

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>
---
 drivers/staging/media/tegra-video/tegra210.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/staging/media/tegra-video/tegra210.c b/drivers/staging/media/tegra-video/tegra210.c
index da99f19a39e7..a6606768fa03 100644
--- a/drivers/staging/media/tegra-video/tegra210.c
+++ b/drivers/staging/media/tegra-video/tegra210.c
@@ -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;
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] media: tegra-video: tegra210: remove redundant NULL check in dequeue_buf_done
  2026-04-12 17:24 [PATCH] media: tegra-video: tegra210: remove redundant NULL check in dequeue_buf_done Hungyu Lin
@ 2026-04-13  8:05 ` Dan Carpenter
  0 siblings, 0 replies; 2+ messages in thread
From: Dan Carpenter @ 2026-04-13  8:05 UTC (permalink / raw)
  To: Hungyu Lin
  Cc: thierry.reding, jonathanh, skomatineni, luca.ceresoli, mchehab,
	gregkh, linux-media, linux-tegra, linux-staging, linux-kernel

On Sun, Apr 12, 2026 at 05:24:16PM +0000, Hungyu Lin wrote:
> 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>
> ---

Thanks!

Reviewed-by: Dan Carpenter <error27@gmail.com>

regards,
dan carpenter


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-04-13  8:05 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-04-12 17:24 [PATCH] media: tegra-video: tegra210: remove redundant NULL check in dequeue_buf_done Hungyu Lin
2026-04-13  8:05 ` Dan Carpenter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox