2021-06-08 00:36:22

by Zou Wei

[permalink] [raw]
Subject: [PATCH -next] scsi: lpfc: Use list_move_tail instead of list_del/list_add_tail

Using list_move_tail() instead of list_del() + list_add_tail().

Reported-by: Hulk Robot <[email protected]>
Signed-off-by: Zou Wei <[email protected]>
---
drivers/scsi/lpfc/lpfc_sli.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/scsi/lpfc/lpfc_sli.c b/drivers/scsi/lpfc/lpfc_sli.c
index e2cfb86..84a9101 100644
--- a/drivers/scsi/lpfc/lpfc_sli.c
+++ b/drivers/scsi/lpfc/lpfc_sli.c
@@ -20162,8 +20162,7 @@ lpfc_cleanup_pending_mbox(struct lpfc_vport *vport)
(mb->u.mb.mbxCommand != MBX_REG_VPI))
continue;

- list_del(&mb->list);
- list_add_tail(&mb->list, &mbox_cmd_list);
+ list_move_tail(&mb->list, &mbox_cmd_list);
}
/* Clean up active mailbox command with the vport */
mb = phba->sli.mbox_active;
--
2.6.2


2021-06-08 15:47:40

by James Smart

[permalink] [raw]
Subject: Re: [PATCH -next] scsi: lpfc: Use list_move_tail instead of list_del/list_add_tail

On 6/7/2021 5:51 PM, Zou Wei wrote:
> Using list_move_tail() instead of list_del() + list_add_tail().
>
> Reported-by: Hulk Robot <[email protected]>
> Signed-off-by: Zou Wei <[email protected]>
> ---
> drivers/scsi/lpfc/lpfc_sli.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/drivers/scsi/lpfc/lpfc_sli.c b/drivers/scsi/lpfc/lpfc_sli.c
> index e2cfb86..84a9101 100644
> --- a/drivers/scsi/lpfc/lpfc_sli.c
> +++ b/drivers/scsi/lpfc/lpfc_sli.c
> @@ -20162,8 +20162,7 @@ lpfc_cleanup_pending_mbox(struct lpfc_vport *vport)
> (mb->u.mb.mbxCommand != MBX_REG_VPI))
> continue;
>
> - list_del(&mb->list);
> - list_add_tail(&mb->list, &mbox_cmd_list);
> + list_move_tail(&mb->list, &mbox_cmd_list);
> }
> /* Clean up active mailbox command with the vport */
> mb = phba->sli.mbox_active;
>

Thanks

Reviewed-by: James Smart <[email protected]>

-- james

2021-06-16 02:28:23

by Martin K. Petersen

[permalink] [raw]
Subject: Re: [PATCH -next] scsi: lpfc: Use list_move_tail instead of list_del/list_add_tail


Zou,

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

Applied to 5.14/scsi-staging, thanks!

--
Martin K. Petersen Oracle Linux Engineering