Skip to content

Commit 99f9cd2

Browse files
Hans Verkuilmchehab
authored andcommitted
media: platform: renesas-ceu: drop buf NULL check
Since start_streaming is only called if there are at least two buffers queued, the ceudev->capture list will never be empty, so the check whether there are no buffers can be dropped. Note that the '!buf' check was wrong in any case, if we wanted to check for an empty list it should have used list_empty(). This fixes this smatch warning: drivers/media/platform/renesas/renesas-ceu.c:705 ceu_start_streaming() warn: can 'buf' even be NULL? Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
1 parent 7cc4711 commit 99f9cd2

1 file changed

Lines changed: 0 additions & 9 deletions

File tree

drivers/media/platform/renesas/renesas-ceu.c

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -702,12 +702,6 @@ static int ceu_start_streaming(struct vb2_queue *vq, unsigned int count)
702702
/* Grab the first available buffer and trigger the first capture. */
703703
buf = list_first_entry(&ceudev->capture, struct ceu_buffer,
704704
queue);
705-
if (!buf) {
706-
spin_unlock_irqrestore(&ceudev->lock, irqflags);
707-
dev_dbg(ceudev->dev,
708-
"No buffer available for capture.\n");
709-
goto error_stop_sensor;
710-
}
711705

712706
list_del(&buf->queue);
713707
ceudev->active = &buf->vb;
@@ -722,9 +716,6 @@ static int ceu_start_streaming(struct vb2_queue *vq, unsigned int count)
722716

723717
return 0;
724718

725-
error_stop_sensor:
726-
v4l2_subdev_call(v4l2_sd, video, s_stream, 0);
727-
728719
error_return_bufs:
729720
spin_lock_irqsave(&ceudev->lock, irqflags);
730721
list_for_each_entry(buf, &ceudev->capture, queue)

0 commit comments

Comments
 (0)