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-next>] [day] [month] [year] [list]
Message-ID: <20210609072409.1357327-1-libaokun1@huawei.com>
Date:   Wed, 9 Jun 2021 15:24:09 +0800
From:   Baokun Li <libaokun1@...wei.com>
To:     <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>
CC:     <weiyongjun1@...wei.com>, <yuehaibing@...wei.com>,
        <yangjihong1@...wei.com>, <yukuai3@...wei.com>,
        <libaokun1@...wei.com>, <linux-media@...r.kernel.org>,
        <linux-staging@...ts.linux.dev>, <kernel-janitors@...r.kernel.org>,
        Hulk Robot <hulkci@...wei.com>
Subject: [PATCH -next v2] media: staging: atomisp: use list_move_tail instead of list_del/list_add_tail in atomisp_compat_css20.c

Using list_move_tail() instead of list_del() + list_add_tail() in atomisp_compat_css20.c.

Reported-by: Hulk Robot <hulkci@...wei.com>
Signed-off-by: Baokun Li <libaokun1@...wei.com>
---
V1->V2:
	CC mailist

 .../pci/atomisp_compat_css20.c        | 15 +++++----------
 1 file changed, 5 insertions(+), 10 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..3bd4c616655d 100644
--- a/drivers/staging/media/atomisp/pci/atomisp_compat_css20.c
+++ b/drivers/staging/media/atomisp/pci/atomisp_compat_css20.c
@@ -2147,22 +2147,19 @@ void atomisp_css_stop(struct atomisp_sub_device *asd,
 	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);
 	}
 
 	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_move_tail(&dis_buf->list, &asd->dis_stats);
 	}
 	asd->params.dis_proj_data_valid = false;
 	spin_unlock_irqrestore(&asd->dis_stats_lock, irqflags);
@@ -2171,14 +2168,12 @@ void atomisp_css_stop(struct atomisp_sub_device *asd,
 		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