mirror of
https://github.com/Fishwaldo/linux-bl808.git
synced 2025-06-17 20:25:19 +00:00
[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>
This commit is contained in:
parent
a6cb3d012b
commit
aa9f8328fc
24 changed files with 160 additions and 165 deletions
|
@ -285,14 +285,14 @@ int sas_get_ata_info(struct domain_device *dev, struct ex_phy *phy)
|
|||
if (phy->attached_tproto & SAS_PROTOCOL_STP)
|
||||
dev->tproto = phy->attached_tproto;
|
||||
if (phy->attached_sata_dev)
|
||||
dev->tproto |= SATA_DEV;
|
||||
dev->tproto |= SAS_SATA_DEV;
|
||||
|
||||
if (phy->attached_dev_type == SATA_PENDING)
|
||||
dev->dev_type = SATA_PENDING;
|
||||
if (phy->attached_dev_type == SAS_SATA_PENDING)
|
||||
dev->dev_type = SAS_SATA_PENDING;
|
||||
else {
|
||||
int res;
|
||||
|
||||
dev->dev_type = SATA_DEV;
|
||||
dev->dev_type = SAS_SATA_DEV;
|
||||
res = sas_get_report_phy_sata(dev->parent, phy->phy_id,
|
||||
&dev->sata_dev.rps_resp);
|
||||
if (res) {
|
||||
|
@ -314,7 +314,7 @@ static int sas_ata_clear_pending(struct domain_device *dev, struct ex_phy *phy)
|
|||
int res;
|
||||
|
||||
/* we weren't pending, so successfully end the reset sequence now */
|
||||
if (dev->dev_type != SATA_PENDING)
|
||||
if (dev->dev_type != SAS_SATA_PENDING)
|
||||
return 1;
|
||||
|
||||
/* hmmm, if this succeeds do we need to repost the domain_device to the
|
||||
|
@ -348,9 +348,9 @@ static int smp_ata_check_ready(struct ata_link *link)
|
|||
return 0;
|
||||
|
||||
switch (ex_phy->attached_dev_type) {
|
||||
case SATA_PENDING:
|
||||
case SAS_SATA_PENDING:
|
||||
return 0;
|
||||
case SAS_END_DEV:
|
||||
case SAS_END_DEVICE:
|
||||
if (ex_phy->attached_sata_dev)
|
||||
return sas_ata_clear_pending(dev, ex_phy);
|
||||
default:
|
||||
|
@ -631,7 +631,7 @@ static void sas_get_ata_command_set(struct domain_device *dev)
|
|||
struct dev_to_host_fis *fis =
|
||||
(struct dev_to_host_fis *) dev->frame_rcvd;
|
||||
|
||||
if (dev->dev_type == SATA_PENDING)
|
||||
if (dev->dev_type == SAS_SATA_PENDING)
|
||||
return;
|
||||
|
||||
if ((fis->sector_count == 1 && /* ATA */
|
||||
|
@ -797,7 +797,7 @@ int sas_discover_sata(struct domain_device *dev)
|
|||
{
|
||||
int res;
|
||||
|
||||
if (dev->dev_type == SATA_PM)
|
||||
if (dev->dev_type == SAS_SATA_PM)
|
||||
return -ENODEV;
|
||||
|
||||
sas_get_ata_command_set(dev);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue