Skip to content

Commit 1451455

Browse files
Merge patch series "libsas: Some tidy-up"
John Garry <john.g.garry@oracle.com> says: This series tidies-up libsas a bit, including: - delete structure(s) with only one member - delete structure members which are only ever set - delete structure members which are never set and code which relies on that member being set This conflicts with the following series: https://lore.kernel.org/linux-scsi/20230809132249.37948-1-yuehaibing@huawei.com/ Any conflict should be trivial to resolve. Based on mkp-scsi staging at a18e81d ("scsi: ufs: ufs-pci: Add support for QEMU") Link: https://lore.kernel.org/r/20230815115156.343535-1-john.g.garry@oracle.com Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2 parents ef5d681 + 8634449 commit 1451455

25 files changed

+59
-131
lines changed

drivers/scsi/aic94xx/aic94xx_hwi.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ static int asd_get_user_sas_addr(struct asd_ha_struct *asd_ha)
2828
if (asd_ha->hw_prof.sas_addr[0])
2929
return 0;
3030

31-
return sas_request_addr(asd_ha->sas_ha.core.shost,
31+
return sas_request_addr(asd_ha->sas_ha.shost,
3232
asd_ha->hw_prof.sas_addr);
3333
}
3434

@@ -72,10 +72,8 @@ static int asd_init_phy(struct asd_phy *phy)
7272
struct asd_sas_phy *sas_phy = &phy->sas_phy;
7373

7474
sas_phy->enabled = 1;
75-
sas_phy->class = SAS;
7675
sas_phy->iproto = SAS_PROTOCOL_ALL;
7776
sas_phy->tproto = 0;
78-
sas_phy->type = PHY_TYPE_PHYSICAL;
7977
sas_phy->role = PHY_ROLE_INITIATOR;
8078
sas_phy->oob_mode = OOB_NOT_CONNECTED;
8179
sas_phy->linkrate = SAS_LINK_RATE_UNKNOWN;

drivers/scsi/aic94xx/aic94xx_init.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -667,7 +667,6 @@ static int asd_register_sas_ha(struct asd_ha_struct *asd_ha)
667667
}
668668

669669
asd_ha->sas_ha.sas_ha_name = (char *) asd_ha->name;
670-
asd_ha->sas_ha.lldd_module = THIS_MODULE;
671670
asd_ha->sas_ha.sas_addr = &asd_ha->hw_prof.sas_addr[0];
672671

