scsi: ufs: fix arguments order some trace calls
authorSubhash Jadavani <subhashj@codeaurora.org>
Wed, 11 Jan 2017 00:48:25 +0000 (16:48 -0800)
committerMartin K. Petersen <martin.petersen@oracle.com>
Thu, 12 Jan 2017 03:34:41 +0000 (22:34 -0500)
Colin Ian King reported that with commit 7ff5ab473633 ("scsi: ufs: add
tracing support") static analysis is reporting that we may have swapped
arguments on calls to:

    trace_ufshcd_runtime_resume,
    trace_ufshcd_runtime_suspend,
    trace_ufshcd_system_suspend,
    trace_ufshcd_system_resume,
and trace_ufshcd_init

Where:
    hba->uic_link_state is passed to dev_state
    hba->curr_dev_pwr_mode is passed to link_state

This wasn't intentional so it's a bug. This change fixed this bug.

Reported-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
Acked-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/ufs/ufshcd.c

index dfad19ff166c3ad76381349fc05568a5cd5f6528..a70bf066f2773d86a97e559aa9296bc54b35660d 100644 (file)
@@ -5803,7 +5803,7 @@ out:
 
        trace_ufshcd_init(dev_name(hba->dev), ret,
                ktime_to_us(ktime_sub(ktime_get(), start)),
-               hba->uic_link_state, hba->curr_dev_pwr_mode);
+               hba->curr_dev_pwr_mode, hba->uic_link_state);
        return ret;
 }
 
@@ -6817,7 +6817,7 @@ int ufshcd_system_suspend(struct ufs_hba *hba)
 out:
        trace_ufshcd_system_suspend(dev_name(hba->dev), ret,
                ktime_to_us(ktime_sub(ktime_get(), start)),
-               hba->uic_link_state, hba->curr_dev_pwr_mode);
+               hba->curr_dev_pwr_mode, hba->uic_link_state);
        if (!ret)
                hba->is_sys_suspended = true;
        return ret;
@@ -6850,7 +6850,7 @@ int ufshcd_system_resume(struct ufs_hba *hba)
 out:
        trace_ufshcd_system_resume(dev_name(hba->dev), ret,
                ktime_to_us(ktime_sub(ktime_get(), start)),
-               hba->uic_link_state, hba->curr_dev_pwr_mode);
+               hba->curr_dev_pwr_mode, hba->uic_link_state);
        return ret;
 }
 EXPORT_SYMBOL(ufshcd_system_resume);
@@ -6878,7 +6878,7 @@ int ufshcd_runtime_suspend(struct ufs_hba *hba)
 out:
        trace_ufshcd_runtime_suspend(dev_name(hba->dev), ret,
                ktime_to_us(ktime_sub(ktime_get(), start)),
-               hba->uic_link_state, hba->curr_dev_pwr_mode);
+               hba->curr_dev_pwr_mode, hba->uic_link_state);
        return ret;
 }
 EXPORT_SYMBOL(ufshcd_runtime_suspend);
@@ -6919,7 +6919,7 @@ int ufshcd_runtime_resume(struct ufs_hba *hba)
 out:
        trace_ufshcd_runtime_resume(dev_name(hba->dev), ret,
                ktime_to_us(ktime_sub(ktime_get(), start)),
-               hba->uic_link_state, hba->curr_dev_pwr_mode);
+               hba->curr_dev_pwr_mode, hba->uic_link_state);
        return ret;
 }
 EXPORT_SYMBOL(ufshcd_runtime_resume);