summaryrefslogtreecommitdiff
path: root/drivers/scsi/isci/core/scic_sds_phy.h
diff options
context:
space:
mode:
authorDan Williams <dan.j.williams@intel.com>2011-02-23 08:14:06 (GMT)
committerDan Williams <dan.j.williams@intel.com>2011-07-03 10:55:27 (GMT)
commit8f31550c77849250ec49d1509b6bb63b4ddc59e4 (patch)
tree380980cfaf7923b701a2cb95ba17071c9afa225a /drivers/scsi/isci/core/scic_sds_phy.h
parent858d4aa741c80fb7579cda3517853f0cffc73772 (diff)
downloadlinux-8f31550c77849250ec49d1509b6bb63b4ddc59e4.tar.xz
isci: phy state machine cleanup step1
c99 the struct initializers: 1/ allows grep to consistently show method name associations. The naming is mostly consistent (except when it isn't) so this guarantees coverage of present and future exception cases. 2/ let's the compiler guarantee that the state table array entry correlates with an actual state name and detect accidental reordering or deletion of states. / allows default handler's to be identified easily Signed-off-by: Jacek Danecki <Jacek.Danecki@intel.com> Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Diffstat (limited to 'drivers/scsi/isci/core/scic_sds_phy.h')
-rw-r--r--drivers/scsi/isci/core/scic_sds_phy.h24
1 files changed, 9 insertions, 15 deletions
diff --git a/drivers/scsi/isci/core/scic_sds_phy.h b/drivers/scsi/isci/core/scic_sds_phy.h
index 3b88259..9ba09bb 100644
--- a/drivers/scsi/isci/core/scic_sds_phy.h
+++ b/drivers/scsi/isci/core/scic_sds_phy.h
@@ -146,11 +146,6 @@ enum SCIC_SDS_PHY_STARTING_SUBSTATES {
* Exit state for this state machine
*/
SCIC_SDS_PHY_STARTING_SUBSTATE_FINAL,
-
- /**
- * Maximum number of substates for the STARTING state machine
- */
- SCIC_SDS_PHY_STARTING_MAX_SUBSTATES
};
struct scic_sds_port;
@@ -248,7 +243,7 @@ struct scic_sds_phy {
*/
void *sata_timeout_timer;
- struct scic_sds_phy_state_handler *state_handlers;
+ const struct scic_sds_phy_state_handler *state_handlers;
struct sci_base_state_machine starting_substate_machine;
@@ -260,9 +255,9 @@ struct scic_sds_phy {
};
-typedef enum sci_status (*SCIC_SDS_PHY_EVENT_HANDLER_T)(struct scic_sds_phy *, u32);
-typedef enum sci_status (*SCIC_SDS_PHY_FRAME_HANDLER_T)(struct scic_sds_phy *, u32);
-typedef enum sci_status (*SCIC_SDS_PHY_POWER_HANDLER_T)(struct scic_sds_phy *);
+typedef enum sci_status (*scic_sds_phy_event_handler_t)(struct scic_sds_phy *, u32);
+typedef enum sci_status (*scic_sds_phy_frame_handler_t)(struct scic_sds_phy *, u32);
+typedef enum sci_status (*scic_sds_phy_power_handler_t)(struct scic_sds_phy *);
/**
* struct scic_sds_phy_state_handler -
@@ -278,25 +273,24 @@ struct scic_sds_phy_state_handler {
/**
* The state handler for unsolicited frames received from the SCU hardware.
*/
- SCIC_SDS_PHY_FRAME_HANDLER_T frame_handler;
+ scic_sds_phy_frame_handler_t frame_handler;
/**
* The state handler for events received from the SCU hardware.
*/
- SCIC_SDS_PHY_EVENT_HANDLER_T event_handler;
+ scic_sds_phy_event_handler_t event_handler;
/**
* The state handler for staggered spinup.
*/
- SCIC_SDS_PHY_POWER_HANDLER_T consume_power_handler;
+ scic_sds_phy_power_handler_t consume_power_handler;
};
-extern struct scic_sds_phy_state_handler scic_sds_phy_state_handler_table[];
+extern const struct scic_sds_phy_state_handler scic_sds_phy_state_handler_table[];
extern const struct sci_base_state scic_sds_phy_state_table[];
extern const struct sci_base_state scic_sds_phy_starting_substates[];
-extern struct scic_sds_phy_state_handler
- scic_sds_phy_starting_substate_handler_table[];
+extern const struct scic_sds_phy_state_handler scic_sds_phy_starting_substate_handler_table[];
/**