From patchwork Thu Aug 10 16:09:31 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Garry X-Patchwork-Id: 109836 Delivered-To: patch@linaro.org Received: by 10.182.109.195 with SMTP id hu3csp2568212obb; Thu, 10 Aug 2017 08:49:27 -0700 (PDT) X-Received: by 10.99.113.14 with SMTP id m14mr12097003pgc.185.1502380167353; Thu, 10 Aug 2017 08:49:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1502380167; cv=none; d=google.com; s=arc-20160816; b=Z3wuvsdw8N8VV/FHMqyJC+lUNqsNhuJuj7LkbwesVaTyDkIxfysU+iioEAaU3gln3J EU4iyzJHHcWO82ZSGev856xL5yZ5dct2Ysu97Qu1Ie4Ve/xecAtcnwL9/6rqsEbiTaHx a9bU5osMDuwFWYWs/iyps+GjqVrZEMe1cGUSVmCZWlWAPAysH5Sm909Y5xo7sXvkCr5u eDmjEoJJOvPH0ikyC7+OAk9p7V8AzuTZ4ufkTRbTw9kqi0KUuiwJm0V3n04hzgMJAjcs vPO3GqBd4v8B2zBJ4zQHxjAs8drda5TWye1Oh+3ebiufPTef4X7l7G3CguDfnhkWkyfc Hjfw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:arc-authentication-results; bh=fL04EGwzh8u9DcOySEVIINaaopjqnEDu56JzhdQEIVE=; b=P1K8HHFsN4mjxLWvmEdwTJ5bSWtDwvfe54xpdeOvFG/HnSCrYmaXqJ38Z9O8B0kTLJ EFEG3fOHY3fdDPOhslOwVpVD2JbGmQjncx1t0V/udn7p0h6AQVt1EObxHDEz15YRi5ZE 5ykxZD28GWKdCGyMIBP3ObYGPJoLpgWJRGn3amCpHMpFp8fqcpCyElTOYyiTg8Gfrm7+ SzIEkkLAd/89bKjoHuRs3BWfMHbVyn3FtVViKYfVzYJh2tm6+pbUe0z+yGOKqaP0nRCp pH079iFhECzsU16aE52cij9BM4W0yrYNxVl0mk/T49VSQic2RV+Pz8TKTKgbUfc7vVm4 PpVw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w5si4115861pgt.227.2017.08.10.08.49.27; Thu, 10 Aug 2017 08:49:27 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753281AbdHJPtK (ORCPT + 25 others); Thu, 10 Aug 2017 11:49:10 -0400 Received: from szxga05-in.huawei.com ([45.249.212.191]:3048 "EHLO szxga05-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752894AbdHJPmu (ORCPT ); Thu, 10 Aug 2017 11:42:50 -0400 Received: from 172.30.72.59 (EHLO DGGEMS402-HUB.china.huawei.com) ([172.30.72.59]) by dggrg05-dlp.huawei.com (MOS 4.4.6-GA FastPath queued) with ESMTP id DEY38519; Thu, 10 Aug 2017 23:42:46 +0800 (CST) Received: from localhost.localdomain (10.67.212.75) by DGGEMS402-HUB.china.huawei.com (10.3.19.202) with Microsoft SMTP Server id 14.3.301.0; Thu, 10 Aug 2017 23:42:37 +0800 From: John Garry To: , CC: , , , , Xiang Chen , John Garry Subject: [PATCH 06/19] scsi: hisi_sas: remove repeated device config in v2 hw Date: Fri, 11 Aug 2017 00:09:31 +0800 Message-ID: <1502381384-219889-7-git-send-email-john.garry@huawei.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1502381384-219889-1-git-send-email-john.garry@huawei.com> References: <1502381384-219889-1-git-send-email-john.garry@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.67.212.75] X-CFilter-Loop: Reflected X-Mirapoint-Virus-RAPID-Raw: score=unknown(0), refid=str=0001.0A090206.598C7EF8.005E, ss=1, re=0.000, recu=0.000, reip=0.000, cl=1, cld=1, fgs=0, ip=0.0.0.0, so=2014-11-16 11:51:01, dmn=2013-03-21 17:37:32 X-Mirapoint-Loop-Id: d8a42df23d008ae44084f32cce45f591 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Xiang Chen This patch removes some repeated configurations: (1) The device id of the device is already set in the alloc function, so we don't need to modify in free device function. (2) Field dev_type and dev_status are configured in hisi_sas_dev_gone(), so there is no need for repeated config in free_device_v3_hw. Signed-off-by: Xiang Chen Signed-off-by: John Garry --- drivers/scsi/hisi_sas/hisi_sas_main.c | 3 --- drivers/scsi/hisi_sas/hisi_sas_v3_hw.c | 2 -- 2 files changed, 5 deletions(-) -- 1.9.1 diff --git a/drivers/scsi/hisi_sas/hisi_sas_main.c b/drivers/scsi/hisi_sas/hisi_sas_main.c index aaa7296..81ad6cd 100644 --- a/drivers/scsi/hisi_sas/hisi_sas_main.c +++ b/drivers/scsi/hisi_sas/hisi_sas_main.c @@ -716,7 +716,6 @@ static void hisi_sas_dev_gone(struct domain_device *device) struct hisi_sas_device *sas_dev = device->lldd_dev; struct hisi_hba *hisi_hba = dev_to_hisi_hba(device); struct device *dev = hisi_hba->dev; - int dev_id = sas_dev->device_id; dev_info(dev, "found dev[%d:%x] is gone\n", sas_dev->device_id, sas_dev->dev_type); @@ -729,9 +728,7 @@ static void hisi_sas_dev_gone(struct domain_device *device) hisi_hba->hw->free_device(hisi_hba, sas_dev); device->lldd_dev = NULL; memset(sas_dev, 0, sizeof(*sas_dev)); - sas_dev->device_id = dev_id; sas_dev->dev_type = SAS_PHY_UNUSED; - sas_dev->dev_status = HISI_SAS_DEV_NORMAL; } static int hisi_sas_queue_command(struct sas_task *task, gfp_t gfp_flags) diff --git a/drivers/scsi/hisi_sas/hisi_sas_v3_hw.c b/drivers/scsi/hisi_sas/hisi_sas_v3_hw.c index 83d2dca..dc5c551 100644 --- a/drivers/scsi/hisi_sas/hisi_sas_v3_hw.c +++ b/drivers/scsi/hisi_sas/hisi_sas_v3_hw.c @@ -578,8 +578,6 @@ static void free_device_v3_hw(struct hisi_hba *hisi_hba, memset(itct, 0, sizeof(struct hisi_sas_itct)); hisi_sas_write32(hisi_hba, ENT_INT_SRC3, ENT_INT_SRC3_ITC_INT_MSK); - hisi_hba->devices[dev_id].dev_type = SAS_PHY_UNUSED; - hisi_hba->devices[dev_id].dev_status = HISI_SAS_DEV_NORMAL; /* clear the itct */ hisi_sas_write32(hisi_hba, ITCT_CLR, 0);