staging: media: av7110: refactor av7110_start_feed to reduce indentation

The av7110_start_feed function contains heavily nested if-statements,
causing excessive indentation and violating code style guidelines.

Refactor the logic inside the DMX_MEMORY_FE case by inverting the
conditional check to break early. Additionally, remove the inner
'if (feed->ts_type & TS_DECODER)' check, as it is redundant since
the outer block already validates this condition.

This reduces the indentation level and cleans up redundant checks
without altering the underlying driver behavior.

Signed-off-by: André Moreira <andrem.33333@gmail.com>
Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
This commit is contained in:
André Moreira 2026-06-20 14:21:38 -03:00 committed by Hans Verkuil
parent b7f17b9fe0
commit 635590417a

View File

@ -942,16 +942,16 @@ static int av7110_start_feed(struct dvb_demux_feed *feed)
(feed->pes_type <= DMX_PES_PCR)) {
switch (demux->dmx.frontend->source) {
case DMX_MEMORY_FE:
if (feed->ts_type & TS_DECODER)
if (feed->pes_type < 2 &&
!(demux->pids[0] & 0x8000) &&
!(demux->pids[1] & 0x8000)) {
dvb_ringbuffer_flush_spinlock_wakeup(&av7110->avout);
dvb_ringbuffer_flush_spinlock_wakeup(&av7110->aout);
ret = av7110_av_start_play(av7110, RP_AV);
if (!ret)
demux->playing = 1;
}
if (feed->pes_type >= 2 ||
(demux->pids[0] & 0x8000) ||
(demux->pids[1] & 0x8000))
break;
dvb_ringbuffer_flush_spinlock_wakeup(&av7110->avout);
dvb_ringbuffer_flush_spinlock_wakeup(&av7110->aout);
ret = av7110_av_start_play(av7110, RP_AV);
if (!ret)
demux->playing = 1;
break;
default:
ret = dvb_feed_start_pid(feed);