Linux kernel staging patches
 help / color / mirror / Atom feed
From: Dan Carpenter <error27@gmail.com>
To: "André Moreira" <andrem.33333@gmail.com>
Cc: mchehab@kernel.org, gregkh@linuxfoundation.org,
	linux-media@vger.kernel.org, linux-staging@lists.linux.dev,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/2] staging: media: av7110: refactor av7110_start_feed to reduce indentation
Date: Sat, 20 Jun 2026 11:42:31 +0300	[thread overview]
Message-ID: <ajZSd4RhjJgDqn1q@stanley.mountain> (raw)
In-Reply-To: <20260619221524.51814-2-andrem.33333@gmail.com>

On Fri, Jun 19, 2026 at 07:15:24PM -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, reducing the indentation level.
> 
> Signed-off-by: André Moreira <andrem.33333@gmail.com>

Imagine I read this commit message

> ---
>  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 e77be16f442c..2e32acf897ff 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)

And the first thing that I saw is that you removed this check.  There
is no information in the email why this is okay.  I have to look at
the code itself to see that.

The patch is fine, but I don't want to have to read the code to find my
answers.  Re-write the commit message and resend.

regards,
dan carpenter

> -					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);


  reply	other threads:[~2026-06-20  9:41 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-19 22:15 [PATCH 1/2] staging: media: av7110: replace msleep with usleep_range André Moreira
2026-06-19 22:15 ` [PATCH 2/2] staging: media: av7110: refactor av7110_start_feed to reduce indentation André Moreira
2026-06-20  8:42   ` Dan Carpenter [this message]
2026-06-20  9:40 ` [PATCH 1/2] staging: media: av7110: replace msleep with usleep_range Dan Carpenter

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ajZSd4RhjJgDqn1q@stanley.mountain \
    --to=error27@gmail.com \
    --cc=andrem.33333@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=linux-staging@lists.linux.dev \
    --cc=mchehab@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox