linux-staging.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
* [PATCH -next v4] media: staging: atomisp: use list_splice_init in atomisp_compat_css20.c
@ 2021-06-17 12:47 Baokun Li
  2021-06-17 12:48 ` libaokun (A)
  2021-06-17 12:55 ` Andy Shevchenko
  0 siblings, 2 replies; 4+ messages in thread
From: Baokun Li @ 2021-06-17 12:47 UTC (permalink / raw)
  To: libaokun1, mchehab, sakari.ailus, gregkh, andriy.shevchenko,
	kaixuxia, gustavoars, linux-media, linux-staging, linux-kernel
  Cc: weiyongjun1, yuehaibing, yangjihong1, yukuai3, Hulk Robot

Using list_splice_init() instead of entire while-loops
in atomisp_compat_css20.c.

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Baokun Li <libaokun1@huawei.com>
---
 .../media/atomisp/pci/atomisp_compat_css20.c  | 35 +++----------------
 1 file changed, 5 insertions(+), 30 deletions(-)

diff --git a/drivers/staging/media/atomisp/pci/atomisp_compat_css20.c b/drivers/staging/media/atomisp/pci/atomisp_compat_css20.c
index f60198bb8a1a..7831bdac96ff 100644
--- a/drivers/staging/media/atomisp/pci/atomisp_compat_css20.c
+++ b/drivers/staging/media/atomisp/pci/atomisp_compat_css20.c
@@ -2144,42 +2144,17 @@ void atomisp_css_stop(struct atomisp_sub_device *asd,
 	}
 
 	/* move stats buffers to free queue list */
-	while (!list_empty(&asd->s3a_stats_in_css)) {
-		s3a_buf = list_entry(asd->s3a_stats_in_css.next,
-				     struct atomisp_s3a_buf, list);
-		list_del(&s3a_buf->list);
-		list_add_tail(&s3a_buf->list, &asd->s3a_stats);
-	}
-	while (!list_empty(&asd->s3a_stats_ready)) {
-		s3a_buf = list_entry(asd->s3a_stats_ready.next,
-				     struct atomisp_s3a_buf, list);
-		list_del(&s3a_buf->list);
-		list_add_tail(&s3a_buf->list, &asd->s3a_stats);
-	}
+	list_splice_init(&asd->s3a_stats_in_css, &asd->s3a_stats);
+	list_splice_init(&asd->s3a_stats_ready, &asd->s3a_stats);
 
 	spin_lock_irqsave(&asd->dis_stats_lock, irqflags);
-	while (!list_empty(&asd->dis_stats_in_css)) {
-		dis_buf = list_entry(asd->dis_stats_in_css.next,
-				     struct atomisp_dis_buf, list);
-		list_del(&dis_buf->list);
-		list_add_tail(&dis_buf->list, &asd->dis_stats);
-	}
+	list_splice_init(&asd->dis_stats_in_css, &asd->dis_stats);
 	asd->params.dis_proj_data_valid = false;
 	spin_unlock_irqrestore(&asd->dis_stats_lock, irqflags);
 
 	for (i = 0; i < ATOMISP_METADATA_TYPE_NUM; i++) {
-		while (!list_empty(&asd->metadata_in_css[i])) {
-			md_buf = list_entry(asd->metadata_in_css[i].next,
-					    struct atomisp_metadata_buf, list);
-			list_del(&md_buf->list);
-			list_add_tail(&md_buf->list, &asd->metadata[i]);
-		}
-		while (!list_empty(&asd->metadata_ready[i])) {
-			md_buf = list_entry(asd->metadata_ready[i].next,
-					    struct atomisp_metadata_buf, list);
-			list_del(&md_buf->list);
-			list_add_tail(&md_buf->list, &asd->metadata[i]);
-		}
+		list_splice_init(&asd->metadata_in_css[i], &asd->metadata[i]);
+		list_splice_init(&asd->metadata_ready[i], &asd->metadata[i]);
 	}
 
 	atomisp_flush_params_queue(&asd->video_out_capture);
-- 
2.31.1


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

* Re: [PATCH -next v4] media: staging: atomisp: use list_splice_init in atomisp_compat_css20.c
  2021-06-17 12:47 [PATCH -next v4] media: staging: atomisp: use list_splice_init in atomisp_compat_css20.c Baokun Li
@ 2021-06-17 12:48 ` libaokun (A)
  2021-06-17 12:55 ` Andy Shevchenko
  1 sibling, 0 replies; 4+ messages in thread
From: libaokun (A) @ 2021-06-17 12:48 UTC (permalink / raw)
  To: mchehab, sakari.ailus, gregkh, andriy.shevchenko, kaixuxia,
	gustavoars, linux-media, linux-staging, linux-kernel
  Cc: weiyongjun1, yuehaibing, yangjihong1, yukuai3, Hulk Robot

Please ignore this email.

I have forgot the version information.

I'm about to send a patch v5 with the version information.

Best Regards.


