From patchwork Fri Dec 22 07:31:38 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Suganath Prabu S X-Patchwork-Id: 10128899 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 055C560318 for ; Fri, 22 Dec 2017 07:32:22 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EC89A29EE0 for ; Fri, 22 Dec 2017 07:32:21 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E14CD29FCE; Fri, 22 Dec 2017 07:32:21 +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 9B9D029EE0 for ; Fri, 22 Dec 2017 07:32:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753948AbdLVHcV (ORCPT ); Fri, 22 Dec 2017 02:32:21 -0500 Received: from mail-wr0-f195.google.com ([209.85.128.195]:34189 "EHLO mail-wr0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753652AbdLVHcU (ORCPT ); Fri, 22 Dec 2017 02:32:20 -0500 Received: by mail-wr0-f195.google.com with SMTP id y21so27146174wrc.1 for ; Thu, 21 Dec 2017 23:32:19 -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=3rVa/268DsaR0FX4kkeAsWpToFAUSvezcttOfNGJ1gc=; b=Cx2Rc6m5WGMLQ7Pkg6japDHLoI8PiCaFB8LdTCrR8jgTf0s+NEb5RnM4Y25BjBtcow scOxvo3k9NR6/2V4ShaQdPIYunjlurvBJnQEEoZ2L72xaS/eYfr0A9q7cB29EwY6sy9c 8/eNEKoAyLuNgCVO3i/Obw4P3B4EY5y7WI6X0= 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=3rVa/268DsaR0FX4kkeAsWpToFAUSvezcttOfNGJ1gc=; b=CHxpXgwN1FyB4EPUGfl/VDMlSFu4apTkfZssL5D9HkGRwKL56JvCERqByFw1o71iro TEMVny0Tdt51pi8XvA/2P2xcFhTQtLyiJ1oxv13r/y8lfMkUM/6tX5FGK5aMUgr4qjwt dbDtdkUdAgqPxrTNanxt5wZHLha8O9c8XthmD3SZKfscaNDnH3PXuNLR0qWF5ZpABS33 pHemK+RRgQPWQg4TVb2cyHfz50AH/uwKRPZO3KcHIqfttco+Haj5dDsqK9U9w3w4FqTn ifxAJDspS9n1Qh1qLyYUa8I6uOgkYs4/C/z8WR3/t7sy5lxxQGZFhs+OcpBDZox/wBAC qeFA== X-Gm-Message-State: AKGB3mIY/Pj1tN3n99mJim4oWFU6vXTDqDVWWUYYHNE3gNcDK08BLspQ WZiVE62wcJ3uPW3jxyFNbdgu2h9h X-Google-Smtp-Source: ACJfBot4sOtqujQHTIAIYbxKTvNWfFAIJtTIa63MsdxlRtpyKZGHlFNeQr49kMIHMS3IOAwYo4gecg== X-Received: by 10.223.199.20 with SMTP id k20mr3333131wrg.78.1513927938908; Thu, 21 Dec 2017 23:32:18 -0800 (PST) Received: from dhcp-135-24-192-103.dhcp.broadcom.net ([192.19.239.250]) by smtp.googlemail.com with ESMTPSA id b7sm10379462wrd.69.2017.12.21.23.32.14 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 21 Dec 2017 23:32:18 -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, Hannes Reinecke , Suganath Prabu S , Chaitra P B Subject: [PATCH 02/11] mpt3sas: use list_splice_init() Date: Thu, 21 Dec 2017 23:31:38 -0800 Message-Id: <1513927907-19735-3-git-send-email-suganath-prabu.subramani@broadcom.com> X-Mailer: git-send-email 2.5.5 In-Reply-To: <1513927907-19735-1-git-send-email-suganath-prabu.subramani@broadcom.com> References: <1513927907-19735-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: Suganath Prabu S Signed-off-by: Chaitra P B --- 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 0119a39..5a9ad26 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;