linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] scsi: ufs: remove set but not used variable 'val'
@ 2019-08-26  1:15 zhengbin
  2019-08-26  5:55 ` Avri Altman
  2019-08-29 22:05 ` Martin K. Petersen
  0 siblings, 2 replies; 3+ messages in thread
From: zhengbin @ 2019-08-26  1:15 UTC (permalink / raw)
  To: agross, avri.altman, pedrom.sousa, jejb, martin.petersen, linux-scsi
  Cc: yi.zhang, zhengbin13

Fixes gcc '-Wunused-but-set-variable' warning:

drivers/scsi/ufs/ufs-qcom.c: In function ufs_qcom_pwr_change_notify:
drivers/scsi/ufs/ufs-qcom.c:808:6: warning: variable val set but not used [-Wunused-but-set-variable]

Fixes: 1e1e465c6d23 ("scsi/ufs: qcom: Remove ufs_qcom_phy_*() calls from host")
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: zhengbin <zhengbin13@huawei.com>
---
 drivers/scsi/ufs/ufs-qcom.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/drivers/scsi/ufs/ufs-qcom.c b/drivers/scsi/ufs/ufs-qcom.c
index 4473f33..02cdcef 100644
--- a/drivers/scsi/ufs/ufs-qcom.c
+++ b/drivers/scsi/ufs/ufs-qcom.c
@@ -800,7 +800,6 @@ static int ufs_qcom_pwr_change_notify(struct ufs_hba *hba,
 				struct ufs_pa_layer_attr *dev_max_params,
 				struct ufs_pa_layer_attr *dev_req_params)
 {
-	u32 val;
 	struct ufs_qcom_host *host = ufshcd_get_variant(hba);
 	struct ufs_dev_params ufs_qcom_cap;
 	int ret = 0;
@@ -869,8 +868,6 @@ static int ufs_qcom_pwr_change_notify(struct ufs_hba *hba,
 			ret = -EINVAL;
 		}

-		val = ~(MAX_U32 << dev_req_params->lane_tx);
-
 		/* cache the power mode parameters to use internally */
 		memcpy(&host->dev_req_params,
 				dev_req_params, sizeof(*dev_req_params));
--
2.7.4


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH v2] scsi: ufs: remove set but not used variable 'val'
  2019-08-26  1:15 [PATCH v2] scsi: ufs: remove set but not used variable 'val' zhengbin
@ 2019-08-26  5:55 ` Avri Altman
  2019-08-29 22:05 ` Martin K. Petersen
  1 sibling, 0 replies; 3+ messages in thread
From: Avri Altman @ 2019-08-26  5:55 UTC (permalink / raw)
  To: zhengbin, agross, pedrom.sousa, jejb, martin.petersen, linux-scsi
  Cc: yi.zhang

Looks fine to me.
Avri



________________________________________
From: zhengbin <zhengbin13@huawei.com>
Sent: Monday, August 26, 2019 4:15:49 AM
To: agross@kernel.org; Avri Altman; pedrom.sousa@synopsys.com; jejb@linux.ibm.com; martin.petersen@oracle.com; linux-scsi@vger.kernel.org
Cc: yi.zhang@huawei.com; zhengbin13@huawei.com
Subject: [PATCH v2] scsi: ufs: remove set but not used variable 'val'

CAUTION: This email originated from outside of Western Digital. Do not click on links or open attachments unless you recognize the sender and know that the content is safe.


Fixes gcc '-Wunused-but-set-variable' warning:

drivers/scsi/ufs/ufs-qcom.c: In function ufs_qcom_pwr_change_notify:
drivers/scsi/ufs/ufs-qcom.c:808:6: warning: variable val set but not used [-Wunused-but-set-variable]

Fixes: 1e1e465c6d23 ("scsi/ufs: qcom: Remove ufs_qcom_phy_*() calls from host")
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: zhengbin <zhengbin13@huawei.com>
---
 drivers/scsi/ufs/ufs-qcom.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/drivers/scsi/ufs/ufs-qcom.c b/drivers/scsi/ufs/ufs-qcom.c
index 4473f33..02cdcef 100644
--- a/drivers/scsi/ufs/ufs-qcom.c
+++ b/drivers/scsi/ufs/ufs-qcom.c
@@ -800,7 +800,6 @@ static int ufs_qcom_pwr_change_notify(struct ufs_hba *hba,
                                struct ufs_pa_layer_attr *dev_max_params,
                                struct ufs_pa_layer_attr *dev_req_params)
 {
-       u32 val;
        struct ufs_qcom_host *host = ufshcd_get_variant(hba);
        struct ufs_dev_params ufs_qcom_cap;
        int ret = 0;
@@ -869,8 +868,6 @@ static int ufs_qcom_pwr_change_notify(struct ufs_hba *hba,
                        ret = -EINVAL;
                }

-               val = ~(MAX_U32 << dev_req_params->lane_tx);
-
                /* cache the power mode parameters to use internally */
                memcpy(&host->dev_req_params,
                                dev_req_params, sizeof(*dev_req_params));
--
2.7.4


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH v2] scsi: ufs: remove set but not used variable 'val'
  2019-08-26  1:15 [PATCH v2] scsi: ufs: remove set but not used variable 'val' zhengbin
  2019-08-26  5:55 ` Avri Altman
@ 2019-08-29 22:05 ` Martin K. Petersen
  1 sibling, 0 replies; 3+ messages in thread
From: Martin K. Petersen @ 2019-08-29 22:05 UTC (permalink / raw)
  To: zhengbin
  Cc: agross, avri.altman, pedrom.sousa, jejb, martin.petersen,
	linux-scsi, yi.zhang


zhengbin,

> Fixes gcc '-Wunused-but-set-variable' warning:
>
> drivers/scsi/ufs/ufs-qcom.c: In function ufs_qcom_pwr_change_notify:
> drivers/scsi/ufs/ufs-qcom.c:808:6: warning: variable val set but not used [-Wunused-but-set-variable]

Applied to 5.4/scsi-queue, thanks.

-- 
Martin K. Petersen	Oracle Linux Engineering

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-08-29 22:06 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-08-26  1:15 [PATCH v2] scsi: ufs: remove set but not used variable 'val' zhengbin
2019-08-26  5:55 ` Avri Altman
2019-08-29 22:05 ` Martin K. Petersen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).