[PATCH v2] staging: media: av7110: refactor av7110_start_feed to reduce indentation
From: André Moreira
Date: Sat Jun 20 2026 - 13:24:20 EST
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@xxxxxxxxx>
---
drivers/staging/media/av7110/av7110.c | 20 ++++++++++----------
1 file changed, 10 insertions(+), 10 deletions(-)
diff --git a/drivers/staging/media/av7110/av7110.c b/drivers/staging/media/av7110/av7110.c
index e77be16f442ce..2e32acf897ffc 100644
--- a/drivers/staging/media/av7110/av7110.c
+++ b/drivers/staging/media/av7110/av7110.c
@@ -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);
--
2.43.0