Commit 93aaba85 authored by Dafna Hirschfeld's avatar Dafna Hirschfeld Committed by Mauro Carvalho Chehab
Browse files

media: staging: rkisp1: params: in the isr, return if buffer list is empty



Currently the code in the isr checks if the buffer list is not
empty before referencing a buffer and then check again if the
buffer is not NULL. Instead we can save one 'if' statement by
returning if the buffers list is empty.
Also remove non-helpful inline doc 'get one empty buffer'

Signed-off-by: default avatarDafna Hirschfeld <dafna.hirschfeld@collabora.com>
Acked-by: default avatarHelen Koike <helen.koike@collabora.com>
Signed-off-by: default avatarHans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+huawei@kernel.org>
parent b1b2715e
Loading
Loading
Loading
Loading
+4 −6
Original line number Diff line number Diff line
@@ -1198,16 +1198,14 @@ void rkisp1_params_isr(struct rkisp1_device *rkisp1)
		return;
	}

	/* get one empty buffer */
	if (!list_empty(&params->params))
		cur_buf = list_first_entry(&params->params,
					   struct rkisp1_buffer, queue);

	if (!cur_buf) {
	if (list_empty(&params->params)) {
		spin_unlock(&params->config_lock);
		return;
	}

	cur_buf = list_first_entry(&params->params,
				   struct rkisp1_buffer, queue);

	new_params = (struct rkisp1_params_cfg *)(cur_buf->vaddr);

	rkisp1_isp_isr_other_config(params, new_params);