From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Baokun Li <libaokun1@huawei.com>
Cc: mchehab@kernel.org, sakari.ailus@linux.intel.com,
gregkh@linuxfoundation.org, kaixuxia@tencent.com,
gustavoars@kernel.org, linux-media@vger.kernel.org,
linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org,
weiyongjun1@huawei.com, yuehaibing@huawei.com,
yangjihong1@huawei.com, yukuai3@huawei.com,
Hulk Robot <hulkci@huawei.com>
Subject: Re: [PATCH -next v3] media: staging: atomisp: use list_splice_init in atomisp_compat_css20.c
Date: Fri, 11 Jun 2021 12:59:52 +0300 [thread overview]
Message-ID: <YMM0GO4Ny6j/FvQV@smile.fi.intel.com> (raw)
In-Reply-To: <20210611081004.1348026-1-libaokun1@huawei.com>
On Fri, Jun 11, 2021 at 04:10:04PM +0800, Baokun Li wrote:
> Using list_splice_init() instead of entire while-loops
> in atomisp_compat_css20.c.
Seems fine to me.
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> Reported-by: Hulk Robot <hulkci@huawei.com>
> Signed-off-by: Baokun Li <libaokun1@huawei.com>
> ---
> V1->V2:
> CC mailist
> V2->V3:
> Using list_move_tail() -> Using list_splice_init()
>
> .../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..3844180d32b5 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->asd->metadata[i]);
> + list_splice_init(&asd->metadata_ready[i], &asd->asd->metadata[i]);
> }
>
> atomisp_flush_params_queue(&asd->video_out_capture);
> --
> 2.31.1
>
--
With Best Regards,
Andy Shevchenko
next prev parent reply other threads:[~2021-06-11 9:59 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-06-11 8:10 [PATCH -next v3] media: staging: atomisp: use list_splice_init in atomisp_compat_css20.c Baokun Li
2021-06-11 9:59 ` Andy Shevchenko [this message]
2021-06-17 8:52 ` kernel test robot
2021-06-17 12:14 ` libaokun (A)
2021-06-17 12:41 ` Andy Shevchenko
2021-06-17 12:53 ` libaokun (A)
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=YMM0GO4Ny6j/FvQV@smile.fi.intel.com \
--to=andriy.shevchenko@linux.intel.com \
--cc=gregkh@linuxfoundation.org \
--cc=gustavoars@kernel.org \
--cc=hulkci@huawei.com \
--cc=kaixuxia@tencent.com \
--cc=libaokun1@huawei.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=linux-staging@lists.linux.dev \
--cc=mchehab@kernel.org \
--cc=sakari.ailus@linux.intel.com \
--cc=weiyongjun1@huawei.com \
--cc=yangjihong1@huawei.com \
--cc=yuehaibing@huawei.com \
--cc=yukuai3@huawei.com \
/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;
as well as URLs for NNTP newsgroup(s).