在 2021/6/17 20:47, Baokun Li 写道:
> Using list_splice_init() instead of entire while-loops
> in atomisp_compat_css20.c.
>
> Reported-by: Hulk Robot <hulkci@huawei.com>
> Signed-off-by: Baokun Li <libaokun1@huawei.com>
> ---
>   .../media/atomisp/pci/atomisp_compat_css20.c  | 35 +++----------------
>   1 file changed, 5 insertions(+), 30 deletions(-)
>
> diff --git a/drivers/staging/media/atomisp/pci/atomisp_compat_css20.c b/drivers/staging/media/atomisp/pci/atomisp_compat_css20.c
> index f60198bb8a1a..7831bdac96ff 100644
> --- a/drivers/staging/media/atomisp/pci/atomisp_compat_css20.c
> +++ b/drivers/staging/media/atomisp/pci/atomisp_compat_css20.c
> @@ -2144,42 +2144,17 @@ void atomisp_css_stop(struct atomisp_sub_device *asd,
>   	}
>   
>   	/* move stats buffers to free queue list */
> -	while (!list_empty(&asd->s3a_stats_in_css)) {
> -		s3a_buf = list_entry(asd->s3a_stats_in_css.next,
> -				     struct atomisp_s3a_buf, list);
> -		list_del(&s3a_buf->list);
> -		list_add_tail(&s3a_buf->list, &asd->s3a_stats);
> -	}
> -	while (!list_empty(&asd->s3a_stats_ready)) {
> -		s3a_buf = list_entry(asd->s3a_stats_ready.next,
> -				     struct atomisp_s3a_buf, list);
> -		list_del(&s3a_buf->list);
> -		list_add_tail(&s3a_buf->list, &asd->s3a_stats);
> -	}
> +	list_splice_init(&asd->s3a_stats_in_css, &asd->s3a_stats);
> +	list_splice_init(&asd->s3a_stats_ready, &asd->s3a_stats);
>   
>   	spin_lock_irqsave(&asd->dis_stats_lock, irqflags);
> -	while (!list_empty(&asd->dis_stats_in_css)) {
> -		dis_buf = list_entry(asd->dis_stats_in_css.next,
> -				     struct atomisp_dis_buf, list);
> -		list_del(&dis_buf->list);
> -		list_add_tail(&dis_buf->list, &asd->dis_stats);
> -	}
> +	list_splice_init(&asd->dis_stats_in_css, &asd->dis_stats);
>   	asd->params.dis_proj_data_valid = false;
>   	spin_unlock_irqrestore(&asd->dis_stats_lock, irqflags);
>   
>   	for (i = 0; i < ATOMISP_METADATA_TYPE_NUM; i++) {
> -		while (!list_empty(&asd->metadata_in_css[i])) {
> -			md_buf = list_entry(asd->metadata_in_css[i].next,
> -					    struct atomisp_metadata_buf, list);
> -			list_del(&md_buf->list);
> -			list_add_tail(&md_buf->list, &asd->metadata[i]);
> -		}
> -		while (!list_empty(&asd->metadata_ready[i])) {
> -			md_buf = list_entry(asd->metadata_ready[i].next,
> -					    struct atomisp_metadata_buf, list);
> -			list_del(&md_buf->list);
> -			list_add_tail(&md_buf->list, &asd->metadata[i]);
> -		}
> +		list_splice_init(&asd->metadata_in_css[i], &asd->metadata[i]);
> +		list_splice_init(&asd->metadata_ready[i], &asd->metadata[i]);
>   	}
>   
>   	atomisp_flush_params_queue(&asd->video_out_capture);

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

* Re: [PATCH -next v4] media: staging: atomisp: use list_splice_init in atomisp_compat_css20.c
  2021-06-17 12:47 [PATCH -next v4] media: staging: atomisp: use list_splice_init in atomisp_compat_css20.c Baokun Li
  2021-06-17 12:48 ` libaokun (A)
@ 2021-06-17 12:55 ` Andy Shevchenko
  2021-06-17 13:09   ` libaokun (A)
  1 sibling, 1 reply; 4+ messages in thread
From: Andy Shevchenko @ 2021-06-17 12:55 UTC (permalink / raw)
  To: Baokun Li
  Cc: mchehab, sakari.ailus, gregkh, kaixuxia, gustavoars, linux-media,
	linux-staging, linux-kernel, weiyongjun1, yuehaibing,
	yangjihong1, yukuai3, Hulk Robot

On Thu, Jun 17, 2021 at 08:47:09PM +0800, Baokun Li wrote:
> Using list_splice_init() instead of entire while-loops
> in atomisp_compat_css20.c.
> 
> Reported-by: Hulk Robot <hulkci@huawei.com>
> Signed-off-by: Baokun Li <libaokun1@huawei.com>
> ---

You missed changelog.
And I believe you missed the changes.
So, what's the point?

-- 
With Best Regards,
Andy Shevchenko



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

* Re: [PATCH -next v4] media: staging: atomisp: use list_splice_init in atomisp_compat_css20.c
  2021-06-17 12:55 ` Andy Shevchenko
@ 2021-06-17 13:09   ` libaokun (A)
  0 siblings, 0 replies; 4+ messages in thread
From: libaokun (A) @ 2021-06-17 13:09 UTC (permalink / raw)
  To: Andy Shevchenko
  Cc: mchehab, sakari.ailus, gregkh, kaixuxia, gustavoars, linux-media,
	linux-staging, linux-kernel, weiyongjun1, yuehaibing,
	yangjihong1, yukuai3

Sorry, I'm in bad shape today.

I replied to this v4 patch to remind people to ignore it.

And I send a v5 patch to fix it.

You can refresh your mail list.

Best Regards.


在 2021/6/17 20:55, Andy Shevchenko 写道:
> On Thu, Jun 17, 2021 at 08:47:09PM +0800, Baokun Li wrote:
>> Using list_splice_init() instead of entire while-loops
>> in atomisp_compat_css20.c.
>>
>> Reported-by: Hulk Robot <hulkci@huawei.com>
>> Signed-off-by: Baokun Li <libaokun1@huawei.com>
>> ---
> You missed changelog.
> And I believe you missed the changes.
> So, what's the point?
>

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

end of thread, other threads:[~2021-06-17 13:09 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-17 12:47 [PATCH -next v4] media: staging: atomisp: use list_splice_init in atomisp_compat_css20.c Baokun Li
2021-06-17 12:48 ` libaokun (A)
2021-06-17 12:55 ` Andy Shevchenko
2021-06-17 13:09   ` libaokun (A)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).