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/mvsas | |
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/mvsas')
-rw-r--r-- | drivers/scsi/mvsas/mv_init.c | 2 | ||||
-rw-r--r-- | drivers/scsi/mvsas/mv_sas.c | 16 | ||||
-rw-r--r-- | drivers/scsi/mvsas/mv_sas.h | 4 |
3 files changed, 11 insertions, 11 deletions
diff --git a/drivers/scsi/mvsas/mv_init.c b/drivers/scsi/mvsas/mv_init.c index 74550922ad55..7b7381d7671f 100644 --- a/drivers/scsi/mvsas/mv_init.c +++ b/drivers/scsi/mvsas/mv_init.c | |||
@@ -254,7 +254,7 @@ static int mvs_alloc(struct mvs_info *mvi, struct Scsi_Host *shost) | |||
254 | } | 254 | } |
255 | for (i = 0; i < MVS_MAX_DEVICES; i++) { | 255 | for (i = 0; i < MVS_MAX_DEVICES; i++) { |
256 | mvi->devices[i].taskfileset = MVS_ID_NOT_MAPPED; | 256 | mvi->devices[i].taskfileset = MVS_ID_NOT_MAPPED; |
257 | mvi->devices[i].dev_type = NO_DEVICE; | 257 | mvi->devices[i].dev_type = SAS_PHY_UNUSED; |
258 | mvi->devices[i].device_id = i; | 258 | mvi->devices[i].device_id = i; |
259 | mvi->devices[i].dev_status = MVS_DEV_NORMAL; | 259 | mvi->devices[i].dev_status = MVS_DEV_NORMAL; |
260 | init_timer(&mvi->devices[i].timer); | 260 | init_timer(&mvi->devices[i].timer); |
diff --git a/drivers/scsi/mvsas/mv_sas.c b/drivers/scsi/mvsas/mv_sas.c index 532110f4562a..c9e244984e30 100644 --- a/drivers/scsi/mvsas/mv_sas.c +++ b/drivers/scsi/mvsas/mv_sas.c | |||
@@ -706,7 +706,7 @@ static int mvs_task_prep_ssp(struct mvs_info *mvi, | |||
706 | return 0; | 706 | return 0; |
707 | } | 707 | } |
708 | 708 | ||
709 | #define DEV_IS_GONE(mvi_dev) ((!mvi_dev || (mvi_dev->dev_type == NO_DEVICE))) | 709 | #define DEV_IS_GONE(mvi_dev) ((!mvi_dev || (mvi_dev->dev_type == SAS_PHY_UNUSED))) |
710 | static int mvs_task_prep(struct sas_task *task, struct mvs_info *mvi, int is_tmf, | 710 | static int mvs_task_prep(struct sas_task *task, struct mvs_info *mvi, int is_tmf, |
711 | struct mvs_tmf_task *tmf, int *pass) | 711 | struct mvs_tmf_task *tmf, int *pass) |
712 | { | 712 | { |
@@ -726,7 +726,7 @@ static int mvs_task_prep(struct sas_task *task, struct mvs_info *mvi, int is_tmf | |||
726 | * libsas will use dev->port, should | 726 | * libsas will use dev->port, should |
727 | * not call task_done for sata | 727 | * not call task_done for sata |
728 | */ | 728 | */ |
729 | if (dev->dev_type != SATA_DEV) | 729 | if (dev->dev_type != SAS_SATA_DEV) |
730 | task->task_done(task); | 730 | task->task_done(task); |
731 | return rc; | 731 | return rc; |
732 | } | 732 | } |
@@ -1159,10 +1159,10 @@ void mvs_update_phyinfo(struct mvs_info *mvi, int i, int get_st) | |||
1159 | phy->identify.device_type = | 1159 | phy->identify.device_type = |
1160 | phy->att_dev_info & PORT_DEV_TYPE_MASK; | 1160 | phy->att_dev_info & PORT_DEV_TYPE_MASK; |
1161 | 1161 | ||
1162 | if (phy->identify.device_type == SAS_END_DEV) | 1162 | if (phy->identify.device_type == SAS_END_DEVICE) |
1163 | phy->identify.target_port_protocols = | 1163 | phy->identify.target_port_protocols = |
1164 | SAS_PROTOCOL_SSP; | 1164 | SAS_PROTOCOL_SSP; |
1165 | else if (phy->identify.device_type != NO_DEVICE) | 1165 | else if (phy->identify.device_type != SAS_PHY_UNUSED) |
1166 | phy->identify.target_port_protocols = | 1166 | phy->identify.target_port_protocols = |
1167 | SAS_PROTOCOL_SMP; | 1167 | SAS_PROTOCOL_SMP; |
1168 | if (oob_done) | 1168 | if (oob_done) |
@@ -1260,7 +1260,7 @@ struct mvs_device *mvs_alloc_dev(struct mvs_info *mvi) | |||
1260 | { | 1260 | { |
1261 | u32 dev; | 1261 | u32 dev; |
1262 | for (dev = 0; dev < MVS_MAX_DEVICES; dev++) { | 1262 | for (dev = 0; dev < MVS_MAX_DEVICES; dev++) { |
1263 | if (mvi->devices[dev].dev_type == NO_DEVICE) { | 1263 | if (mvi->devices[dev].dev_type == SAS_PHY_UNUSED) { |
1264 | mvi->devices[dev].device_id = dev; | 1264 | mvi->devices[dev].device_id = dev; |
1265 | return &mvi->devices[dev]; | 1265 | return &mvi->devices[dev]; |
1266 | } | 1266 | } |
@@ -1278,7 +1278,7 @@ void mvs_free_dev(struct mvs_device *mvi_dev) | |||
1278 | u32 id = mvi_dev->device_id; | 1278 | u32 id = mvi_dev->device_id; |
1279 | memset(mvi_dev, 0, sizeof(*mvi_dev)); | 1279 | memset(mvi_dev, 0, sizeof(*mvi_dev)); |
1280 | mvi_dev->device_id = id; | 1280 | mvi_dev->device_id = id; |
1281 | mvi_dev->dev_type = NO_DEVICE; | 1281 | mvi_dev->dev_type = SAS_PHY_UNUSED; |
1282 | mvi_dev->dev_status = MVS_DEV_NORMAL; | 1282 | mvi_dev->dev_status = MVS_DEV_NORMAL; |
1283 | mvi_dev->taskfileset = MVS_ID_NOT_MAPPED; | 1283 | mvi_dev->taskfileset = MVS_ID_NOT_MAPPED; |
1284 | } | 1284 | } |
@@ -1480,7 +1480,7 @@ static int mvs_debug_I_T_nexus_reset(struct domain_device *dev) | |||
1480 | { | 1480 | { |
1481 | int rc; | 1481 | int rc; |
1482 | struct sas_phy *phy = sas_get_local_phy(dev); | 1482 | struct sas_phy *phy = sas_get_local_phy(dev); |
1483 | int reset_type = (dev->dev_type == SATA_DEV || | 1483 | int reset_type = (dev->dev_type == SAS_SATA_DEV || |
1484 | (dev->tproto & SAS_PROTOCOL_STP)) ? 0 : 1; | 1484 | (dev->tproto & SAS_PROTOCOL_STP)) ? 0 : 1; |
1485 | rc = sas_phy_reset(phy, reset_type); | 1485 | rc = sas_phy_reset(phy, reset_type); |
1486 | sas_put_local_phy(phy); | 1486 | sas_put_local_phy(phy); |
@@ -1629,7 +1629,7 @@ int mvs_abort_task(struct sas_task *task) | |||
1629 | 1629 | ||
1630 | } else if (task->task_proto & SAS_PROTOCOL_SATA || | 1630 | } else if (task->task_proto & SAS_PROTOCOL_SATA || |
1631 | task->task_proto & SAS_PROTOCOL_STP) { | 1631 | task->task_proto & SAS_PROTOCOL_STP) { |
1632 | if (SATA_DEV == dev->dev_type) { | 1632 | if (SAS_SATA_DEV == dev->dev_type) { |
1633 | struct mvs_slot_info *slot = task->lldd_task; | 1633 | struct mvs_slot_info *slot = task->lldd_task; |
1634 | u32 slot_idx = (u32)(slot - mvi->slot_info); | 1634 | u32 slot_idx = (u32)(slot - mvi->slot_info); |
1635 | mv_dprintk("mvs_abort_task() mvi=%p task=%p " | 1635 | mv_dprintk("mvs_abort_task() mvi=%p task=%p " |
diff --git a/drivers/scsi/mvsas/mv_sas.h b/drivers/scsi/mvsas/mv_sas.h index 9f3cc13a5ce7..60e2fb7f2dca 100644 --- a/drivers/scsi/mvsas/mv_sas.h +++ b/drivers/scsi/mvsas/mv_sas.h | |||
@@ -67,7 +67,7 @@ extern const struct mvs_dispatch mvs_94xx_dispatch; | |||
67 | extern struct kmem_cache *mvs_task_list_cache; | 67 | extern struct kmem_cache *mvs_task_list_cache; |
68 | 68 | ||
69 | #define DEV_IS_EXPANDER(type) \ | 69 | #define DEV_IS_EXPANDER(type) \ |
70 | ((type == EDGE_DEV) || (type == FANOUT_DEV)) | 70 | ((type == SAS_EDGE_EXPANDER_DEVICE) || (type == SAS_FANOUT_EXPANDER_DEVICE)) |
71 | 71 | ||
72 | #define bit(n) ((u64)1 << n) | 72 | #define bit(n) ((u64)1 << n) |
73 | 73 | ||
@@ -241,7 +241,7 @@ struct mvs_phy { | |||
241 | 241 | ||
242 | struct mvs_device { | 242 | struct mvs_device { |
243 | struct list_head dev_entry; | 243 | struct list_head dev_entry; |
244 | enum sas_dev_type dev_type; | 244 | enum sas_device_type dev_type; |
245 | struct mvs_info *mvi_info; | 245 | struct mvs_info *mvi_info; |
246 | struct domain_device *sas_device; | 246 | struct domain_device *sas_device; |
247 | struct timer_list timer; | 247 | struct timer_list timer; |