From patchwork Fri Mar 23 16:05:15 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Garry X-Patchwork-Id: 132346 Delivered-To: patch@linaro.org Received: by 10.46.84.29 with SMTP id i29csp776687ljb; Fri, 23 Mar 2018 09:06:07 -0700 (PDT) X-Google-Smtp-Source: AG47ELt9DWeF+DgX1LIe0wYEQ1vYxr79SrVut17iHV1hzM0Pob/v4pOuOBgshGbgYZwek7Kh2DDj X-Received: by 2002:a17:902:2805:: with SMTP id e5-v6mr22245799plb.89.1521821167397; Fri, 23 Mar 2018 09:06:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521821167; cv=none; d=google.com; s=arc-20160816; b=NOzWhA5b6sExj4SQN3GYPWOdL4LSD6Bi+QbWfuQ8CgSS24Tm+FfbsIBRes+txzt0bP 9noX6zWdilvlyN2FzWMknQspHcZKuGBFtgk3E8WAcB1M7PCBm0yKvHgC7Cmz+t7axCPX seojnc19Ze6dJQitU6EqizXI3QSoPrJWtkaMCaDy8fza6GDbyTGyTOM3TONYWz+s7WEY agiMYflMSJjcQecz5QJIGg8ZB5EpH6Ew36tSbhNQWllktP+GCnYx1E7bUFPELA4Wl/1R H0HvN5ZNU9PlVrWQim2Du1DwtWKjyVA9QHt6Am0nYyUl12tRRxowXLQBv+Ph+zImnHs8 wZEQ== 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=qvrL3o2zbRJIqmpfNSobcndF8j+h+lS5tCVV9xz4TFk=; b=UFu7eLHm0IwFV8E312aBgTIslfJvTyHQWO6jTuhHQx4s70WaA82BOff+adRkBGEn0e +K2vaqLMqXrTgzXBDHCzUl0nNRAquW3zm8kN6eAzfsQwkJnC3bNyr71qB6+S7ulUV6Nd PAYwszVT1EQlOf5d4cUhHklU0XFHeLpDAVMC3iOfZvn1/Rfyvh8Yh/TO0pMFUOY4Tx+u ev8xd9XPAExXYq3/h6WeTpl4CAsXjgrTqkNZraOTWt4Aud6xxu5EQSSpihb9W+xCRT77 W/mGBS1OBIkz3i2K/1RWtY4+FsSaaSQ6eFVJdb8uFdB5PU2VhJKPcvZWNJnFwVY89xBU gHcA== 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 a33-v6si3718802pla.618.2018.03.23.09.06.07; Fri, 23 Mar 2018 09:06:07 -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 S1752163AbeCWQGE (ORCPT + 28 others); Fri, 23 Mar 2018 12:06:04 -0400 Received: from szxga07-in.huawei.com ([45.249.212.35]:53507 "EHLO huawei.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1751811AbeCWQGD (ORCPT ); Fri, 23 Mar 2018 12:06:03 -0400 Received: from DGGEMS413-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id 14068DB87F524; Sat, 24 Mar 2018 00:05:56 +0800 (CST) Received: from localhost.localdomain (10.67.212.75) by DGGEMS413-HUB.china.huawei.com (10.3.19.213) with Microsoft SMTP Server id 14.3.361.1; Sat, 24 Mar 2018 00:05:46 +0800 From: John Garry To: , CC: , , , John Garry Subject: [PATCH 8/8] scsi: hisi_sas: remove some unneeded structure members Date: Sat, 24 Mar 2018 00:05:15 +0800 Message-ID: <1521821115-120040-9-git-send-email-john.garry@huawei.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1521821115-120040-1-git-send-email-john.garry@huawei.com> References: <1521821115-120040-1-git-send-email-john.garry@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.67.212.75] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This patch removes unneeded structure elements: - hisi_sas_phy.dev_sas_addr: only ever written - Also remove associated function which writes it, hisi_sas_init_add(). - hisi_sas_device.attached_phy: only ever written - Also remove code to set it in hisi_sas_dev_found() Signed-off-by: John Garry Reviewed-by: Xiang Chen --- drivers/scsi/hisi_sas/hisi_sas.h | 3 --- drivers/scsi/hisi_sas/hisi_sas_main.c | 17 +---------------- drivers/scsi/hisi_sas/hisi_sas_v3_hw.c | 2 -- 3 files changed, 1 insertion(+), 21 deletions(-) -- 1.9.1 diff --git a/drivers/scsi/hisi_sas/hisi_sas.h b/drivers/scsi/hisi_sas/hisi_sas.h index d1153e8..d413d05 100644 --- a/drivers/scsi/hisi_sas/hisi_sas.h +++ b/drivers/scsi/hisi_sas/hisi_sas.h @@ -137,7 +137,6 @@ struct hisi_sas_phy { struct asd_sas_phy sas_phy; struct sas_identify identify; u64 port_id; /* from hw */ - u64 dev_sas_addr; u64 frame_rcvd_size; u8 frame_rcvd[32]; u8 phy_attached; @@ -174,7 +173,6 @@ struct hisi_sas_device { struct completion *completion; struct hisi_sas_dq *dq; struct list_head list; - u64 attached_phy; enum sas_device_type dev_type; int device_id; int sata_idx; @@ -440,7 +438,6 @@ struct hisi_sas_slot_buf_table { extern struct scsi_host_template *hisi_sas_sht; extern void hisi_sas_stop_phys(struct hisi_hba *hisi_hba); -extern void hisi_sas_init_add(struct hisi_hba *hisi_hba); extern int hisi_sas_alloc(struct hisi_hba *hisi_hba, struct Scsi_Host *shost); extern void hisi_sas_free(struct hisi_hba *hisi_hba); extern u8 hisi_sas_get_ata_protocol(struct host_to_dev_fis *fis, diff --git a/drivers/scsi/hisi_sas/hisi_sas_main.c b/drivers/scsi/hisi_sas/hisi_sas_main.c index 8557fd0..d1a61b1 100644 --- a/drivers/scsi/hisi_sas/hisi_sas_main.c +++ b/drivers/scsi/hisi_sas/hisi_sas_main.c @@ -577,10 +577,8 @@ static int hisi_sas_dev_found(struct domain_device *device) for (phy_no = 0; phy_no < phy_num; phy_no++) { phy = &parent_dev->ex_dev.ex_phy[phy_no]; if (SAS_ADDR(phy->attached_sas_addr) == - SAS_ADDR(device->sas_addr)) { - sas_dev->attached_phy = phy_no; + SAS_ADDR(device->sas_addr)) break; - } } if (phy_no == phy_num) { @@ -2079,17 +2077,6 @@ static struct Scsi_Host *hisi_sas_shost_alloc(struct platform_device *pdev, return NULL; } -void hisi_sas_init_add(struct hisi_hba *hisi_hba) -{ - int i; - - for (i = 0; i < hisi_hba->n_phy; i++) - memcpy(&hisi_hba->phy[i].dev_sas_addr, - hisi_hba->sas_addr, - SAS_ADDR_SIZE); -} -EXPORT_SYMBOL_GPL(hisi_sas_init_add); - int hisi_sas_probe(struct platform_device *pdev, const struct hisi_sas_hw *hw) { @@ -2143,8 +2130,6 @@ int hisi_sas_probe(struct platform_device *pdev, sha->sas_port[i] = &hisi_hba->port[i].sas_port; } - hisi_sas_init_add(hisi_hba); - rc = scsi_add_host(shost, &pdev->dev); if (rc) goto err_out_ha; diff --git a/drivers/scsi/hisi_sas/hisi_sas_v3_hw.c b/drivers/scsi/hisi_sas/hisi_sas_v3_hw.c index 760724a..33735a7 100644 --- a/drivers/scsi/hisi_sas/hisi_sas_v3_hw.c +++ b/drivers/scsi/hisi_sas/hisi_sas_v3_hw.c @@ -2134,8 +2134,6 @@ static int soft_reset_v3_hw(struct hisi_hba *hisi_hba) sha->sas_port[i] = &hisi_hba->port[i].sas_port; } - hisi_sas_init_add(hisi_hba); - rc = scsi_add_host(shost, dev); if (rc) goto err_out_ha;