Discussion:
[PATCH 1/1] ufs: scsi: fix sparse errors in ufshcd_system_suspend
Dolev Raviv
2014-10-05 14:10:07 UTC
Permalink
This patch fixes newly introduced sparse warning in
ufshcd_system_suspend, introduced by UFS power management series.

Sparse warning:
drivers/scsi/ufs/ufshcd.c:5118 ufshcd_system_suspend()
error: we previously assumed 'hba' could be null (see line 5089)

To fix it, we return 0 in case HBA is not initialized or is
not powered.

Signed-off-by: Dolev Raviv <***@codeaurora.org>

diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c
index 497c38a..836ea72 100644
--- a/drivers/scsi/ufs/ufshcd.c
+++ b/drivers/scsi/ufs/ufshcd.c
@@ -5087,7 +5087,7 @@ int ufshcd_system_suspend(struct ufs_hba *hba)
int ret = 0;

if (!hba || !hba->is_powered)
- goto out;
+ return 0;

if (pm_runtime_suspended(hba->dev)) {
if (hba->rpm_lvl == hba->spm_lvl)
--
1.8.5.2
--
QUALCOMM ISRAEL, on behalf of Qualcomm Innovation Center, Inc. is a member
of Code Aurora Forum, hosted by The Linux Foundation

--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to ***@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Subhash Jadavani
2014-10-05 22:44:16 UTC
Permalink
Looks good, Reviewed-by: Subhash Jadavani <***@codeaurora.org>

-----Original Message-----
From: linux-scsi-***@vger.kernel.org
[mailto:linux-scsi-***@vger.kernel.org] On Behalf Of Dolev Raviv
Sent: Sunday, October 05, 2014 7:10 AM
To: ***@HansenPartnership.com; ***@infradead.org
Cc: linux-***@vger.kernel.org; linux-arm-***@vger.kernel.org;
***@gmail.com; Dolev Raviv
Subject: [PATCH 1/1] ufs: scsi: fix sparse errors in ufshcd_system_suspend

This patch fixes newly introduced sparse warning in ufshcd_system_suspend,
introduced by UFS power management series.

Sparse warning:
drivers/scsi/ufs/ufshcd.c:5118 ufshcd_system_suspend()
error: we previously assumed 'hba' could be null (see line 5089)

To fix it, we return 0 in case HBA is not initialized or is not powered.

Signed-off-by: Dolev Raviv <***@codeaurora.org>

diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c index
497c38a..836ea72 100644
--- a/drivers/scsi/ufs/ufshcd.c
+++ b/drivers/scsi/ufs/ufshcd.c
@@ -5087,7 +5087,7 @@ int ufshcd_system_suspend(struct ufs_hba *hba)
int ret = 0;

if (!hba || !hba->is_powered)
- goto out;
+ return 0;

if (pm_runtime_suspended(hba->dev)) {
if (hba->rpm_lvl == hba->spm_lvl)
--
1.8.5.2
--
QUALCOMM ISRAEL, on behalf of Qualcomm Innovation Center, Inc. is a member
of Code Aurora Forum, hosted by The Linux Foundation

--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the
body of a message to ***@vger.kernel.org More majordomo info at
http://vger.kernel.org/majordomo-info.html
Christoph Hellwig
2014-10-11 11:06:29 UTC
Permalink
I'm getting a bit lost with all the UFS fixes, can you prepared a series
with all the fixups required for 3.18 for me please?
Christoph Hellwig
2014-10-21 14:05:56 UTC
Permalink
Post by Christoph Hellwig
I'm getting a bit lost with all the UFS fixes, can you prepared a series
with all the fixups required for 3.18 for me please?
Are you going to prepare a set of fixups for 3.18, or should I try to
cram them together? I supect you'd do a much better job than I could.
Subhash Jadavani
2014-10-21 18:50:17 UTC
Permalink
Are you going to prepare a set of fixups for 3.18, or should I try to cram
them together? I supect you'd do a much better job than I could.

Agreed. There are 3 patches already posted for sparse warning fixes but then
there were 5 new reports of sparse warning. So we (Dolev Raviv and myself)
would try to fix them soon and post all 8 patches as single patch series so
that it would be easy trace. In addition, there will be one more fix for the
issue reported by Akinobu Mita, will include it in the same in patch series.
We should be able to send you these fixes by early next week if not earlier.

-----Original Message-----
From: linux-scsi-***@vger.kernel.org
[mailto:linux-scsi-***@vger.kernel.org] On Behalf Of Christoph Hellwig
Sent: Tuesday, October 21, 2014 7:06 AM
To: Subhash Jadavani
Cc: 'Dolev Raviv'; ***@HansenPartnership.com;
linux-***@vger.kernel.org; linux-arm-***@vger.kernel.org;
***@gmail.com
Subject: Re: [PATCH 1/1] ufs: scsi: fix sparse errors in
ufshcd_system_suspend
I'm getting a bit lost with all the UFS fixes, can you prepared a
series with all the fixups required for 3.18 for me please?
Are you going to prepare a set of fixups for 3.18, or should I try to cram
them together? I supect you'd do a much better job than I could.
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the
body of a message to ***@vger.kernel.org More majordomo info at
http://vger.kernel.org/majordomo-info.html

Loading...