Commit 068b2c03 authored by Dan Williams's avatar Dan Williams

isci: kill some long macros

Delete some macros that are longer to type than the open coded operation
that they perform.

scic_sds_phy_get_base_state_machine
scic_sds_phy_get_starting_substate_machine
scic_sds_port_get_base_state_machine
scic_sds_port_get_ready_substate_machine
scic_sds_remote_device_get_base_state_machine
scic_sds_remote_device_get_ready_substate_machine
scic_sds_remote_node_context_set_remote_node_index
scic_sds_controller_get_base_state_machine

Also performs some collateral cleanups like killing casts that assume
structure member ordering, and consolidating a lot of duplicated default
handler code (the primary callers of the *_get_base_state_machine macros) via
a helper.
Reported-by: default avatarChristoph Hellwig <hch@infradead.org>
Signed-off-by: default avatarDan Williams <dan.j.williams@intel.com>
parent f942f32e
......@@ -420,15 +420,6 @@ extern const struct sci_base_state scic_sds_controller_state_table[];
} \
}
/**
* scic_sds_controller_get_base_state_machine() -
*
* This is a helper macro that gets the base state machine for the controller
* object
*/
#define scic_sds_controller_get_base_state_machine(this_controller) \
(&(this_controller)->parent.state_machine)
/**
* scic_sds_controller_get_port_configuration_agent() -
*
......
This diff is collapsed.
......@@ -316,24 +316,6 @@ extern const struct scic_sds_phy_state_handler scic_sds_phy_starting_substate_ha
#define scic_sds_phy_get_controller(phy) \
(scic_sds_port_get_controller((phy)->owning_port))
/**
* scic_sds_phy_get_base_state_machine() - This macro returns the state machine
* for the base phy
*
*
*/
#define scic_sds_phy_get_base_state_machine(phy) \
(&(phy)->parent.state_machine)
/**
* scic_sds_phy_get_starting_substate_machine() - This macro returns the
* starting substate machine for this phy
*
*
*/
#define scic_sds_phy_get_starting_substate_machine(phy) \
(&(phy)->starting_substate_machine)
/**
* scic_sds_phy_set_state_handlers() - This macro sets the state handlers for
* this phy object
......@@ -354,27 +336,6 @@ extern const struct scic_sds_phy_state_handler scic_sds_phy_starting_substate_ha
&scic_sds_phy_state_handler_table[(state_id)] \
)
/**
* scic_sds_phy_is_ready() -
*
* This macro returns true if the current base state for this phy is
* SCI_BASE_PHY_STATE_READY
*/
#define scic_sds_phy_is_ready(phy) \
(\
SCI_BASE_PHY_STATE_READY \
== sci_base_state_machine_get_state(\
scic_sds_phy_get_base_state_machine(phy) \
) \
)
/* --------------------------------------------------------------------------- */
/* --------------------------------------------------------------------------- */
void scic_sds_phy_construct(
struct scic_sds_phy *this_phy,
struct scic_sds_port *owning_port,
......@@ -404,8 +365,6 @@ enum sci_status scic_sds_phy_reset(
void scic_sds_phy_sata_timeout(
void *cookie);
/* --------------------------------------------------------------------------- */
void scic_sds_phy_suspend(
struct scic_sds_phy *this_phy);
......@@ -416,8 +375,6 @@ void scic_sds_phy_setup_transport(
struct scic_sds_phy *this_phy,
u32 device_id);
/* --------------------------------------------------------------------------- */
enum sci_status scic_sds_phy_event_handler(
struct scic_sds_phy *this_phy,
u32 event_code);
......@@ -445,11 +402,6 @@ void scic_sds_phy_get_attached_phy_protocols(
struct scic_sds_phy *this_phy,
struct sci_sas_identify_address_frame_protocols *protocols);
/*
* ****************************************************************************-
* * SCIC SDS PHY Handler Methods
* ****************************************************************************- */
enum sci_status scic_sds_phy_default_start_handler(
struct sci_base_phy *phy);
......
This diff is collapsed.
......@@ -250,14 +250,6 @@ extern struct scic_sds_port_state_handler scic_sds_port_ready_substate_handler_t
#define scic_sds_port_get_controller(this_port) \
((this_port)->owning_controller)
/**
* scic_sds_port_get_base_state_machine() -
*
* Helper macro to get the base state machine for this port
*/
#define scic_sds_port_get_base_state_machine(this_port) \
(&(this_port)->parent.state_machine)
/**
* scic_sds_port_set_base_state_handlers() -
*
......@@ -267,14 +259,6 @@ extern struct scic_sds_port_state_handler scic_sds_port_ready_substate_handler_t
scic_sds_port_set_state_handlers(\
(this_port), &scic_sds_port_state_handler_table[(state_id)])
/**
* scic_sds_port_get_ready_substate_machine() -
*
* Helper macro to get the ready substate machine for this port
*/
#define scic_sds_port_get_ready_substate_machine(this_port) \
(&(this_port)->ready_substate_machine)
/**
* scic_sds_port_set_state_handlers() -
*
......
......@@ -376,22 +376,6 @@ extern const struct scic_sds_remote_device_state_handler scic_sds_smp_remote_dev
#define scic_sds_remote_device_set_state_handlers(this_device, handlers) \
((this_device)->state_handlers = (handlers))
/**
* scic_sds_remote_device_get_base_state_machine() -
*
* This macro returns the base sate machine object for the remote device.
*/
#define scic_sds_remote_device_get_base_state_machine(this_device) \
(&(this_device)->parent.state_machine)
/**
* scic_sds_remote_device_get_ready_substate_machine() -
*
* This macro returns the remote device ready substate machine
*/
#define scic_sds_remote_device_get_ready_substate_machine(this_device) \
(&(this_device)->ready_substate_machine)
/**
* scic_sds_remote_device_get_port() -
*
......
......@@ -296,9 +296,6 @@ void scic_sds_remote_node_context_construct_buffer(
bool scic_sds_remote_node_context_is_ready(
struct scic_sds_remote_node_context *this_rnc);
#define scic_sds_remote_node_context_set_remote_node_index(rnc, rni) \
((rnc)->remote_node_index = (rni))
#define scic_sds_remote_node_context_get_remote_node_index(rcn) \
((rnc)->remote_node_index)
......
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