]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commitdiff
scsi: hisi_sas: remove some unneeded structure members
authorJohn Garry <john.garry@huawei.com>
Fri, 23 Mar 2018 16:05:15 +0000 (00:05 +0800)
committerKleber Sacilotto de Souza <kleber.souza@canonical.com>
Mon, 14 Jan 2019 09:28:55 +0000 (09:28 +0000)
BugLink: https://bugs.launchpad.net/bugs/1810457
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 <john.garry@huawei.com>
Reviewed-by: Xiang Chen <chenxiang66@hisilicon.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit c90a0bea4f645d561b87becd2bd99f7934402510)
Signed-off-by: dann frazier <dann.frazier@canonical.com>
Acked-by: Stefan Bader <stefan.bader@canonical.com>
Acked-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
drivers/scsi/hisi_sas/hisi_sas.h
drivers/scsi/hisi_sas/hisi_sas_main.c
drivers/scsi/hisi_sas/hisi_sas_v3_hw.c

index a236b4a64241140be5445e1659338f5dbaabdc5b..0ecb56d4d04a17609650fb19b10a5d388fd965e4 100644 (file)
@@ -140,7 +140,6 @@ struct hisi_sas_phy {
        struct completion *reset_completion;
        spinlock_t lock;
        u64             port_id; /* from hw */
-       u64             dev_sas_addr;
        u64             frame_rcvd_size;
        u8              frame_rcvd[32];
        u8              phy_attached;
@@ -178,7 +177,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;
@@ -454,7 +452,6 @@ struct hisi_sas_slot_buf_table {
 
 extern struct scsi_transport_template *hisi_sas_stt;
 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,
index df50d9fb34074365a0cf55050ee247d9d284d8c6..edaddc0b74386cf3ed473eed5bd486c19652e2a9 100644 (file)
@@ -679,10 +679,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) {
@@ -2295,17 +2293,6 @@ err_out:
        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)
 {
@@ -2359,8 +2346,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;
index 7a5a028d3f2168080397760b582b4d09ea60328c..f8ea3759b50d26a84d2090176e0b3e2048c794f2 100644 (file)
@@ -2277,8 +2277,6 @@ hisi_sas_v3_probe(struct pci_dev *pdev, const struct pci_device_id *id)
                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;