From: Andy Shevchenko <andy.shevchenko@gmail.com>
To: Baokun Li <libaokun1@huawei.com>
Cc: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
Mauro Carvalho Chehab <mchehab@kernel.org>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Sakari Ailus <sakari.ailus@linux.intel.com>,
Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
Kaixu Xia <kaixuxia@tencent.com>,
"Gustavo A. R. Silva" <gustavoars@kernel.org>,
Wei Yongjun <weiyongjun1@huawei.com>,
YueHaibing <yuehaibing@huawei.com>,
yangjihong1@huawei.com, yukuai3@huawei.com,
Linux Media Mailing List <linux-media@vger.kernel.org>,
linux-staging@lists.linux.dev,
kernel-janitors <kernel-janitors@vger.kernel.org>,
Hulk Robot <hulkci@huawei.com>
Subject: Re: [PATCH -next v2] media: staging: atomisp: use list_move_tail instead of list_del/list_add_tail in atomisp_compat_css20.c
Date: Wed, 9 Jun 2021 21:17:23 +0300 [thread overview]
Message-ID: <CAHp75VesvRMGY25WP-ZQaqWE-kyyp25GsvM8h=yMfO5U6r1gDA@mail.gmail.com> (raw)
In-Reply-To: <20210609072409.1357327-1-libaokun1@huawei.com>
On Wed, Jun 9, 2021 at 4:32 PM Baokun Li <libaokun1@huawei.com> wrote:
>
> Using list_move_tail() instead of list_del() + list_add_tail() in atomisp_compat_css20.c.
Have you considered using list_splice() instead of entire while-loops?
Or something similar from list.h...
> 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);
> + list_move_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_move_tail(&s3a_buf->list, &asd->s3a_stats);
> }
> 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_move_tail(&dis_buf->list, &asd->dis_stats);
> }
> 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]);
> + list_move_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_move_tail(&md_buf->list, &asd->metadata[i]);
> }
--
With Best Regards,
Andy Shevchenko
next prev parent reply other threads:[~2021-06-09 18:17 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-06-09 7:24 [PATCH -next v2] media: staging: atomisp: use list_move_tail instead of list_del/list_add_tail in atomisp_compat_css20.c Baokun Li
2021-06-09 18:17 ` Andy Shevchenko [this message]
2021-06-11 7:19 ` 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='CAHp75VesvRMGY25WP-ZQaqWE-kyyp25GsvM8h=yMfO5U6r1gDA@mail.gmail.com' \
--to=andy.shevchenko@gmail.com \
--cc=andriy.shevchenko@linux.intel.com \
--cc=gregkh@linuxfoundation.org \
--cc=gustavoars@kernel.org \
--cc=hulkci@huawei.com \
--cc=kaixuxia@tencent.com \
--cc=kernel-janitors@vger.kernel.org \
--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).