673672
for (i = 0; i < ASD_MAX_PHYS; i++) {
@@ -688,8 +687,8 @@ static int asd_unregister_sas_ha(struct asd_ha_struct *asd_ha)
688687

689688
err = sas_unregister_ha(&asd_ha->sas_ha);
690689

691-
sas_remove_host(asd_ha->sas_ha.core.shost);
692-
scsi_host_put(asd_ha->sas_ha.core.shost);
690+
sas_remove_host(asd_ha->sas_ha.shost);
691+
scsi_host_put(asd_ha->sas_ha.shost);
693692

694693
kfree(asd_ha->sas_ha.sas_phy);
695694
kfree(asd_ha->sas_ha.sas_port);
@@ -739,7 +738,7 @@ static int asd_pci_probe(struct pci_dev *dev, const struct pci_device_id *id)
739738
asd_printk("found %s, device %s\n", asd_ha->name, pci_name(dev));
740739

741740
SHOST_TO_SAS_HA(shost) = &asd_ha->sas_ha;
742-
asd_ha->sas_ha.core.shost = shost;
741+
asd_ha->sas_ha.shost = shost;
743742
shost->transportt = aic94xx_transport_template;
744743
shost->max_id = ~0;
745744
shost->max_lun = ~0;

drivers/scsi/aic94xx/aic94xx_task.c

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -388,14 +388,9 @@ static int asd_build_ata_ascb(struct asd_ascb *ascb, struct sas_task *task,
388388
flags |= data_dir_flags[task->data_dir];
389389
scb->ata_task.ata_flags = flags;
390390

391-
scb->ata_task.retry_count = task->ata_task.retry_count;
391+
scb->ata_task.retry_count = 0;
392392

393-
flags = 0;
394-
if (task->ata_task.set_affil_pol)
395-
flags |= SET_AFFIL_POLICY;
396-
if (task->ata_task.stp_affil_pol)
397-
flags |= STP_AFFIL_POLICY;
398-
scb->ata_task.flags = flags;
393+
scb->ata_task.flags = 0;
399394
}
400395
ascb->tasklet_complete = asd_task_tasklet_complete;
401396

@@ -485,9 +480,6 @@ static int asd_build_ssp_ascb(struct asd_ascb *ascb, struct sas_task *task,
485480
scb->ssp_task.ssp_frame.tptt = cpu_to_be16(0xFFFF);
486481

487482
memcpy(scb->ssp_task.ssp_cmd.lun, task->ssp_task.LUN, 8);
488-
if (task->ssp_task.enable_first_burst)
489-
scb->ssp_task.ssp_cmd.efb_prio_attr |= EFB_MASK;
490-
scb->ssp_task.ssp_cmd.efb_prio_attr |= (task->ssp_task.task_prio << 3);
491483
scb->ssp_task.ssp_cmd.efb_prio_attr |= (task->ssp_task.task_attr & 7);
492484
memcpy(scb->ssp_task.ssp_cmd.cdb, task->ssp_task.cmd->cmnd,
493485
task->ssp_task.cmd->cmd_len);

drivers/scsi/hisi_sas/hisi_sas_main.c

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1018,10 +1018,8 @@ static void hisi_sas_phy_init(struct hisi_hba *hisi_hba, int phy_no)
10181018
phy->minimum_linkrate = SAS_LINK_RATE_1_5_GBPS;
10191019
phy->maximum_linkrate = hisi_hba->hw->phy_get_max_linkrate();
10201020
sas_phy->enabled = (phy_no < hisi_hba->n_phy) ? 1 : 0;
1021-
sas_phy->class = SAS;
10221021
sas_phy->iproto = SAS_PROTOCOL_ALL;
10231022
sas_phy->tproto = 0;
1024-
sas_phy->type = PHY_TYPE_PHYSICAL;
10251023
sas_phy->role = PHY_ROLE_INITIATOR;
10261024
sas_phy->oob_mode = OOB_NOT_CONNECTED;
10271025
sas_phy->linkrate = SAS_LINK_RATE_UNKNOWN;
@@ -2514,10 +2512,9 @@ int hisi_sas_probe(struct platform_device *pdev,
25142512

25152513
sha->sas_ha_name = DRV_NAME;
25162514
sha->dev = hisi_hba->dev;
2517-
sha->lldd_module = THIS_MODULE;
25182515
sha->sas_addr = &hisi_hba->sas_addr[0];
25192516
sha->num_phys = hisi_hba->n_phy;
2520-
sha->core.shost = hisi_hba->shost;
2517+
sha->shost = hisi_hba->shost;
25212518

25222519
for (i = 0; i < hisi_hba->n_phy; i++) {
25232520
sha->sas_phy[i] = &hisi_hba->phy[i].sas_phy;
@@ -2559,12 +2556,12 @@ void hisi_sas_remove(struct platform_device *pdev)
25592556
{
25602557
struct sas_ha_struct *sha = platform_get_drvdata(pdev);
25612558
struct hisi_hba *hisi_hba = sha->lldd_ha;
2562-
struct Scsi_Host *shost = sha->core.shost;
2559+
struct Scsi_Host *shost = sha->shost;
25632560

25642561
del_timer_sync(&hisi_hba->timer);
25652562

25662563
sas_unregister_ha(sha);
2567-
sas_remove_host(sha->core.shost);
2564+
sas_remove_host(shost);
25682565

25692566
hisi_sas_free(hisi_hba);
25702567
scsi_host_put(shost);

drivers/scsi/hisi_sas/hisi_sas_v1_hw.c

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -960,7 +960,7 @@ static void prep_ssp_v1_hw(struct hisi_hba *hisi_hba,
960960
struct scsi_cmnd *scsi_cmnd = ssp_task->cmd;
961961
struct sas_tmf_task *tmf = slot->tmf;
962962
int has_data = 0, priority = !!tmf;
963-
u8 *buf_cmd, fburst = 0;
963+
u8 *buf_cmd;
964964
u32 dw1, dw2;
965965

966966
/* create header */
@@ -1018,16 +1018,11 @@ static void prep_ssp_v1_hw(struct hisi_hba *hisi_hba,
10181018

10191019
buf_cmd = hisi_sas_cmd_hdr_addr_mem(slot) +
10201020
sizeof(struct ssp_frame_hdr);
1021-
if (task->ssp_task.enable_first_burst) {
1022-
fburst = (1 << 7);
1023-
dw2 |= 1 << CMD_HDR_FIRST_BURST_OFF;
1024-
}
10251021
hdr->dw2 = cpu_to_le32(dw2);
10261022

10271023
memcpy(buf_cmd, &task->ssp_task.LUN, 8);
10281024
if (!tmf) {
1029-
buf_cmd[9] = fburst | task->ssp_task.task_attr |
1030-
(task->ssp_task.task_prio << 3);
1025+
buf_cmd[9] = task->ssp_task.task_attr;
10311026
memcpy(buf_cmd + 12, task->ssp_task.cmd->cmnd,
10321027
task->ssp_task.cmd->cmd_len);
10331028
} else {

drivers/scsi/hisi_sas/hisi_sas_v2_hw.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1798,8 +1798,7 @@ static void prep_ssp_v2_hw(struct hisi_hba *hisi_hba,
17981798

17991799
memcpy(buf_cmd, &task->ssp_task.LUN, 8);
18001800
if (!tmf) {
1801-
buf_cmd[9] = task->ssp_task.task_attr |
1802-
(task->ssp_task.task_prio << 3);
1801+
buf_cmd[9] = task->ssp_task.task_attr;
18031802
memcpy(buf_cmd + 12, task->ssp_task.cmd->cmnd,
18041803
task->ssp_task.cmd->cmd_len);
18051804
} else {

drivers/scsi/hisi_sas/hisi_sas_v3_hw.c

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1326,7 +1326,7 @@ static void prep_ssp_v3_hw(struct hisi_hba *hisi_hba,
13261326

13271327
memcpy(buf_cmd, &task->ssp_task.LUN, 8);
13281328
if (!tmf) {
1329-
buf_cmd[9] = ssp_task->task_attr | (ssp_task->task_prio << 3);
1329+
buf_cmd[9] = ssp_task->task_attr;
13301330
memcpy(buf_cmd + 12, scsi_cmnd->cmnd, scsi_cmnd->cmd_len);
13311331
} else {
13321332
buf_cmd[10] = tmf->tmf;
@@ -4956,7 +4956,7 @@ hisi_sas_v3_probe(struct pci_dev *pdev, const struct pci_device_id *id)
49564956

49574957
sha->sas_phy = arr_phy;
49584958
sha->sas_port = arr_port;
4959-
sha->core.shost = shost;
4959+
sha->shost = shost;
49604960
sha->lldd_ha = hisi_hba;
49614961

49624962
shost->transportt = hisi_sas_stt;
@@ -4973,7 +4973,6 @@ hisi_sas_v3_probe(struct pci_dev *pdev, const struct pci_device_id *id)
49734973

49744974
sha->sas_ha_name = DRV_NAME;
49754975
sha->dev = dev;
4976-
sha->lldd_module = THIS_MODULE;
49774976
sha->sas_addr = &hisi_hba->sas_addr[0];
49784977
sha->num_phys = hisi_hba->n_phy;
49794978

@@ -5061,14 +5060,14 @@ static void hisi_sas_v3_remove(struct pci_dev *pdev)
50615060
struct device *dev = &pdev->dev;
50625061
struct sas_ha_struct *sha = dev_get_drvdata(dev);
50635062
struct hisi_hba *hisi_hba = sha->lldd_ha;
5064-
struct Scsi_Host *shost = sha->core.shost;
5063+
struct Scsi_Host *shost = sha->shost;
50655064

50665065
pm_runtime_get_noresume(dev);
50675066
del_timer_sync(&hisi_hba->timer);
50685067

50695068
sas_unregister_ha(sha);
50705069
flush_workqueue(hisi_hba->wq);
5071-
sas_remove_host(sha->core.shost);
5070+
sas_remove_host(shost);
50725071

50735072
hisi_sas_v3_destroy_irqs(pdev, hisi_hba);
50745073
hisi_sas_free(hisi_hba);

drivers/scsi/isci/host.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,7 @@ static inline struct isci_pci_info *to_pci_info(struct pci_dev *pdev)
306306

307307
static inline struct Scsi_Host *to_shost(struct isci_host *ihost)
308308
{
309-
return ihost->sas_ha.core.shost;
309+
return ihost->sas_ha.shost;
310310
}
311311

312312
#define for_each_isci_host(id, ihost, pdev) \

drivers/scsi/isci/init.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,6 @@ static int isci_register_sas_ha(struct isci_host *isci_host)
250250
return -ENOMEM;
251251

252252
sas_ha->sas_ha_name = DRV_NAME;
253-
sas_ha->lldd_module = THIS_MODULE;
254253
sas_ha->sas_addr = &isci_host->phys[0].sas_addr[0];
255254

256255
for (i = 0; i < SCI_MAX_PHYS; i++) {
@@ -573,7 +572,7 @@ static struct isci_host *isci_host_alloc(struct pci_dev *pdev, int id)
573572
goto err_shost;
574573

575574
SHOST_TO_SAS_HA(shost) = &ihost->sas_ha;
576-
ihost->sas_ha.core.shost = shost;
575+
ihost->sas_ha.shost = shost;
577576
shost->transportt = isci_transport_template;
578577

579578
shost->max_id = ~0;
@@ -728,7 +727,7 @@ static int isci_resume(struct device *dev)
728727
sas_prep_resume_ha(&ihost->sas_ha);
729728

730729
isci_host_init(ihost);
731-
isci_host_start(ihost->sas_ha.core.shost);
730+
isci_host_start(ihost->sas_ha.shost);
732731
wait_for_start(ihost);
733732

734733
sas_resume_ha(&ihost->sas_ha);

drivers/scsi/isci/phy.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1404,10 +1404,8 @@ void isci_phy_init(struct isci_phy *iphy, struct isci_host *ihost, int index)
14041404
iphy->sas_phy.ha = &ihost->sas_ha;
14051405
iphy->sas_phy.lldd_phy = iphy;
14061406
iphy->sas_phy.enabled = 1;
1407-
iphy->sas_phy.class = SAS;
14081407
iphy->sas_phy.iproto = SAS_PROTOCOL_ALL;
14091408
iphy->sas_phy.tproto = 0;
1410-
iphy->sas_phy.type = PHY_TYPE_PHYSICAL;
14111409
iphy->sas_phy.role = PHY_ROLE_INITIATOR;
14121410
iphy->sas_phy.oob_mode = OOB_NOT_CONNECTED;
14131411
iphy->sas_phy.linkrate = SAS_LINK_RATE_UNKNOWN;

0 commit comments

Comments
 (0)