diff mbox series

[-next] scsi: pm80xx: Remove set but not used variable 'page_code'

Message ID 1536889136-59935-1-git-send-email-yuehaibing@huawei.com (mailing list archive)
State Accepted
Headers show
Series [-next] scsi: pm80xx: Remove set but not used variable 'page_code' | expand

Commit Message

Yue Haibing Sept. 14, 2018, 1:38 a.m. UTC
Fixes gcc '-Wunused-but-set-variable' warning:

drivers/scsi/pm8001/pm80xx_hwi.c: In function 'pm8001_set_phy_profile':
drivers/scsi/pm8001/pm80xx_hwi.c:4679:6: warning:
 variable 'page_code' set but not used [-Wunused-but-set-variable]

Signed-off-by: YueHaibing <yuehaibing@huawei.com>
---
 drivers/scsi/pm8001/pm80xx_hwi.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

Comments

Jinpu Wang Sept. 14, 2018, 7:58 a.m. UTC | #1
On Fri, Sep 14, 2018 at 3:29 AM YueHaibing <yuehaibing@huawei.com> wrote:
>
> Fixes gcc '-Wunused-but-set-variable' warning:
>
> drivers/scsi/pm8001/pm80xx_hwi.c: In function 'pm8001_set_phy_profile':
> drivers/scsi/pm8001/pm80xx_hwi.c:4679:6: warning:
>  variable 'page_code' set but not used [-Wunused-but-set-variable]
>
> Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Acked-by: Jack Wang <jinpu.wang@profitbricks.com>
Thanks!
> ---
>  drivers/scsi/pm8001/pm80xx_hwi.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/drivers/scsi/pm8001/pm80xx_hwi.c b/drivers/scsi/pm8001/pm80xx_hwi.c
> index b641875..9864a3c 100644
> --- a/drivers/scsi/pm8001/pm80xx_hwi.c
> +++ b/drivers/scsi/pm8001/pm80xx_hwi.c
> @@ -4676,9 +4676,8 @@ void mpi_set_phy_profile_req(struct pm8001_hba_info *pm8001_ha,
>  void pm8001_set_phy_profile(struct pm8001_hba_info *pm8001_ha,
>         u32 length, u8 *buf)
>  {
> -       u32 page_code, i;
> +       u32 i;
>
> -       page_code = SAS_PHY_ANALOG_SETTINGS_PAGE;
>         for (i = 0; i < pm8001_ha->chip->n_phy; i++) {
>                 mpi_set_phy_profile_req(pm8001_ha,
>                         SAS_PHY_ANALOG_SETTINGS_PAGE, i, length, (u32 *)buf);
>
Martin K. Petersen Sept. 17, 2018, 6:26 a.m. UTC | #2
YueHaibing,

> Fixes gcc '-Wunused-but-set-variable' warning:
>
> drivers/scsi/pm8001/pm80xx_hwi.c: In function 'pm8001_set_phy_profile':
> drivers/scsi/pm8001/pm80xx_hwi.c:4679:6: warning:
>  variable 'page_code' set but not used [-Wunused-but-set-variable]

Applied to 4.20/scsi-queue, thanks!
diff mbox series

Patch

diff --git a/drivers/scsi/pm8001/pm80xx_hwi.c b/drivers/scsi/pm8001/pm80xx_hwi.c
index b641875..9864a3c 100644
--- a/drivers/scsi/pm8001/pm80xx_hwi.c
+++ b/drivers/scsi/pm8001/pm80xx_hwi.c
@@ -4676,9 +4676,8 @@  void mpi_set_phy_profile_req(struct pm8001_hba_info *pm8001_ha,
 void pm8001_set_phy_profile(struct pm8001_hba_info *pm8001_ha,
 	u32 length, u8 *buf)
 {
-	u32 page_code, i;
+	u32 i;
 
-	page_code = SAS_PHY_ANALOG_SETTINGS_PAGE;
 	for (i = 0; i < pm8001_ha->chip->n_phy; i++) {
 		mpi_set_phy_profile_req(pm8001_ha,
 			SAS_PHY_ANALOG_SETTINGS_PAGE, i, length, (u32 *)buf);