/*
         * 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);
 }
 
                /*
                 * 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);
        }
 }
                /*
                 * 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);
        }
 
 
 
        /**
         * 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;
 
 
 #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 */
 
 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;
 
                        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:
                                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++;
 
                                        /*
        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);
 
 
        /* 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)
                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),
 
                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),
        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]) {
                }
        }
 
-       return SCI_INVALID_HANDLE;
+       return NULL;
 }
 
 /**
        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
        ) {
        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];
        }
        struct scic_sds_controller *sc)
 {
        /* Validate the user supplied parameters. */
-       if (sc == SCI_INVALID_HANDLE)
+       if (sc == NULL)
                return 0;
 
        /*
 
        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;
 
  *    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;
 }
 
        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;
 
         * 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)
                ) {
                /*
                        &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;
        }
        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;
        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;
 
        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) {
 
  *
  * 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,
                }
        }
 
-       return SCI_INVALID_HANDLE;
+       return NULL;
 }
 
 /**
  * @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.
         * 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);
  * @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.
        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
 
        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
  * @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
        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));
 
  * @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
 {
        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;
 
 
                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
 
  * @port: This parameter specifies the SCI port object for which the callback
  *    is being invoked.  For instances where the phy on which the primitive was
  *    received is not part of a port, this parameter will be
- *    SCI_INVALID_HANDLE_T.
+ *    NULL.
  * @phy: This parameter specifies the phy on which the primitive was received.
  *
  */
  *    phy.
  * @port: This parameter specifies the port object for which the user callback
  *    is being invoked.  There may be conditions where this parameter can be
- *    SCI_INVALID_HANDLE
+ *    NULL
  * @phy: This parameter specifies the phy object for which the user callback is
  *    being invoked.
  *
  *    phy.
  * @port: This parameter specifies the port object for which the user callback
  *    is being invoked.  There may be conditions where this parameter can be
- *    SCI_INVALID_HANDLE
+ *    NULL
  * @phy: This parameter specifies the phy object for which the user callback is
  *    being invoked.
  *
 
  *    port.
  * @port: This parameter specifies the SCI port object for which the callback
  *    is being invoked.  For instances where the phy on which the primitive was
- *    received is not part of a port, this parameter will be
- *    SCI_INVALID_HANDLE_T.
+ *    received is not part of a port, this parameter will be NULL.
  * @phy: This parameter specifies the phy on which the primitive was received.
  *
  */
  *    phy.
  * @port: This parameter specifies the port object for which the user callback
  *    is being invoked.  There may be conditions where this parameter can be
- *    SCI_INVALID_HANDLE
+ *    NULL
  * @phy: This parameter specifies the phy object for which the user callback is
  *    being invoked.
  *
  *    phy.
  * @port: This parameter specifies the port object for which the user callback
  *    is being invoked.  There may be conditions where this parameter can be
- *    SCI_INVALID_HANDLE
+ *    NULL
  * @phy: This parameter specifies the phy object for which the user callback is
  *    being invoked.
  *