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/libsas/sas_ata.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/libsas/sas_ata.c')
-rw-r--r-- | drivers/scsi/libsas/sas_ata.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/drivers/scsi/libsas/sas_ata.c b/drivers/scsi/libsas/sas_ata.c index bdb81cda8401..161c98efade9 100644 --- a/drivers/scsi/libsas/sas_ata.c +++ b/drivers/scsi/libsas/sas_ata.c | |||
@@ -285,14 +285,14 @@ int sas_get_ata_info(struct domain_device *dev, struct ex_phy *phy) | |||
285 | if (phy->attached_tproto & SAS_PROTOCOL_STP) | 285 | if (phy->attached_tproto & SAS_PROTOCOL_STP) |
286 | dev->tproto = phy->attached_tproto; | 286 | dev->tproto = phy->attached_tproto; |
287 | if (phy->attached_sata_dev) | 287 | if (phy->attached_sata_dev) |
288 | dev->tproto |= SATA_DEV; | 288 | dev->tproto |= SAS_SATA_DEV; |
289 | 289 | ||
290 | if (phy->attached_dev_type == SATA_PENDING) | 290 | if (phy->attached_dev_type == SAS_SATA_PENDING) |
291 | dev->dev_type = SATA_PENDING; | 291 | dev->dev_type = SAS_SATA_PENDING; |
292 | else { | 292 | else { |
293 | int res; | 293 | int res; |
294 | 294 | ||
295 | dev->dev_type = SATA_DEV; | 295 | dev->dev_type = SAS_SATA_DEV; |
296 | res = sas_get_report_phy_sata(dev->parent, phy->phy_id, | 296 | res = sas_get_report_phy_sata(dev->parent, phy->phy_id, |
297 | &dev->sata_dev.rps_resp); | 297 | &dev->sata_dev.rps_resp); |
298 | if (res) { | 298 | if (res) { |
@@ -314,7 +314,7 @@ static int sas_ata_clear_pending(struct domain_device *dev, struct ex_phy *phy) | |||
314 | int res; | 314 | int res; |
315 | 315 | ||
316 | /* we weren't pending, so successfully end the reset sequence now */ | 316 | /* we weren't pending, so successfully end the reset sequence now */ |
317 | if (dev->dev_type != SATA_PENDING) | 317 | if (dev->dev_type != SAS_SATA_PENDING) |
318 | return 1; | 318 | return 1; |
319 | 319 | ||
320 | /* hmmm, if this succeeds do we need to repost the domain_device to the | 320 | /* 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) | |||
348 | return 0; | 348 | return 0; |
349 | 349 | ||
350 | switch (ex_phy->attached_dev_type) { | 350 | switch (ex_phy->attached_dev_type) { |
351 | case SATA_PENDING: | 351 | case SAS_SATA_PENDING: |
352 | return 0; | 352 | return 0; |
353 | case SAS_END_DEV: | 353 | case SAS_END_DEVICE: |
354 | if (ex_phy->attached_sata_dev) | 354 | if (ex_phy->attached_sata_dev) |
355 | return sas_ata_clear_pending(dev, ex_phy); | 355 | return sas_ata_clear_pending(dev, ex_phy); |
356 | default: | 356 | default: |
@@ -631,7 +631,7 @@ static void sas_get_ata_command_set(struct domain_device *dev) | |||
631 | struct dev_to_host_fis *fis = | 631 | struct dev_to_host_fis *fis = |
632 | (struct dev_to_host_fis *) dev->frame_rcvd; | 632 | (struct dev_to_host_fis *) dev->frame_rcvd; |
633 | 633 | ||
634 | if (dev->dev_type == SATA_PENDING) | 634 | if (dev->dev_type == SAS_SATA_PENDING) |
635 | return; | 635 | return; |
636 | 636 | ||
637 | if ((fis->sector_count == 1 && /* ATA */ | 637 | if ((fis->sector_count == 1 && /* ATA */ |
@@ -797,7 +797,7 @@ int sas_discover_sata(struct domain_device *dev) | |||
797 | { | 797 | { |
798 | int res; | 798 | int res; |
799 | 799 | ||
800 | if (dev->dev_type == SATA_PM) | 800 | if (dev->dev_type == SAS_SATA_PM) |
801 | return -ENODEV; | 801 | return -ENODEV; |
802 | 802 | ||
803 | sas_get_ata_command_set(dev); | 803 | sas_get_ata_command_set(dev); |