Commit c90a0bea authored by John Garry's avatar John Garry Committed by Martin K. Petersen

scsi: hisi_sas: remove some unneeded structure members

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: default avatarJohn Garry <john.garry@huawei.com>
Reviewed-by: default avatarXiang Chen <chenxiang66@hisilicon.com>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent 381ed6c0
...@@ -137,7 +137,6 @@ struct hisi_sas_phy { ...@@ -137,7 +137,6 @@ struct hisi_sas_phy {
struct asd_sas_phy sas_phy; struct asd_sas_phy sas_phy;
struct sas_identify identify; struct sas_identify identify;
u64 port_id; /* from hw */ u64 port_id; /* from hw */
u64 dev_sas_addr;
u64 frame_rcvd_size; u64 frame_rcvd_size;
u8 frame_rcvd[32]; u8 frame_rcvd[32];
u8 phy_attached; u8 phy_attached;
...@@ -174,7 +173,6 @@ struct hisi_sas_device { ...@@ -174,7 +173,6 @@ struct hisi_sas_device {
struct completion *completion; struct completion *completion;
struct hisi_sas_dq *dq; struct hisi_sas_dq *dq;
struct list_head list; struct list_head list;
u64 attached_phy;
enum sas_device_type dev_type; enum sas_device_type dev_type;
int device_id; int device_id;
int sata_idx; int sata_idx;
...@@ -440,7 +438,6 @@ extern struct scsi_transport_template *hisi_sas_stt; ...@@ -440,7 +438,6 @@ extern struct scsi_transport_template *hisi_sas_stt;
extern struct scsi_host_template *hisi_sas_sht; extern struct scsi_host_template *hisi_sas_sht;
extern void hisi_sas_stop_phys(struct hisi_hba *hisi_hba); 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 int hisi_sas_alloc(struct hisi_hba *hisi_hba, struct Scsi_Host *shost);
extern void hisi_sas_free(struct hisi_hba *hisi_hba); extern void hisi_sas_free(struct hisi_hba *hisi_hba);
extern u8 hisi_sas_get_ata_protocol(struct host_to_dev_fis *fis, extern u8 hisi_sas_get_ata_protocol(struct host_to_dev_fis *fis,
......
...@@ -577,10 +577,8 @@ static int hisi_sas_dev_found(struct domain_device *device) ...@@ -577,10 +577,8 @@ static int hisi_sas_dev_found(struct domain_device *device)
for (phy_no = 0; phy_no < phy_num; phy_no++) { for (phy_no = 0; phy_no < phy_num; phy_no++) {
phy = &parent_dev->ex_dev.ex_phy[phy_no]; phy = &parent_dev->ex_dev.ex_phy[phy_no];
if (SAS_ADDR(phy->attached_sas_addr) == if (SAS_ADDR(phy->attached_sas_addr) ==
SAS_ADDR(device->sas_addr)) { SAS_ADDR(device->sas_addr))
sas_dev->attached_phy = phy_no;
break; break;
}
} }
if (phy_no == phy_num) { if (phy_no == phy_num) {
...@@ -2079,17 +2077,6 @@ static struct Scsi_Host *hisi_sas_shost_alloc(struct platform_device *pdev, ...@@ -2079,17 +2077,6 @@ static struct Scsi_Host *hisi_sas_shost_alloc(struct platform_device *pdev,
return NULL; 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, int hisi_sas_probe(struct platform_device *pdev,
const struct hisi_sas_hw *hw) const struct hisi_sas_hw *hw)
{ {
...@@ -2143,8 +2130,6 @@ int hisi_sas_probe(struct platform_device *pdev, ...@@ -2143,8 +2130,6 @@ int hisi_sas_probe(struct platform_device *pdev,
sha->sas_port[i] = &hisi_hba->port[i].sas_port; sha->sas_port[i] = &hisi_hba->port[i].sas_port;
} }
hisi_sas_init_add(hisi_hba);
rc = scsi_add_host(shost, &pdev->dev); rc = scsi_add_host(shost, &pdev->dev);
if (rc) if (rc)
goto err_out_ha; goto err_out_ha;
......
...@@ -2134,8 +2134,6 @@ hisi_sas_v3_probe(struct pci_dev *pdev, const struct pci_device_id *id) ...@@ -2134,8 +2134,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; sha->sas_port[i] = &hisi_hba->port[i].sas_port;
} }
hisi_sas_init_add(hisi_hba);
rc = scsi_add_host(shost, dev); rc = scsi_add_host(shost, dev);
if (rc) if (rc)
goto err_out_ha; goto err_out_ha;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment