Commit db48255b authored by Henryk Dembkowski's avatar Henryk Dembkowski Committed by Dan Williams

isci: c99 tables cleanup step1

	scic_sds_stp_remote_device_ready_substate_handler_table[]
	scic_sds_smp_remote_device_ready_substate_handler_table[]

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.
	3/ allows default handler's to be identified easily
Signed-off-by: default avatarHenryk Dembkowski <henryk.dembkowski@intel.com>
Signed-off-by: default avatarDan Williams <dan.j.williams@intel.com>
parent 2f02f556
......@@ -158,8 +158,6 @@ enum scic_sds_stp_remote_device_ready_substates {
* coming to be recovered from certain hardware specific error.
*/
SCIC_SDS_STP_REMOTE_DEVICE_READY_SUBSTATE_AWAIT_RESET,
SCIC_SDS_STP_REMOTE_DEVICE_READY_MAX_SUBSTATES
};
/**
......@@ -179,8 +177,6 @@ enum scic_sds_smp_remote_device_ready_substates {
* the device is placed in when a RNC suspend is received by the SCU hardware.
*/
SCIC_SDS_SMP_REMOTE_DEVICE_READY_SUBSTATE_CMD,
SCIC_SDS_SMP_REMOTE_DEVICE_READY_MAX_SUBSTATES
};
/**
......@@ -326,12 +322,8 @@ extern const struct sci_base_state scic_sds_stp_remote_device_ready_substate_tab
extern const struct sci_base_state scic_sds_smp_remote_device_ready_substate_table[];
extern const struct scic_sds_remote_device_state_handler scic_sds_remote_device_state_handler_table[];
extern struct scic_sds_remote_device_state_handler
scic_sds_ssp_remote_device_ready_substate_handler_table[];
extern struct scic_sds_remote_device_state_handler
scic_sds_stp_remote_device_ready_substate_handler_table[];
extern struct scic_sds_remote_device_state_handler
scic_sds_smp_remote_device_ready_substate_handler_table[];
extern const struct scic_sds_remote_device_state_handler scic_sds_stp_remote_device_ready_substate_handler_table[];
extern const struct scic_sds_remote_device_state_handler scic_sds_smp_remote_device_ready_substate_handler_table[];
/**
* scic_sds_remote_device_increment_request_count() -
......
......@@ -214,49 +214,40 @@ static enum sci_status scic_sds_smp_remote_device_ready_cmd_substate_frame_handl
/* --------------------------------------------------------------------------- */
struct scic_sds_remote_device_state_handler
scic_sds_smp_remote_device_ready_substate_handler_table[
SCIC_SDS_SMP_REMOTE_DEVICE_READY_MAX_SUBSTATES] =
{
/* SCIC_SDS_SMP_REMOTE_DEVICE_READY_SUBSTATE_IDLE */
{
{
scic_sds_remote_device_default_start_handler,
scic_sds_remote_device_ready_state_stop_handler,
scic_sds_remote_device_default_fail_handler,
scic_sds_remote_device_default_destruct_handler,
scic_sds_remote_device_default_reset_handler,
scic_sds_remote_device_default_reset_complete_handler,
scic_sds_smp_remote_device_ready_idle_substate_start_io_handler,
scic_sds_remote_device_default_complete_request_handler,
scic_sds_remote_device_default_continue_request_handler,
scic_sds_remote_device_default_start_request_handler,
scic_sds_remote_device_default_complete_request_handler
},
scic_sds_remote_device_default_suspend_handler,
scic_sds_remote_device_default_resume_handler,
scic_sds_remote_device_general_event_handler,
scic_sds_remote_device_default_frame_handler
},
/* SCIC_SDS_SMP_REMOTE_DEVICE_READY_SUBSTATE_CMD */
{
{
scic_sds_remote_device_default_start_handler,
scic_sds_remote_device_ready_state_stop_handler,
scic_sds_remote_device_default_fail_handler,
scic_sds_remote_device_default_destruct_handler,
scic_sds_remote_device_default_reset_handler,
scic_sds_remote_device_default_reset_complete_handler,
scic_sds_smp_remote_device_ready_cmd_substate_start_io_handler,
scic_sds_smp_remote_device_ready_cmd_substate_complete_io_handler,
scic_sds_remote_device_default_continue_request_handler,
scic_sds_remote_device_default_start_request_handler,
scic_sds_remote_device_default_complete_request_handler
const struct scic_sds_remote_device_state_handler scic_sds_smp_remote_device_ready_substate_handler_table[] = {
[SCIC_SDS_SMP_REMOTE_DEVICE_READY_SUBSTATE_IDLE] = {
.parent.start_handler = scic_sds_remote_device_default_start_handler,
.parent.stop_handler = scic_sds_remote_device_ready_state_stop_handler,
.parent.fail_handler = scic_sds_remote_device_default_fail_handler,
.parent.destruct_handler = scic_sds_remote_device_default_destruct_handler,
.parent.reset_handler = scic_sds_remote_device_default_reset_handler,
.parent.reset_complete_handler = scic_sds_remote_device_default_reset_complete_handler,
.parent.start_io_handler = scic_sds_smp_remote_device_ready_idle_substate_start_io_handler,
.parent.complete_io_handler = scic_sds_remote_device_default_complete_request_handler,
.parent.continue_io_handler = scic_sds_remote_device_default_continue_request_handler,
.parent.start_task_handler = scic_sds_remote_device_default_start_request_handler,
.parent.complete_task_handler = scic_sds_remote_device_default_complete_request_handler,
.suspend_handler = scic_sds_remote_device_default_suspend_handler,
.resume_handler = scic_sds_remote_device_default_resume_handler,
.event_handler = scic_sds_remote_device_general_event_handler,
.frame_handler = scic_sds_remote_device_default_frame_handler
},
scic_sds_remote_device_default_suspend_handler,
scic_sds_remote_device_default_resume_handler,
scic_sds_remote_device_general_event_handler,
scic_sds_smp_remote_device_ready_cmd_substate_frame_handler
[SCIC_SDS_SMP_REMOTE_DEVICE_READY_SUBSTATE_CMD] = {
.parent.start_handler = scic_sds_remote_device_default_start_handler,
.parent.stop_handler = scic_sds_remote_device_ready_state_stop_handler,
.parent.fail_handler = scic_sds_remote_device_default_fail_handler,
.parent.destruct_handler = scic_sds_remote_device_default_destruct_handler,
.parent.reset_handler = scic_sds_remote_device_default_reset_handler,
.parent.reset_complete_handler = scic_sds_remote_device_default_reset_complete_handler,
.parent.start_io_handler = scic_sds_smp_remote_device_ready_cmd_substate_start_io_handler,
.parent.complete_io_handler = scic_sds_smp_remote_device_ready_cmd_substate_complete_io_handler,
.parent.continue_io_handler = scic_sds_remote_device_default_continue_request_handler,
.parent.start_task_handler = scic_sds_remote_device_default_start_request_handler,
.parent.complete_task_handler = scic_sds_remote_device_default_complete_request_handler,
.suspend_handler = scic_sds_remote_device_default_suspend_handler,
.resume_handler = scic_sds_remote_device_default_resume_handler,
.event_handler = scic_sds_remote_device_general_event_handler,
.frame_handler = scic_sds_smp_remote_device_ready_cmd_substate_frame_handler
}
};
/*
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment