isci: sparse warnings cleanup
authorBartosz Barcinski <Bartosz.Barcinski@intel.com>
Wed, 13 Apr 2011 00:28:41 +0000 (17:28 -0700)
committerDan Williams <dan.j.williams@intel.com>
Sun, 3 Jul 2011 11:00:37 +0000 (04:00 -0700)
Clean warnings and errors reported by sparse tool.

request.c:430:50: warning: mixing different enum types
remote_device.c:534:39: warning: symbol 'flags' shadows an earlier one
task.c:495:44: warning: mixing different enum types
scic_sds_controller.c:2155:24: warning: mixing different enum types
scic_sds_controller.c:2272:36: warning: mixing different enum types
scic_sds_controller.c:2911:38: warning: incorrect type in initializer (different address spaces)
scic_sds_controller.c:2913:25: warning: incorrect type in argument 2 (different address spaces)
scic_sds_request.c:875:34: warning: cast removes address space of expression
scic_sds_request.c:876:123: warning: incorrect type in argument 2 (different address spaces)
scic_sds_port.c:585:51: warning: incorrect type in assignment (different address spaces)
scic_sds_port.c:712:9: warning: incorrect type in argument 2 (different address spaces)
scic_sds_port.c:1770:25: warning: incorrect type in argument 2 (different address spaces)

Signed-off-by: Bartosz Barcinski <Bartosz.Barcinski@intel.com>
Signed-off-by: Maciej Patelczyk <maciej.patelczyk@intel.com>
[fixed up some false positives and misconversions]
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
drivers/scsi/isci/core/scic_controller.h
drivers/scsi/isci/core/scic_sds_controller.c
drivers/scsi/isci/core/scic_sds_port.h
drivers/scsi/isci/core/scic_sds_request.c
drivers/scsi/isci/remote_device.c
drivers/scsi/isci/task.c

