On Sat Jun 20 14:21:38 2026 -0300, André Moreira wrote:
> 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 <[email protected]>
> Signed-off-by: Hans Verkuil <[email protected]>

Patch committed.

Thanks,
Hans Verkuil

 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 862aee993889..06c43b5f8a87 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);
_______________________________________________
linuxtv-commits mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to