]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
scsi: megaraid_sas: change issue_dcmd to return void from int
authorShivasharan S <shivasharan.srikanteshwara@broadcom.com>
Fri, 10 Feb 2017 08:59:09 +0000 (00:59 -0800)
committerMartin K. Petersen <martin.petersen@oracle.com>
Mon, 13 Feb 2017 12:26:21 +0000 (07:26 -0500)
With the changes to remove checks for a valid request descriptor,
issue_dcmd will now always return DCMD_SUCCESS. This patch changes
return type of issue_dcmd to void and change all callers appropriately.

Signed-off-by: Shivasharan S <shivasharan.srikanteshwara@broadcom.com>
Signed-off-by: Kashyap Desai <kashyap.desai@broadcom.com>
Reviewed-by: Hannes Reinecke <hare@suse.com>
Reviewed-by: Tomas Henzl <thenzl@redhat.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/megaraid/megaraid_sas.h
drivers/scsi/megaraid/megaraid_sas_base.c
drivers/scsi/megaraid/megaraid_sas_fusion.c

index dff877fd082268b4a8a71c76f15713c28fe4e2e7..d9049d5054ccf0567adf6c98bf8686966c17ff11 100644 (file)
@@ -2297,7 +2297,7 @@ struct megasas_instance_template {
        u32 (*init_adapter)(struct megasas_instance *);
        u32 (*build_and_issue_cmd) (struct megasas_instance *,
                                    struct scsi_cmnd *);
-       int (*issue_dcmd)(struct megasas_instance *instance,
+       void (*issue_dcmd)(struct megasas_instance *instance,
                            struct megasas_cmd *cmd);
 };
 
index 80fcdf52eea6c380b8446bbcf19613201ed7f00c..23fb78a631f2364604d7879c0b18212f234a49f8 100644 (file)
@@ -202,12 +202,12 @@ void megasas_fusion_ocr_wq(struct work_struct *work);
 static int megasas_get_ld_vf_affiliation(struct megasas_instance *instance,
                                         int initial);
 
-int
+void
 megasas_issue_dcmd(struct megasas_instance *instance, struct megasas_cmd *cmd)
 {
        instance->instancet->fire_cmd(instance,
                cmd->frame_phys_addr, 0, instance->reg_set);
-       return 0;
+       return;
 }
 
 /**
@@ -995,13 +995,14 @@ megasas_issue_polled(struct megasas_instance *instance, struct megasas_cmd *cmd)
        frame_hdr->cmd_status = MFI_STAT_INVALID_STATUS;
        frame_hdr->flags |= cpu_to_le16(MFI_FRAME_DONT_POST_IN_REPLY_QUEUE);
 
-       if ((atomic_read(&instance->adprecovery) == MEGASAS_HW_CRITICAL_ERROR) ||
-               (instance->instancet->issue_dcmd(instance, cmd))) {
+       if (atomic_read(&instance->adprecovery) == MEGASAS_HW_CRITICAL_ERROR) {
                dev_err(&instance->pdev->dev, "Failed from %s %d\n",
                        __func__, __LINE__);
                return DCMD_NOT_FIRED;
        }
 
+       instance->instancet->issue_dcmd(instance, cmd);
+
        return wait_and_poll(instance, cmd, instance->requestorId ?
                        MEGASAS_ROUTINE_WAIT_TIME_VF : MFI_IO_TIMEOUT_SECS);
 }
@@ -1023,13 +1024,14 @@ megasas_issue_blocked_cmd(struct megasas_instance *instance,
        int ret = 0;
        cmd->cmd_status_drv = MFI_STAT_INVALID_STATUS;
 
-       if ((atomic_read(&instance->adprecovery) == MEGASAS_HW_CRITICAL_ERROR) ||
-               (instance->instancet->issue_dcmd(instance, cmd))) {
+       if (atomic_read(&instance->adprecovery) == MEGASAS_HW_CRITICAL_ERROR) {
                dev_err(&instance->pdev->dev, "Failed from %s %d\n",
                        __func__, __LINE__);
                return DCMD_NOT_FIRED;
        }
 
+       instance->instancet->issue_dcmd(instance, cmd);
+
        if (timeout) {
                ret = wait_event_timeout(instance->int_cmd_wait_q,
                                cmd->cmd_status_drv != MFI_STAT_INVALID_STATUS, timeout * HZ);
@@ -1087,13 +1089,14 @@ megasas_issue_blocked_abort_cmd(struct megasas_instance *instance,
        cmd->sync_cmd = 1;
        cmd->cmd_status_drv = MFI_STAT_INVALID_STATUS;
 
-       if ((atomic_read(&instance->adprecovery) == MEGASAS_HW_CRITICAL_ERROR) ||
-               (instance->instancet->issue_dcmd(instance, cmd))) {
+       if (atomic_read(&instance->adprecovery) == MEGASAS_HW_CRITICAL_ERROR) {
                dev_err(&instance->pdev->dev, "Failed from %s %d\n",
                        __func__, __LINE__);
                return DCMD_NOT_FIRED;
        }
 
+       instance->instancet->issue_dcmd(instance, cmd);
+
        if (timeout) {
                ret = wait_event_timeout(instance->abort_cmd_wait_q,
                                cmd->cmd_status_drv != MFI_STAT_INVALID_STATUS, timeout * HZ);
index b6c5dc5be5c7d6f5698c5e753f552758a05a3788..c38fde0c9a6bb96b9021a73fab108b651a5189be 100644 (file)
@@ -1115,7 +1115,7 @@ megasas_get_map_info(struct megasas_instance *instance)
 int
 megasas_sync_map_info(struct megasas_instance *instance)
 {
-       int ret = 0, i;
+       int i;
        struct megasas_cmd *cmd;
        struct megasas_dcmd_frame *dcmd;
        u32 size_sync_info, num_lds;
@@ -1184,7 +1184,7 @@ megasas_sync_map_info(struct megasas_instance *instance)
 
        instance->instancet->issue_dcmd(instance, cmd);
 
-       return ret;
+       return 0;
 }
 
 /*
@@ -2981,7 +2981,7 @@ build_mpt_cmd(struct megasas_instance *instance, struct megasas_cmd *cmd)
  * @cmd:                       mfi cmd pointer
  *
  */
-int
+void
 megasas_issue_dcmd_fusion(struct megasas_instance *instance,
                          struct megasas_cmd *cmd)
 {
@@ -2990,7 +2990,7 @@ megasas_issue_dcmd_fusion(struct megasas_instance *instance,
        req_desc = build_mpt_cmd(instance, cmd);
 
        megasas_fire_cmd_fusion(instance, req_desc);
-       return DCMD_SUCCESS;
+       return;
 }
 
 /**