From patchwork Thu Jan 4 12:57:02 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Suganath Prabu S X-Patchwork-Id: 10144697 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id A33A26034B for ; Thu, 4 Jan 2018 12:57:42 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9115A2817F for ; Thu, 4 Jan 2018 12:57:42 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 85FA528635; Thu, 4 Jan 2018 12:57:42 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1C0CB2817F for ; Thu, 4 Jan 2018 12:57:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752713AbeADM5l (ORCPT ); Thu, 4 Jan 2018 07:57:41 -0500 Received: from mail-qk0-f194.google.com ([209.85.220.194]:33442 "EHLO mail-qk0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752690AbeADM5i (ORCPT ); Thu, 4 Jan 2018 07:57:38 -0500 Received: by mail-qk0-f194.google.com with SMTP id x7so1786080qkb.0 for ; Thu, 04 Jan 2018 04:57:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=EbuVnGebmg3kbF0NATA9ao0x3OhuIiRnr3rr2I794GY=; b=JDqBgRUNnMgr98itRx1PMBhFuERY7rweS68zZVESlagWJOcysvk8KYj4wHm4A86iW5 8pi1RBcdx61LbzwPUq1jaEsMeWGmrSHhNuYbdoAYtvuVgjJQ31YYGfZdXPx/nun6mqE6 7G7gYeM969KaoR4FEi2Sz3SSGPemBXreOndX0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=EbuVnGebmg3kbF0NATA9ao0x3OhuIiRnr3rr2I794GY=; b=pn04uyPp6QKvCXXBFterbS+pArgRkBLDKjP7QeBhqImqXKcQV3H2upUQPlYbav5O1O 62tm1EDz7GAeF3+VkwsRQ7lqMYzLMQdUYkNxnP/TgDoOoa+Hg0Chnkvd+JuJUUU8qBme b4y1URsR+wM/SFJ1eU9qiqTmzQMwV6TVzjwM5lz1YaPr9en70vD4iaL6uAUqQUPSTWEM hhkMrNHQ4WiO1bcw7mIZogiYMae9pvI/63Q8Smq1AR5umqkBGqUi593x9CNI18cPqrk7 UVk8KC8fU3PJK/HV4LTDsUgFpU6p/KBWYUtq3OX1cGgRTl9H61Uy8MrPnlDnfQxE2Z9i 6Ehw== X-Gm-Message-State: AKGB3mKoOuA184VbeAgEbJNylfR71MEcyG6Qr/Lm96aZytPzWXYJauXz 0Mzb93HSYJNP6Txp7b8SpAKAvr45 X-Google-Smtp-Source: ACJfBovaiMw5rotNK1BswdKsLSv8AeL44sMIJOjg0a2/VRhTAloQEWUNIWhVh4gE5ZOIgdb65pYZ2A== X-Received: by 10.55.22.170 with SMTP id 42mr6055753qkw.89.1515070658056; Thu, 04 Jan 2018 04:57:38 -0800 (PST) Received: from dhcp-135-24-192-103.dhcp.broadcom.net ([192.19.239.250]) by smtp.googlemail.com with ESMTPSA id v58sm2064328qtk.18.2018.01.04.04.57.34 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 04 Jan 2018 04:57:37 -0800 (PST) From: Suganath Prabu S To: linux-scsi@vger.kernel.org, linux-nvme@lists.infradead.org Cc: Sathya.Prakash@broadcom.com, sreekanth.reddy@broadcom.com, chaitra.basappa@broadcom.com, Hannes Reinecke , Hannes Reinecke , Suganath Prabu S Subject: [Resend 02/11] mpt3sas: use list_splice_init() Date: Thu, 4 Jan 2018 04:57:02 -0800 Message-Id: <1515070631-14740-3-git-send-email-suganath-prabu.subramani@broadcom.com> X-Mailer: git-send-email 2.5.5 In-Reply-To: <1515070631-14740-1-git-send-email-suganath-prabu.subramani@broadcom.com> References: <1515070631-14740-1-git-send-email-suganath-prabu.subramani@broadcom.com> Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Hannes Reinecke Use 'list_splice_init()' instead of hand-crafted function. No functional change. Signed-off-by: Hannes Reinecke Signed-off-by: Suganath Prabu S --- drivers/scsi/mpt3sas/mpt3sas_base.c | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/drivers/scsi/mpt3sas/mpt3sas_base.c b/drivers/scsi/mpt3sas/mpt3sas_base.c index e3857e5..464a11e 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;