index 23a2c785fecd03b96b299653818eceacb6b24d5b..23c7b5c004f452dbc4f159f1be878fb23b767524 100644 (file)
@@ -98,7 +98,7 @@ enum sci_status scic_controller_stop(
 enum sci_status scic_controller_reset(
        struct scic_sds_controller *controller);
 
-enum sci_io_status scic_controller_start_io(
+enum sci_status scic_controller_start_io(
        struct scic_sds_controller *controller,
        struct scic_sds_remote_device *remote_device,
        struct scic_sds_request *io_request,
index 78b2e6f76d1a8a64ef2773a9276529109df24558..8194618b76c6f28baad81d19989cc6d521609e5a 100644 (file)
@@ -1967,10 +1967,10 @@ enum sci_status scic_controller_reset(
  * requirement for the user to call scic_stp_io_set_ncq_tag() prior to invoking
  * the scic_controller_start_io() method. scic_controller_allocate_tag() for
  * more information on allocating a tag. Indicate if the controller
- * successfully started the IO request. SCI_IO_SUCCESS if the IO request was
+ * successfully started the IO request. SCI_SUCCESS if the IO request was
  * successfully started. Determine the failure situations and return values.
  */
-enum sci_io_status scic_controller_start_io(
+enum sci_status scic_controller_start_io(
        struct scic_sds_controller *scic,
        struct scic_sds_remote_device *rdev,
        struct scic_sds_request *req,
@@ -2723,8 +2723,8 @@ enum sci_status scic_controller_initialize(
                 * logical ports
                 */
                for (index = 0; index < max_supported_ports; index++) {
-                       struct scu_port_task_scheduler_group_registers *ptsg =
-                               &scic->scu_registers->peg0.ptsg;
+                       struct scu_port_task_scheduler_group_registers __iomem
+                               *ptsg = &scic->scu_registers->peg0.ptsg;
 
                        writel(index, &ptsg->protocol_engine[index]);
                }
index a17c64a7cbf26e63e72898d765fd06e309fe8aae..c7741e81336ed318c5807a798a8a9e4604cf9096 100644 (file)
@@ -250,7 +250,7 @@ struct scic_sds_port {
         * task scheduler group PE configuration registers.
         * It is used to assign PEs to a port.
         */
-       u32 *port_pe_configuration_register;
+       u32 __iomem *port_pe_configuration_register;
 
        /**
         * This field is the VIIT register space for ths port object.
index 191b5d0f1a530147f0114998d46d66d2b2d9c6d5..64aa9c60836f70f9d4dda022bda016c0415e42dc 100644 (file)
@@ -850,19 +850,20 @@ void *scic_io_request_get_response_iu_address(
 u32 scic_io_request_get_number_of_bytes_transferred(
        struct scic_sds_request *scic_sds_request)
 {
+       struct scic_sds_controller *scic = scic_sds_request->owning_controller;
        u32 ret_val = 0;
 
-       if (readl(&scic_sds_request->owning_controller->smu_registers->address_modifier) == 0) {
+       if (readl(&scic->smu_registers->address_modifier) == 0) {
+               void __iomem *scu_reg_base = scic->scu_registers;
                /*
                 * get the bytes of data from the Address == BAR1 + 20002Ch + (256*TCi) where
                 *   BAR1 is the scu_registers
                 *   0x20002C = 0x200000 + 0x2c
                 *            = start of task context SRAM + offset of (type.ssp.data_offset)
                 *   TCi is the io_tag of struct scic_sds_request */
-               ret_val = readl((u8 *)scic_sds_request->owning_controller->scu_registers +
-                               (SCU_TASK_CONTEXT_SRAM + SCI_FIELD_OFFSET(struct scu_task_context, type.ssp.data_offset)) +
-                               ((sizeof(struct scu_task_context)) * scic_sds_io_tag_get_index(scic_sds_request->io_tag))
-                       );
+               ret_val = readl(scu_reg_base +
+                               (SCU_TASK_CONTEXT_SRAM + offsetof(struct scu_task_context, type.ssp.data_offset)) +
+                               ((sizeof(struct scu_task_context)) * scic_sds_io_tag_get_index(scic_sds_request->io_tag)));
        }
 
        return ret_val;
index ab638ec5881c40f8a0d41e532f336e96cb6f8fd4..320850cf46f2fb7885b1d266089c992570443eb9 100644 (file)
@@ -513,15 +513,13 @@ bool isci_device_is_reset_pending(
                        __func__, isci_device, isci_request);
 
                if (isci_request->ttype == io_task) {
-
-                       unsigned long flags;
                        struct sas_task *task = isci_request_access_task(
                                isci_request);
 
-                       spin_lock_irqsave(&task->task_state_lock, flags);
+                       spin_lock(&task->task_state_lock);
                        if (task->task_state_flags & SAS_TASK_NEED_DEV_RESET)
                                reset_is_pending = true;
-                       spin_unlock_irqrestore(&task->task_state_lock, flags);
+                       spin_unlock(&task->task_state_lock);
                }
        }
 
index aa6b43067e25d77d3da9dc5e6ad286324f85674a..b88101e195d17bad6dd80f66619f0b74abdd18f1 100644 (file)
@@ -429,7 +429,7 @@ int isci_task_execute_tmf(
        unsigned long timeout_ms)
 {
        DECLARE_COMPLETION_ONSTACK(completion);
-       enum sci_status status = SCI_FAILURE;
+       enum sci_task_status status = SCI_TASK_FAILURE;
        struct scic_sds_remote_device *sci_device;
        struct isci_remote_device *isci_device = tmf->device;
        struct isci_request *request;
@@ -488,7 +488,7 @@ int isci_task_execute_tmf(
                SCI_CONTROLLER_INVALID_IO_TAG
                );
 
-       if (status != SCI_SUCCESS) {
+       if (status != SCI_TASK_SUCCESS) {
                dev_warn(&isci_host->pdev->dev,
                         "%s: start_io failed - status = 0x%x, request = %p\n",
                         __func__,