mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "libaokun (A)" <libaokun1@huawei.com>
To: Andy Shevchenko <andy.shevchenko@gmail.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: Fri, 11 Jun 2021 15:19:46 +0800	[thread overview]
Message-ID: <bce97c2b-9bf1-ee78-6c7a-93285d02d0d7@huawei.com> (raw)
In-Reply-To: <CAHp75VesvRMGY25WP-ZQaqWE-kyyp25GsvM8h=yMfO5U6r1gDA@mail.gmail.com>

Thank you for your advice. That's a great idea.

I'm about to send a patch v3 with the changes suggested by you.

Best Regards


在 2021/6/10 2:17, Andy Shevchenko 写道:
> 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]);
>>                  }

      reply	other threads:[~2021-06-11  7:19 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-09  7:24 Baokun Li
2021-06-09 18:17 ` Andy Shevchenko
2021-06-11  7:19   ` libaokun (A) [this message]

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=bce97c2b-9bf1-ee78-6c7a-93285d02d0d7@huawei.com \
    --to=libaokun1@huawei.com \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=andy.shevchenko@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=gustavoars@kernel.org \
    --cc=hulkci@huawei.com \
    --cc=kaixuxia@tencent.com \
    --cc=kernel-janitors@vger.kernel.org \
    --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

all inboxes | Powered by JetHome®