diff options
author | Hannes Reinecke <hare@suse.de> | 2018-01-04 13:57:02 +0100 |
---|---|---|
committer | Martin K. Petersen <martin.petersen@oracle.com> | 2018-01-11 05:24:59 +0100 |
commit | 05303dfb738066ad597d7feb422ff9fa2d3d8ef3 (patch) | |
tree | 982d2483bbb24463b15cd551128d1d0a28fb2fd6 /drivers/scsi/mpt3sas | |
parent | scsi: mpt3sas: set default value for cb_idx (diff) | |
download | linux-05303dfb738066ad597d7feb422ff9fa2d3d8ef3.tar.xz linux-05303dfb738066ad597d7feb422ff9fa2d3d8ef3.zip |
scsi: mpt3sas: use list_splice_init()
Use 'list_splice_init()' instead of hand-crafted function. No
functional change.
Signed-off-by: Hannes Reinecke <hare@suse.com>
Signed-off-by: Suganath Prabu S <suganath-prabu.subramani@broadcom.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/scsi/mpt3sas')
-rw-r--r-- | drivers/scsi/mpt3sas/mpt3sas_base.c | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/drivers/scsi/mpt3sas/mpt3sas_base.c b/drivers/scsi/mpt3sas/mpt3sas_base.c index e3857e5fb8ab..464a11e29113 100644 --- a/drivers/scsi/mpt3sas/mpt3sas_base.c +++ b/drivers/scsi/mpt3sas/mpt3sas_base.c @@ -2885,20 +2885,13 @@ mpt3sas_base_free_smid(struct MPT3SAS_ADAPTER *ioc, u16 smid) { unsigned long flags; int i; - struct chain_tracker *chain_req, *next; spin_lock_irqsave(&ioc->scsi_lookup_lock, flags); if (smid < ioc->hi_priority_smid) { /* scsiio queue */ i = smid - 1; - if (!list_empty(&ioc->scsi_lookup[i].chain_list)) { - list_for_each_entry_safe(chain_req, next, - &ioc->scsi_lookup[i].chain_list, tracker_list) { - list_del_init(&chain_req->tracker_list); - list_add(&chain_req->tracker_list, - &ioc->free_chain_list); - } - } + list_splice_init(&ioc->scsi_lookup[i].chain_list, + &ioc->free_chain_list); ioc->scsi_lookup[i].cb_idx = 0xFF; ioc->scsi_lookup[i].scmd = NULL; ioc->scsi_lookup[i].direct_io = 0; |