diff mbox series

[-next,v2] scsi: qla2xxx: Use list_move_tail instead of list_del/list_add_tail in qla_target.c

Message ID 20210609072321.1356896-1-libaokun1@huawei.com
State New
Headers show
Series [-next,v2] scsi: qla2xxx: Use list_move_tail instead of list_del/list_add_tail in qla_target.c | expand

Commit Message

libaokun (A) June 9, 2021, 7:23 a.m. UTC
Using list_move_tail() instead of list_del() + list_add_tail() in qla_target.c.

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

 drivers/scsi/qla2xxx/qla_target.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

Comments

Himanshu Madhani June 10, 2021, 2:32 p.m. UTC | #1
On 6/9/21 2:23 AM, Baokun Li wrote:
> Using list_move_tail() instead of list_del() + list_add_tail() in qla_target.c.

> 

> Reported-by: Hulk Robot <hulkci@huawei.com>

> Signed-off-by: Baokun Li <libaokun1@huawei.com>

> ---

> V1->V2:

> 	CC mailist

> 

>   drivers/scsi/qla2xxx/qla_target.c | 3 +--

>   1 file changed, 1 insertion(+), 2 deletions(-)

> 

> diff --git a/drivers/scsi/qla2xxx/qla_target.c b/drivers/scsi/qla2xxx/qla_target.c

> index 12a6848ade43..eb47140a899f 100644

> --- a/drivers/scsi/qla2xxx/qla_target.c

> +++ b/drivers/scsi/qla2xxx/qla_target.c

> @@ -5481,8 +5481,7 @@ qlt_free_qfull_cmds(struct qla_qpair *qpair)

>   			    "%s: Unexpected cmd in QFull list %p\n", __func__,

>   			    cmd);

>   

> -		list_del(&cmd->cmd_list);

> -		list_add_tail(&cmd->cmd_list, &free_list);

> +		list_move_tail(&cmd->cmd_list, &free_list);

>   

>   		/* piggy back on hardware_lock for protection */

>   		vha->hw->tgt.num_qfull_cmds_alloc--;

> 


Reviewed-by: Himanshu Madhani <himanshu.madhani@oracle.com>


-- 
Himanshu Madhani                                Oracle Linux Engineering
Martin K. Petersen June 16, 2021, 2:39 a.m. UTC | #2
Baokun,

> Using list_move_tail() instead of list_del() + list_add_tail() in

> qla_target.c.


Applied to 5.14/scsi-staging, thanks!

-- 
Martin K. Petersen	Oracle Linux Engineering
diff mbox series

Patch

diff --git a/drivers/scsi/qla2xxx/qla_target.c b/drivers/scsi/qla2xxx/qla_target.c
index 12a6848ade43..eb47140a899f 100644
--- a/drivers/scsi/qla2xxx/qla_target.c
+++ b/drivers/scsi/qla2xxx/qla_target.c
@@ -5481,8 +5481,7 @@  qlt_free_qfull_cmds(struct qla_qpair *qpair)
 			    "%s: Unexpected cmd in QFull list %p\n", __func__,
 			    cmd);
 
-		list_del(&cmd->cmd_list);
-		list_add_tail(&cmd->cmd_list, &free_list);
+		list_move_tail(&cmd->cmd_list, &free_list);
 
 		/* piggy back on hardware_lock for protection */
 		vha->hw->tgt.num_qfull_cmds_alloc--;