lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <bce97c2b-9bf1-ee78-6c7a-93285d02d0d7@huawei.com>
Date:   Fri, 11 Jun 2021 15:19:46 +0800
From:   "libaokun (A)" <libaokun1@...wei.com>
To:     Andy Shevchenko <andy.shevchenko@...il.com>
CC:     Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
        "Mauro Carvalho Chehab" <mchehab@...nel.org>,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        Sakari Ailus <sakari.ailus@...ux.intel.com>,
        Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
        Kaixu Xia <kaixuxia@...cent.com>,
        "Gustavo A. R. Silva" <gustavoars@...nel.org>,
        Wei Yongjun <weiyongjun1@...wei.com>,
        YueHaibing <yuehaibing@...wei.com>, <yangjihong1@...wei.com>,
        <yukuai3@...wei.com>,
        Linux Media Mailing List <linux-media@...r.kernel.org>,
        <linux-staging@...ts.linux.dev>,
        kernel-janitors <kernel-janitors@...r.kernel.org>,
        Hulk Robot <hulkci@...wei.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

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@...wei.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]);
>>                  }

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