public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v4] staging: media: av7110: coding style fixes: too many tabs
@ 2026-04-01 19:17 Sudarshan Srinivasan
  2026-04-02 12:50 ` Dan Carpenter
  2026-05-05 12:43 ` Hans Verkuil
  0 siblings, 2 replies; 3+ messages in thread
From: Sudarshan Srinivasan @ 2026-04-01 19:17 UTC (permalink / raw)
  To: mchehab, gregkh, error27
  Cc: Sudarshan Srinivasan, linux-media, linux-staging, linux-kernel

Fix warning reported by checkpatch.pl
"WARNING: Too many leading tabs - consider code refactoring"

Signed-off-by: Sudarshan Srinivasan <ss22.kern.dev@gmail.com>
---
v4:
  - Added the missing check for  "feed->ts_type"
  - Removed initialization of 'ret'
  - handle_ts_memory_fe() accepts only "feed", "demux" and "av7110" extracted thereafter
  - demux->playing assigned to int, instead of bool to maintain original style
v3:
  - Removed the additional tabs in handle_ts_memory_fe() as indicated by Greg KH
  - Retained the original code style as suggested by Dan Carpenter
v2:
  - Refactored change by adding function handle_ts_memory_fe

v2: https://lore.kernel.org/linux-staging/20260318191149.109616-1-ss22.kern.dev@gmail.com/
v1: https://lore.kernel.org/linux-staging/20260316152340.238100-1-ss22.kern.dev@gmail.com/

 drivers/staging/media/av7110/av7110.c | 36 +++++++++++++++++++--------
 1 file changed, 26 insertions(+), 10 deletions(-)

diff --git a/drivers/staging/media/av7110/av7110.c b/drivers/staging/media/av7110/av7110.c
index 607992100baf..486dd8010e7f 100644
--- a/drivers/staging/media/av7110/av7110.c
+++ b/drivers/staging/media/av7110/av7110.c
@@ -932,6 +932,31 @@ static int dvb_feed_stop_pid(struct dvb_demux_feed *dvbdmxfeed)
 	return ret;
 }

+static int handle_ts_memory_fe(struct dvb_demux_feed *feed)
+{
+	struct dvb_demux *demux = feed->demux;
+	struct av7110 *av7110 = demux->priv;
+	int ret;
+
+	if (!(feed->ts_type & TS_DECODER))
+		return 0;
+
+	if (feed->pes_type >= 2)
+		return 0;
+
+	if ((demux->pids[0] & 0x8000) || (demux->pids[1] & 0x8000))
+		return 0;
+
+	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;
+
+	return ret;
+}
+
 static int av7110_start_feed(struct dvb_demux_feed *feed)
 {
 	struct dvb_demux *demux = feed->demux;
@@ -951,16 +976,7 @@ 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;
-					}
+				ret = handle_ts_memory_fe(feed);
 				break;
 			default:
 				ret = dvb_feed_start_pid(feed);
--
2.43.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH v4] staging: media: av7110: coding style fixes: too many tabs
  2026-04-01 19:17 [PATCH v4] staging: media: av7110: coding style fixes: too many tabs Sudarshan Srinivasan
@ 2026-04-02 12:50 ` Dan Carpenter
  2026-05-05 12:43 ` Hans Verkuil
  1 sibling, 0 replies; 3+ messages in thread
From: Dan Carpenter @ 2026-04-02 12:50 UTC (permalink / raw)
  To: Sudarshan Srinivasan
  Cc: mchehab, gregkh, linux-media, linux-staging, linux-kernel

On Thu, Apr 02, 2026 at 12:47:42AM +0530, Sudarshan Srinivasan wrote:
> Fix warning reported by checkpatch.pl
> "WARNING: Too many leading tabs - consider code refactoring"
> 
> Signed-off-by: Sudarshan Srinivasan <ss22.kern.dev@gmail.com>
> ---
> v4:
>   - Added the missing check for  "feed->ts_type"
>   - Removed initialization of 'ret'
>   - handle_ts_memory_fe() accepts only "feed", "demux" and "av7110" extracted thereafter
>   - demux->playing assigned to int, instead of bool to maintain original style

