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>] [day] [month] [year] [list]
Message-ID: <20210609072548.1357835-1-libaokun1@huawei.com>
Date:   Wed, 9 Jun 2021 15:25:48 +0800
From:   Baokun Li <libaokun1@...wei.com>
To:     <linux-kernel@...r.kernel.org>,
        Anil Gurumurthy <anil.gurumurthy@...gic.com>,
        Sudarsana Kalluru <sudarsana.kalluru@...gic.com>,
        "James E.J. Bottomley" <jejb@...ux.ibm.com>,
        "Martin K. Petersen" <martin.petersen@...cle.com>
CC:     <weiyongjun1@...wei.com>, <yuehaibing@...wei.com>,
        <yangjihong1@...wei.com>, <yukuai3@...wei.com>,
        <libaokun1@...wei.com>, <linux-scsi@...r.kernel.org>,
        <kernel-janitors@...r.kernel.org>, Hulk Robot <hulkci@...wei.com>
Subject: [PATCH -next v2] scsi: bfa: Use list_move_tail instead of list_del/list_add_tail in bfa_svc.c

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

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

 drivers/scsi/bfa/bfa_svc.c | 15 +++++----------
 1 file changed, 5 insertions(+), 10 deletions(-)

diff --git a/drivers/scsi/bfa/bfa_svc.c b/drivers/scsi/bfa/bfa_svc.c
index 4e3cef02f10f..ae31a0605efe 100644
--- a/drivers/scsi/bfa/bfa_svc.c
+++ b/drivers/scsi/bfa/bfa_svc.c
@@ -1572,8 +1572,7 @@ bfa_lps_login_rsp(struct bfa_s *bfa, struct bfi_lps_login_rsp_s *rsp)
 		break;
 	}
 
-	list_del(&lps->qe);
-	list_add_tail(&lps->qe, &mod->lps_active_q);
+	list_move_tail(&lps->qe, &mod->lps_active_q);
 	bfa_sm_send_event(lps, BFA_LPS_SM_FWRSP);
 }
 
@@ -1594,8 +1593,7 @@ bfa_lps_no_res(struct bfa_lps_s *first_lps, u8 count)
 		lps = (struct bfa_lps_s *)qe;
 		bfa_trc(bfa, lps->bfa_tag);
 		lps->status = first_lps->status;
-		list_del(&lps->qe);
-		list_add_tail(&lps->qe, &mod->lps_active_q);
+		list_move_tail(&lps->qe, &mod->lps_active_q);
 		bfa_sm_send_event(lps, BFA_LPS_SM_FWRSP);
 		qe = qe_next;
 		count--;
@@ -1651,8 +1649,7 @@ bfa_lps_free(struct bfa_lps_s *lps)
 	struct bfa_lps_mod_s	*mod = BFA_LPS_MOD(lps->bfa);
 
 	lps->lp_pid = 0;
-	list_del(&lps->qe);
-	list_add_tail(&lps->qe, &mod->lps_free_q);
+	list_move_tail(&lps->qe, &mod->lps_free_q);
 }
 
 /*
@@ -1679,8 +1676,7 @@ bfa_lps_send_login(struct bfa_lps_s *lps)
 	m->auth_en	= lps->auth_en;
 
 	bfa_reqq_produce(lps->bfa, lps->reqq, m->mh);
-	list_del(&lps->qe);
-	list_add_tail(&lps->qe, &mod->lps_login_q);
+	list_move_tail(&lps->qe, &mod->lps_login_q);
 }
 
 /*
@@ -4877,8 +4873,7 @@ bfa_rport_free(struct bfa_rport_s *rport)
 	struct bfa_rport_mod_s *mod = BFA_RPORT_MOD(rport->bfa);
 
 	WARN_ON(!bfa_q_is_on_q(&mod->rp_active_q, rport));
-	list_del(&rport->qe);
-	list_add_tail(&rport->qe, &mod->rp_free_q);
+	list_move_tail(&rport->qe, &mod->rp_free_q);
 }
 
 static bfa_boolean_t

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