diff options
author | James Bottomley <JBottomley@Parallels.com> | 2013-05-07 17:44:06 -0400 |
---|---|---|
committer | James Bottomley <JBottomley@Parallels.com> | 2013-05-10 10:47:52 -0400 |
commit | aa9f8328fc51460e15da129caf622b6560fa8c99 (patch) | |
tree | 3ca4c2a29e94538acff4aae04214d5645eaeac02 /drivers/scsi/pm8001/pm8001_hwi.c | |
parent | a6cb3d012b983b350ae3892cff2e692665df0e1e (diff) |
[SCSI] sas: unify the pointlessly separated enums sas_dev_type and sas_device_type
These enums have been separate since the dawn of SAS, mainly because the
latter is a procotol only enum and the former includes additional state
for libsas. The dichotomy causes endless confusion about which one you
should use where and leads to pointless warnings like this:
drivers/scsi/mvsas/mv_sas.c: In function 'mvs_update_phyinfo':
drivers/scsi/mvsas/mv_sas.c:1162:34: warning: comparison between 'enum sas_device_type' and 'enum sas_dev_type' [-Wenum-compare]
Fix by eliminating one of them. The one kept is effectively the sas.h
one, but call it sas_device_type and make sure the enums are all
properly namespaced with the SAS_ prefix.
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Diffstat (limited to 'drivers/scsi/pm8001/pm8001_hwi.c')
-rw-r--r-- | drivers/scsi/pm8001/pm8001_hwi.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/drivers/scsi/pm8001/pm8001_hwi.c b/drivers/scsi/pm8001/pm8001_hwi.c index 95d04cc78c0b..69dd49c05f1e 100644 --- a/drivers/scsi/pm8001/pm8001_hwi.c +++ b/drivers/scsi/pm8001/pm8001_hwi.c | |||
@@ -1505,7 +1505,7 @@ void pm8001_work_fn(struct work_struct *work) | |||
1505 | pm8001_dev = pw->data; /* Most stash device structure */ | 1505 | pm8001_dev = pw->data; /* Most stash device structure */ |
1506 | if ((pm8001_dev == NULL) | 1506 | if ((pm8001_dev == NULL) |
1507 | || ((pw->handler != IO_XFER_ERROR_BREAK) | 1507 | || ((pw->handler != IO_XFER_ERROR_BREAK) |
1508 | && (pm8001_dev->dev_type == NO_DEVICE))) { | 1508 | && (pm8001_dev->dev_type == SAS_PHY_UNUSED))) { |
1509 | kfree(pw); | 1509 | kfree(pw); |
1510 | return; | 1510 | return; |
1511 | } | 1511 | } |
@@ -3443,7 +3443,7 @@ hw_event_sata_phy_up(struct pm8001_hba_info *pm8001_ha, void *piomb) | |||
3443 | sizeof(struct dev_to_host_fis)); | 3443 | sizeof(struct dev_to_host_fis)); |
3444 | phy->frame_rcvd_size = sizeof(struct dev_to_host_fis); | 3444 | phy->frame_rcvd_size = sizeof(struct dev_to_host_fis); |
3445 | phy->identify.target_port_protocols = SAS_PROTOCOL_SATA; | 3445 | phy->identify.target_port_protocols = SAS_PROTOCOL_SATA; |
3446 | phy->identify.device_type = SATA_DEV; | 3446 | phy->identify.device_type = SAS_SATA_DEV; |
3447 | pm8001_get_attached_sas_addr(phy, phy->sas_phy.attached_sas_addr); | 3447 | pm8001_get_attached_sas_addr(phy, phy->sas_phy.attached_sas_addr); |
3448 | spin_unlock_irqrestore(&phy->sas_phy.frame_rcvd_lock, flags); | 3448 | spin_unlock_irqrestore(&phy->sas_phy.frame_rcvd_lock, flags); |
3449 | pm8001_bytes_dmaed(pm8001_ha, phy_id); | 3449 | pm8001_bytes_dmaed(pm8001_ha, phy_id); |
@@ -4465,7 +4465,7 @@ pm8001_chip_phy_start_req(struct pm8001_hba_info *pm8001_ha, u8 phy_id) | |||
4465 | payload.ase_sh_lm_slr_phyid = cpu_to_le32(SPINHOLD_DISABLE | | 4465 | payload.ase_sh_lm_slr_phyid = cpu_to_le32(SPINHOLD_DISABLE | |
4466 | LINKMODE_AUTO | LINKRATE_15 | | 4466 | LINKMODE_AUTO | LINKRATE_15 | |
4467 | LINKRATE_30 | LINKRATE_60 | phy_id); | 4467 | LINKRATE_30 | LINKRATE_60 | phy_id); |
4468 | payload.sas_identify.dev_type = SAS_END_DEV; | 4468 | payload.sas_identify.dev_type = SAS_END_DEVICE; |
4469 | payload.sas_identify.initiator_bits = SAS_PROTOCOL_ALL; | 4469 | payload.sas_identify.initiator_bits = SAS_PROTOCOL_ALL; |
4470 | memcpy(payload.sas_identify.sas_addr, | 4470 | memcpy(payload.sas_identify.sas_addr, |
4471 | pm8001_ha->sas_addr, SAS_ADDR_SIZE); | 4471 | pm8001_ha->sas_addr, SAS_ADDR_SIZE); |
@@ -4527,11 +4527,11 @@ static int pm8001_chip_reg_dev_req(struct pm8001_hba_info *pm8001_ha, | |||
4527 | if (flag == 1) | 4527 | if (flag == 1) |
4528 | stp_sspsmp_sata = 0x02; /*direct attached sata */ | 4528 | stp_sspsmp_sata = 0x02; /*direct attached sata */ |
4529 | else { | 4529 | else { |
4530 | if (pm8001_dev->dev_type == SATA_DEV) | 4530 | if (pm8001_dev->dev_type == SAS_SATA_DEV) |
4531 | stp_sspsmp_sata = 0x00; /* stp*/ | 4531 | stp_sspsmp_sata = 0x00; /* stp*/ |
4532 | else if (pm8001_dev->dev_type == SAS_END_DEV || | 4532 | else if (pm8001_dev->dev_type == SAS_END_DEVICE || |
4533 | pm8001_dev->dev_type == EDGE_DEV || | 4533 | pm8001_dev->dev_type == SAS_EDGE_EXPANDER_DEVICE || |
4534 | pm8001_dev->dev_type == FANOUT_DEV) | 4534 | pm8001_dev->dev_type == SAS_FANOUT_EXPANDER_DEVICE) |
4535 | stp_sspsmp_sata = 0x01; /*ssp or smp*/ | 4535 | stp_sspsmp_sata = 0x01; /*ssp or smp*/ |
4536 | } | 4536 | } |
4537 | if (parent_dev && DEV_IS_EXPANDER(parent_dev->dev_type)) | 4537 | if (parent_dev && DEV_IS_EXPANDER(parent_dev->dev_type)) |
@@ -4662,9 +4662,9 @@ int pm8001_chip_abort_task(struct pm8001_hba_info *pm8001_ha, | |||
4662 | PM8001_EH_DBG(pm8001_ha, | 4662 | PM8001_EH_DBG(pm8001_ha, |
4663 | pm8001_printk("cmd_tag = %x, abort task tag = 0x%x", | 4663 | pm8001_printk("cmd_tag = %x, abort task tag = 0x%x", |
4664 | cmd_tag, task_tag)); | 4664 | cmd_tag, task_tag)); |
4665 | if (pm8001_dev->dev_type == SAS_END_DEV) | 4665 | if (pm8001_dev->dev_type == SAS_END_DEVICE) |
4666 | opc = OPC_INB_SSP_ABORT; | 4666 | opc = OPC_INB_SSP_ABORT; |
4667 | else if (pm8001_dev->dev_type == SATA_DEV) | 4667 | else if (pm8001_dev->dev_type == SAS_SATA_DEV) |
4668 | opc = OPC_INB_SATA_ABORT; | 4668 | opc = OPC_INB_SATA_ABORT; |
4669 | else | 4669 | else |
4670 | opc = OPC_INB_SMP_ABORT;/* SMP */ | 4670 | opc = OPC_INB_SMP_ABORT;/* SMP */ |