LGTM.  Thanks!

Reviewed-by: Dan Carpenter <error27@gmail.com>

regards,
dan carpenter


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH v4] staging: media: av7110: coding style fixes: too many tabs
  2026-04-01 19:17 [PATCH v4] staging: media: av7110: coding style fixes: too many tabs Sudarshan Srinivasan
  2026-04-02 12:50 ` Dan Carpenter
@ 2026-05-05 12:43 ` Hans Verkuil
  1 sibling, 0 replies; 3+ messages in thread
From: Hans Verkuil @ 2026-05-05 12:43 UTC (permalink / raw)
  To: Sudarshan Srinivasan, mchehab, gregkh, error27
  Cc: linux-media, linux-staging, linux-kernel

On 4/1/26 21:17, Sudarshan Srinivasan wrote:
> Fix warning reported by checkpatch.pl
> "WARNING: Too many leading tabs - consider code refactoring"
> 
> Signed-off-by: Sudarshan Srinivasan <ss22.kern.dev@gmail.com>
> ---
> v4:
>   - Added the missing check for  "feed->ts_type"
>   - Removed initialization of 'ret'
>   - handle_ts_memory_fe() accepts only "feed", "demux" and "av7110" extracted thereafter
>   - demux->playing assigned to int, instead of bool to maintain original style
> v3:
>   - Removed the additional tabs in handle_ts_memory_fe() as indicated by Greg KH
>   - Retained the original code style as suggested by Dan Carpenter
> v2:
>   - Refactored change by adding function handle_ts_memory_fe
> 
> v2: https://lore.kernel.org/linux-staging/20260318191149.109616-1-ss22.kern.dev@gmail.com/
> v1: https://lore.kernel.org/linux-staging/20260316152340.238100-1-ss22.kern.dev@gmail.com/
> 
>  drivers/staging/media/av7110/av7110.c | 36 +++++++++++++++++++--------
>  1 file changed, 26 insertions(+), 10 deletions(-)
> 
> diff --git a/drivers/staging/media/av7110/av7110.c b/drivers/staging/media/av7110/av7110.c
> index 607992100baf..486dd8010e7f 100644
> --- a/drivers/staging/media/av7110/av7110.c
> +++ b/drivers/staging/media/av7110/av7110.c
> @@ -932,6 +932,31 @@ static int dvb_feed_stop_pid(struct dvb_demux_feed *dvbdmxfeed)
>  	return ret;
>  }
> 
> +static int handle_ts_memory_fe(struct dvb_demux_feed *feed)
> +{
> +	struct dvb_demux *demux = feed->demux;
> +	struct av7110 *av7110 = demux->priv;
> +	int ret;
> +
> +	if (!(feed->ts_type & TS_DECODER))
> +		return 0;
> +
> +	if (feed->pes_type >= 2)
> +		return 0;
> +
> +	if ((demux->pids[0] & 0x8000) || (demux->pids[1] & 0x8000))
> +		return 0;
> +
> +	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;
> +
> +	return ret;
> +}
> +
>  static int av7110_start_feed(struct dvb_demux_feed *feed)
>  {
>  	struct dvb_demux *demux = feed->demux;
> @@ -951,16 +976,7 @@ 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 you rework this as follows:

				if (!(feed->ts_type & TS_DECODER))
					break;
				if (feed->pes_type >= 2)
					break;
				if ((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;

Does that fix the warning?

I prefer that over creating a new function. If this doesn't help,
then I can take this patch as-is.

Regards,

	Hans

> +				ret = handle_ts_memory_fe(feed);
>  				break;
>  			default:
>  				ret = dvb_feed_start_pid(feed);
> --
> 2.43.0
> 
> 


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-05-05 12:43 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-04-01 19:17 [PATCH v4] staging: media: av7110: coding style fixes: too many tabs Sudarshan Srinivasan
2026-04-02 12:50 ` Dan Carpenter
2026-05-05 12:43 ` Hans Verkuil

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox