All of lore.kernel.org
 help / color / mirror / Atom feed
From: Subhash Jadavani <subhashj@codeaurora.org>
To: vinholikatti@gmail.com, jejb@linux.vnet.ibm.com,
	martin.petersen@oracle.com
Cc: linux-scsi@vger.kernel.org, colin.king@canonical.com,
	Subhash Jadavani <subhashj@codeaurora.org>,
	linux-kernel@vger.kernel.org (open list)
Subject: [PATCH v1] scsi: ufs: fix arguments order some trace calls
Date: Tue, 10 Jan 2017 16:48:25 -0800	[thread overview]
Message-ID: <1484095705-3962-1-git-send-email-subhashj@codeaurora.org> (raw)

Colin Ian King <colin.king@canonical.com> 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>
---
 drivers/scsi/ufs/ufshcd.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c
index be6322e..6b56eb0 100644
--- a/drivers/scsi/ufs/ufshcd.c
+++ b/drivers/scsi/ufs/ufshcd.c
@@ -5805,7 +5805,7 @@ static int ufshcd_probe_hba(struct ufs_hba *hba)
 
 	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;
 }
 
@@ -6819,7 +6819,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;
@@ -6852,7 +6852,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);
@@ -6880,7 +6880,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);
@@ -6921,7 +6921,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);
-- 
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project

WARNING: multiple messages have this Message-ID (diff)
From: Subhash Jadavani <subhashj@codeaurora.org>
To: vinholikatti@gmail.com, jejb@linux.vnet.ibm.com,
	martin.petersen@oracle.com
Cc: linux-scsi@vger.kernel.org, colin.king@canonical.com,
	Subhash Jadavani <subhashj@codeaurora.org>,
	open list <linux-kernel@vger.kernel.org>
Subject: [PATCH v1] scsi: ufs: fix arguments order some trace calls
Date: Tue, 10 Jan 2017 16:48:25 -0800	[thread overview]
Message-ID: <1484095705-3962-1-git-send-email-subhashj@codeaurora.org> (raw)

Colin Ian King <colin.king@canonical.com> 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>
---
 drivers/scsi/ufs/ufshcd.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c
index be6322e..6b56eb0 100644
--- a/drivers/scsi/ufs/ufshcd.c
+++ b/drivers/scsi/ufs/ufshcd.c
@@ -5805,7 +5805,7 @@ static int ufshcd_probe_hba(struct ufs_hba *hba)
 
 	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;
 }
 
@@ -6819,7 +6819,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;
@@ -6852,7 +6852,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);
@@ -6880,7 +6880,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);
@@ -6921,7 +6921,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);
-- 
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project


             reply	other threads:[~2017-01-11  0:48 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-11  0:48 Subhash Jadavani [this message]
2017-01-11  0:48 ` [PATCH v1] scsi: ufs: fix arguments order some trace calls Subhash Jadavani
2017-01-11  9:30 ` Colin Ian King
2017-01-12  3:36 ` Martin K. Petersen
2017-01-12  3:36   ` Martin K. Petersen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1484095705-3962-1-git-send-email-subhashj@codeaurora.org \
    --to=subhashj@codeaurora.org \
    --cc=colin.king@canonical.com \
    --cc=jejb@linux.vnet.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=vinholikatti@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.