Commit a7e536c7 authored by Edmund Nadolski's avatar Edmund Nadolski Committed by Dan Williams
Browse files

isci: remove SCI_INVALID_HANDLE



Replace SCI_INVALID_HANDLE with NULL

Signed-off-by: default avatarEdmund Nadolski <edmund.nadolski@intel.com>
Signed-off-by: default avatarDan Williams <dan.j.williams@intel.com>
parent 74ea9c16
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -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);
}

@@ -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);
	}
}
@@ -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);
	}

+1 −2
Original line number Diff line number Diff line
@@ -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;

+0 −2
Original line number Diff line number Diff line
@@ -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 */
+1 −1
Original line number Diff line number Diff line
@@ -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;
+12 −12
Original line number Diff line number Diff line
@@ -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:
@@ -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++;

					/*
@@ -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);

@@ -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)
@@ -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),
@@ -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),
@@ -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]) {
@@ -2183,7 +2183,7 @@ struct scic_sds_request *scic_sds_controller_get_io_request_from_tag(
		}
	}

	return SCI_INVALID_HANDLE;
	return NULL;
}

/**
@@ -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
@@ -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];
	}
@@ -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;

	/*
@@ -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;
Loading