Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 254311
b: refs/heads/master
c: a7e536c
h: refs/heads/master
i:
  254309: f8e3c3c
  254307: 50ec046
  254303: f4293e7
v: v3
  • Loading branch information
Edmund Nadolski authored and Dan Williams committed Jul 3, 2011
1 parent 092fdd3 commit 0081cef
Show file tree
Hide file tree
Showing 12 changed files with 51 additions and 55 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 74ea9c163a5c09638b453208cd129b686b85e91e
refs/heads/master: a7e536c7d6f1796e8727f5c90d33765ae7cfd8d8
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ void sci_mdl_first_entry(
/*
* If this MDL is managing another MDL, then recursively rewind that MDL
* object as well. */
if (base_mdl->next_mdl != SCI_INVALID_HANDLE)
if (base_mdl->next_mdl != NULL)
sci_mdl_first_entry(base_mdl->next_mdl);
}

Expand All @@ -93,7 +93,7 @@ void sci_mdl_next_entry(
/*
* This MDL has exhausted it's set of entries. If this MDL is managing
* another MDL, then start iterating through that MDL. */
if (base_mdl->next_mdl != SCI_INVALID_HANDLE)
if (base_mdl->next_mdl != NULL)
sci_mdl_next_entry(base_mdl->next_mdl);
}
}
Expand All @@ -108,7 +108,7 @@ struct sci_physical_memory_descriptor *sci_mdl_get_current_entry(
/*
* This MDL has exhausted it's set of entries. If this MDL is managing
* another MDL, then return it's current entry. */
if (base_mdl->next_mdl != SCI_INVALID_HANDLE)
if (base_mdl->next_mdl != NULL)
return sci_mdl_get_current_entry(base_mdl->next_mdl);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,7 @@ struct sci_base_memory_descriptor_list {

/**
* This field simply allows a user to chain memory descriptor lists
* together if desired. This field will be initialized to
* SCI_INVALID_HANDLE.
* together if desired. This field will be initialized to NULL.
*/
struct sci_base_memory_descriptor_list *next_mdl;

Expand Down
2 changes: 0 additions & 2 deletions trunk/drivers/scsi/isci/core/sci_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,6 @@
#define sci_cb_make_physical_address(physical_addr, addr_upper, addr_lower) \
((physical_addr) = (addr_lower) | ((u64)addr_upper) << 32)

#define SCI_INVALID_HANDLE 0x0

typedef enum {
SCI_IO_REQUEST_DATA_IN = 0, /* Read operation */
SCI_IO_REQUEST_DATA_OUT, /* Write operation */
Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/scsi/isci/core/scic_phy.h
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ struct scic_sds_port;
struct scic_phy_properties {
/**
* This field specifies the port that currently contains the
* supplied phy. This field may be set to SCI_INVALID_HANDLE
* supplied phy. This field may be set to NULL
* if the phy is not currently contained in a port.
*/
struct scic_sds_port *owning_port;
Expand Down
24 changes: 12 additions & 12 deletions trunk/drivers/scsi/isci/core/scic_sds_controller.c
Original file line number Diff line number Diff line change
Expand Up @@ -890,7 +890,7 @@ enum sci_status scic_sds_controller_start_next_phy(
for (index = 0; index < SCI_MAX_PHYS; index++) {
the_phy = &this_controller->phy_table[index];

if (scic_sds_phy_get_port(the_phy) != SCI_INVALID_HANDLE) {
if (scic_sds_phy_get_port(the_phy) != NULL) {
/**
* The controller start operation is complete if and only
* if:
Expand Down Expand Up @@ -940,7 +940,7 @@ enum sci_status scic_sds_controller_start_next_phy(
scic_sds_controller_get_port_configuration_mode(this_controller)
== SCIC_PORT_MANUAL_CONFIGURATION_MODE
) {
if (scic_sds_phy_get_port(the_phy) == SCI_INVALID_HANDLE) {
if (scic_sds_phy_get_port(the_phy) == NULL) {
this_controller->next_phy_to_start++;

/*
Expand Down Expand Up @@ -1025,7 +1025,7 @@ enum sci_status scic_sds_controller_stop_devices(
status = SCI_SUCCESS;

for (index = 0; index < this_controller->remote_node_entries; index++) {
if (this_controller->device_table[index] != SCI_INVALID_HANDLE) {
if (this_controller->device_table[index] != NULL) {
/* / @todo What timeout value do we want to provide to this request? */
device_status = scic_remote_device_stop(this_controller->device_table[index], 0);

Expand Down Expand Up @@ -1197,7 +1197,7 @@ static void scic_sds_controller_task_completion(

/* Make sure that we really want to process this IO request */
if (
(io_request != SCI_INVALID_HANDLE)
(io_request != NULL)
&& (io_request->io_tag != SCI_CONTROLLER_INVALID_IO_TAG)
&& (
scic_sds_io_tag_get_sequence(io_request->io_tag)
Expand Down Expand Up @@ -1395,7 +1395,7 @@ static void scic_sds_controller_event_completion(
case SCU_EVENT_SPECIFIC_SMP_RESPONSE_NO_PE:
case SCU_EVENT_SPECIFIC_TASK_TIMEOUT:
io_request = this_controller->io_request_table[index];
if (io_request != SCI_INVALID_HANDLE)
if (io_request != NULL)
scic_sds_io_request_event_handler(io_request, completion_entry);
else
dev_warn(scic_to_dev(this_controller),
Expand All @@ -1410,7 +1410,7 @@ static void scic_sds_controller_event_completion(

case SCU_EVENT_SPECIFIC_IT_NEXUS_TIMEOUT:
device = this_controller->device_table[index];
if (device != SCI_INVALID_HANDLE)
if (device != NULL)
scic_sds_remote_device_event_handler(device, completion_entry);
else
dev_warn(scic_to_dev(this_controller),
Expand Down Expand Up @@ -2174,7 +2174,7 @@ struct scic_sds_request *scic_sds_controller_get_io_request_from_tag(
task_index = scic_sds_io_tag_get_index(io_tag);

if (task_index < this_controller->task_context_entries) {
if (this_controller->io_request_table[task_index] != SCI_INVALID_HANDLE) {
if (this_controller->io_request_table[task_index] != NULL) {
task_sequence = scic_sds_io_tag_get_sequence(io_tag);

if (task_sequence == this_controller->io_request_sequence[task_index]) {
Expand All @@ -2183,7 +2183,7 @@ struct scic_sds_request *scic_sds_controller_get_io_request_from_tag(
}
}

return SCI_INVALID_HANDLE;
return NULL;
}

/**
Expand Down Expand Up @@ -2240,7 +2240,7 @@ void scic_sds_controller_free_remote_node_context(
u32 remote_node_count = scic_sds_remote_device_node_count(the_device);

if (this_controller->device_table[node_id] == the_device) {
this_controller->device_table[node_id] = SCI_INVALID_HANDLE;
this_controller->device_table[node_id] = NULL;

scic_sds_remote_node_table_release_remote_node_index(
&this_controller->available_remote_nodes, remote_node_count, node_id
Expand All @@ -2262,7 +2262,7 @@ union scu_remote_node_context *scic_sds_controller_get_remote_node_context_buffe
) {
if (
(node_id < this_controller->remote_node_entries)
&& (this_controller->device_table[node_id] != SCI_INVALID_HANDLE)
&& (this_controller->device_table[node_id] != NULL)
) {
return &this_controller->remote_node_context_table[node_id];
}
Expand Down Expand Up @@ -2449,7 +2449,7 @@ u32 scic_controller_get_suggested_start_timeout(
struct scic_sds_controller *sc)
{
/* Validate the user supplied parameters. */
if (sc == SCI_INVALID_HANDLE)
if (sc == NULL)
return 0;

/*
Expand Down Expand Up @@ -3659,7 +3659,7 @@ static enum sci_status scic_sds_controller_ready_state_complete_io_handler(

if (status == SCI_SUCCESS) {
index = scic_sds_io_tag_get_index(the_request->io_tag);
this_controller->io_request_table[index] = SCI_INVALID_HANDLE;
this_controller->io_request_table[index] = NULL;
}

return status;
Expand Down
8 changes: 4 additions & 4 deletions trunk/drivers/scsi/isci/core/scic_sds_phy.c
Original file line number Diff line number Diff line change
Expand Up @@ -414,15 +414,15 @@ void scic_sds_phy_construct(
* containing port.
*
* This method returns a handle to a port that contains the supplied phy.
* SCI_INVALID_HANDLE This value is returned if the phy is not part of a real
* port (i.e. it's contained in the dummy port). !SCI_INVALID_HANDLE All other
* NULL This value is returned if the phy is not part of a real
* port (i.e. it's contained in the dummy port). !NULL All other
* values indicate a handle/pointer to the port containing the phy.
*/
struct scic_sds_port *scic_sds_phy_get_port(
struct scic_sds_phy *this_phy)
{
if (scic_sds_port_get_index(this_phy->owning_port) == SCIC_SDS_DUMMY_PORT)
return SCI_INVALID_HANDLE;
return NULL;

return this_phy->owning_port;
}
Expand Down Expand Up @@ -2373,7 +2373,7 @@ static enum sci_status scic_sds_phy_ready_state_event_handler(

case SCU_EVENT_BROADCAST_CHANGE:
/* Broadcast change received. Notify the port. */
if (scic_sds_phy_get_port(this_phy) != SCI_INVALID_HANDLE)
if (scic_sds_phy_get_port(this_phy) != NULL)
scic_sds_port_broadcast_change_received(this_phy->owning_port, this_phy);
else
this_phy->bcn_received_while_port_unassigned = true;
Expand Down
20 changes: 10 additions & 10 deletions trunk/drivers/scsi/isci/core/scic_sds_port.c
Original file line number Diff line number Diff line change
Expand Up @@ -277,8 +277,8 @@ enum sci_status scic_sds_port_set_phy(
* that means that the phy is not part of a port and that the port does
* not already have a phy assinged to the phy index. */
if (
(port->phy_table[phy->phy_index] == SCI_INVALID_HANDLE)
&& (scic_sds_phy_get_port(phy) == SCI_INVALID_HANDLE)
(port->phy_table[phy->phy_index] == NULL)
&& (scic_sds_phy_get_port(phy) == NULL)
&& scic_sds_port_is_valid_phy_assignment(port, phy->phy_index)
) {
/*
Expand Down Expand Up @@ -318,7 +318,7 @@ enum sci_status scic_sds_port_clear_phy(
&scic_sds_port_get_controller(port)->port_table[SCI_MAX_PORTS]
);

port->phy_table[phy->phy_index] = SCI_INVALID_HANDLE;
port->phy_table[phy->phy_index] = NULL;

return SCI_SUCCESS;
}
Expand Down Expand Up @@ -529,7 +529,7 @@ void scic_sds_port_construct(
this_port->started_request_count = 0;
this_port->assigned_device_count = 0;

this_port->timer_handle = SCI_INVALID_HANDLE;
this_port->timer_handle = NULL;

this_port->transport_layer_registers = NULL;
this_port->port_task_scheduler_registers = NULL;
Expand Down Expand Up @@ -669,7 +669,7 @@ enum sci_status scic_port_get_properties(
struct scic_sds_port *port,
struct scic_port_properties *prop)
{
if ((port == SCI_INVALID_HANDLE) ||
if ((port == NULL) ||
(port->logical_port_index == SCIC_SDS_DUMMY_PORT))
return SCI_FAILURE_INVALID_PORT;

Expand Down Expand Up @@ -1267,29 +1267,29 @@ static enum sci_status scic_sds_port_ready_operational_substate_reset_handler(
enum sci_status status = SCI_FAILURE_INVALID_PHY;
u32 phy_index;
struct scic_sds_port *this_port = (struct scic_sds_port *)port;
struct scic_sds_phy *selected_phy = SCI_INVALID_HANDLE;
struct scic_sds_phy *selected_phy = NULL;


/* Select a phy on which we can send the hard reset request. */
for (
phy_index = 0;
(phy_index < SCI_MAX_PHYS)
&& (selected_phy == SCI_INVALID_HANDLE);
&& (selected_phy == NULL);
phy_index++
) {
selected_phy = this_port->phy_table[phy_index];

if (
(selected_phy != SCI_INVALID_HANDLE)
(selected_phy != NULL)
&& !scic_sds_port_active_phy(this_port, selected_phy)
) {
/* We found a phy but it is not ready select different phy */
selected_phy = SCI_INVALID_HANDLE;
selected_phy = NULL;
}
}

/* If we have a phy then go ahead and start the reset procedure */
if (selected_phy != SCI_INVALID_HANDLE) {
if (selected_phy != NULL) {
status = scic_sds_phy_reset(selected_phy);

if (status == SCI_SUCCESS) {
Expand Down
24 changes: 12 additions & 12 deletions trunk/drivers/scsi/isci/core/scic_sds_port_configuration_agent.c
Original file line number Diff line number Diff line change
Expand Up @@ -118,9 +118,9 @@ static s32 sci_sas_address_compare(
*
* This routine will find a matching port for the phy. This means that the
* port and phy both have the same broadcast sas address and same received sas
* address. The port address or the SCI_INVALID_HANDLE if there is no matching
* address. The port address or the NULL if there is no matching
* port. port address if the port can be found to match the phy.
* SCI_INVALID_HANDLE if there is no matching port for the phy.
* NULL if there is no matching port for the phy.
*/
static struct scic_sds_port *scic_sds_port_configuration_agent_find_port(
struct scic_sds_controller *controller,
Expand Down Expand Up @@ -156,7 +156,7 @@ static struct scic_sds_port *scic_sds_port_configuration_agent_find_port(
}
}

return SCI_INVALID_HANDLE;
return NULL;
}

/**
Expand Down Expand Up @@ -390,7 +390,7 @@ static void scic_sds_mpc_agent_timeout_handler(
* @controller: This is the controller object that receives the link up
* notification.
* @port: This is the port object associated with the phy. If the is no
* associated port this is an SCI_INVALID_HANDLE.
* associated port this is an NULL.
* @phy: This is the phy object which has gone ready.
*
* This method handles the manual port configuration link up notifications.
Expand All @@ -409,7 +409,7 @@ static void scic_sds_mpc_agent_link_up(
* If the port has an invalid handle then the phy was not assigned to
* a port. This is because the phy was not given the same SAS Address
* as the other PHYs in the port. */
if (port != SCI_INVALID_HANDLE) {
if (port != NULL) {
port_agent->phy_ready_mask |= (1 << scic_sds_phy_get_index(phy));

scic_sds_port_link_up(port, phy);
Expand All @@ -425,7 +425,7 @@ static void scic_sds_mpc_agent_link_up(
* @controller: This is the controller object that receives the link down
* notification.
* @port: This is the port object associated with the phy. If the is no
* associated port this is an SCI_INVALID_HANDLE. The port is an invalid
* associated port this is an NULL. The port is an invalid
* handle only if the phy was never port of this port. This happens when
* the phy is not broadcasting the same SAS address as the other phys in the
* assigned port.
Expand All @@ -443,7 +443,7 @@ static void scic_sds_mpc_agent_link_down(
struct scic_sds_port *port,
struct scic_sds_phy *phy)
{
if (port != SCI_INVALID_HANDLE) {
if (port != NULL) {
/*
* If we can form a new port from the remainder of the phys then we want
* to start the timer to allow the SCI User to cleanup old devices and
Expand Down Expand Up @@ -573,7 +573,7 @@ static void scic_sds_apc_agent_configure_ports(

port = scic_sds_port_configuration_agent_find_port(controller, phy);

if (port != SCI_INVALID_HANDLE) {
if (port != NULL) {
if (scic_sds_port_is_valid_phy_assignment(port, phy->phy_index))
apc_activity = SCIC_SDS_APC_ADD_PHY;
else
Expand Down Expand Up @@ -680,7 +680,7 @@ static void scic_sds_apc_agent_configure_ports(
* @controller: This is the controller object that receives the link up
* notification.
* @port: This is the port object associated with the phy. If the is no
* associated port this is an SCI_INVALID_HANDLE.
* associated port this is an NULL.
* @phy: This is the phy object which has gone link up.
*
* This method handles the automatic port configuration for link up
Expand All @@ -693,7 +693,7 @@ static void scic_sds_apc_agent_link_up(
struct scic_sds_port *port,
struct scic_sds_phy *phy)
{
BUG_ON(port != SCI_INVALID_HANDLE);
BUG_ON(port != NULL);

port_agent->phy_ready_mask |= (1 << scic_sds_phy_get_index(phy));

Expand All @@ -705,7 +705,7 @@ static void scic_sds_apc_agent_link_up(
* @controller: This is the controller object that receives the link down
* notification.
* @port: This is the port object associated with the phy. If the is no
* associated port this is an SCI_INVALID_HANDLE.
* associated port this is an NULL.
* @phy: This is the phy object which has gone link down.
*
* This method handles the automatic port configuration link down
Expand All @@ -721,7 +721,7 @@ static void scic_sds_apc_agent_link_down(
{
port_agent->phy_ready_mask &= ~(1 << scic_sds_phy_get_index(phy));

if (port != SCI_INVALID_HANDLE) {
if (port != NULL) {
if (port_agent->phy_configured_mask & (1 << phy->phy_index)) {
enum sci_status status;

Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/scsi/isci/core/scic_sds_remote_device.c
Original file line number Diff line number Diff line change
Expand Up @@ -1170,7 +1170,7 @@ enum sci_status scic_sds_remote_device_general_frame_handler(
io_request = scic_sds_controller_get_io_request_from_tag(
scic_sds_remote_device_get_controller(this_device), frame_header->tag);

if ((io_request == SCI_INVALID_HANDLE)
if ((io_request == NULL)
|| (io_request->target_device != this_device)) {
/*
* We could not map this tag to a valid IO request
Expand Down
Loading

0 comments on commit 0081cef

Please sign in to comment.