mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] habanalabs: remove variable 'val' set but not used
@ 2019-12-10 11:06 Chen Wandun
  2019-12-13  2:09 ` Oded Gabbay
  0 siblings, 1 reply; 2+ messages in thread
From: Chen Wandun @ 2019-12-10 11:06 UTC (permalink / raw)
  To: oded.gabbay, arnd, gregkh, rppt, ttayar, oshpigelman, dbenzoor,
	linux-kernel
  Cc: chenwandun

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

drivers/misc/habanalabs/goya/goya.c: In function goya_pldm_init_cpu:
drivers/misc/habanalabs/goya/goya.c:2195:6: warning: variable val set but not used [-Wunused-but-set-variable]
drivers/misc/habanalabs/goya/goya.c: In function goya_hw_init:
drivers/misc/habanalabs/goya/goya.c:2505:6: warning: variable val set but not used [-Wunused-but-set-variable]

Fixes: 9494a8dd8d22 ("habanalabs: add h/w queues module")
Signed-off-by: Chen Wandun <chenwandun@huawei.com>
---
 drivers/misc/habanalabs/goya/goya.c | 15 +++++++--------
 1 file changed, 7 insertions(+), 8 deletions(-)

diff --git a/drivers/misc/habanalabs/goya/goya.c b/drivers/misc/habanalabs/goya/goya.c
index c8d16aa..7344e8a 100644
--- a/drivers/misc/habanalabs/goya/goya.c
+++ b/drivers/misc/habanalabs/goya/goya.c
@@ -2192,7 +2192,7 @@ static int goya_push_linux_to_device(struct hl_device *hdev)
 
 static int goya_pldm_init_cpu(struct hl_device *hdev)
 {
-	u32 val, unit_rst_val;
+	u32 unit_rst_val;
 	int rc;
 
 	/* Must initialize SRAM scrambler before pushing u-boot to SRAM */
@@ -2200,14 +2200,14 @@ static int goya_pldm_init_cpu(struct hl_device *hdev)
 
 	/* Put ARM cores into reset */
 	WREG32(mmCPU_CA53_CFG_ARM_RST_CONTROL, CPU_RESET_ASSERT);
-	val = RREG32(mmCPU_CA53_CFG_ARM_RST_CONTROL);
+	RREG32(mmCPU_CA53_CFG_ARM_RST_CONTROL);
 
 	/* Reset the CA53 MACRO */
 	unit_rst_val = RREG32(mmPSOC_GLOBAL_CONF_UNIT_RST_N);
 	WREG32(mmPSOC_GLOBAL_CONF_UNIT_RST_N, CA53_RESET);
-	val = RREG32(mmPSOC_GLOBAL_CONF_UNIT_RST_N);
+	RREG32(mmPSOC_GLOBAL_CONF_UNIT_RST_N);
 	WREG32(mmPSOC_GLOBAL_CONF_UNIT_RST_N, unit_rst_val);
-	val = RREG32(mmPSOC_GLOBAL_CONF_UNIT_RST_N);
+	RREG32(mmPSOC_GLOBAL_CONF_UNIT_RST_N);
 
 	rc = goya_push_uboot_to_device(hdev);
 	if (rc)
@@ -2228,7 +2228,7 @@ static int goya_pldm_init_cpu(struct hl_device *hdev)
 	/* Release ARM core 0 from reset */
 	WREG32(mmCPU_CA53_CFG_ARM_RST_CONTROL,
 					CPU_RESET_CORE0_DEASSERT);
-	val = RREG32(mmCPU_CA53_CFG_ARM_RST_CONTROL);
+	RREG32(mmCPU_CA53_CFG_ARM_RST_CONTROL);
 
 	return 0;
 }
@@ -2502,13 +2502,12 @@ int goya_mmu_init(struct hl_device *hdev)
 static int goya_hw_init(struct hl_device *hdev)
 {
 	struct asic_fixed_properties *prop = &hdev->asic_prop;
-	u32 val;
 	int rc;
 
 	dev_info(hdev->dev, "Starting initialization of H/W\n");
 
 	/* Perform read from the device to make sure device is up */
-	val = RREG32(mmPCIE_DBI_DEVICE_ID_VENDOR_ID_REG);
+	RREG32(mmPCIE_DBI_DEVICE_ID_VENDOR_ID_REG);
 
 	/*
 	 * Let's mark in the H/W that we have reached this point. We check
@@ -2560,7 +2559,7 @@ static int goya_hw_init(struct hl_device *hdev)
 		goto disable_queues;
 
 	/* Perform read from the device to flush all MSI-X configuration */
-	val = RREG32(mmPCIE_DBI_DEVICE_ID_VENDOR_ID_REG);
+	RREG32(mmPCIE_DBI_DEVICE_ID_VENDOR_ID_REG);
 
 	return 0;
 
-- 
2.7.4


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

* Re: [PATCH] habanalabs: remove variable 'val' set but not used
  2019-12-10 11:06 [PATCH] habanalabs: remove variable 'val' set but not used Chen Wandun
@ 2019-12-13  2:09 ` Oded Gabbay
  0 siblings, 0 replies; 2+ messages in thread
From: Oded Gabbay @ 2019-12-13  2:09 UTC (permalink / raw)
  To: Chen Wandun
  Cc: Arnd Bergmann, Greg Kroah-Hartman, Mike Rapoport, Tomer Tayar,
	Omer Shpigelman, Dalit Ben Zoor, Linux-Kernel@Vger. Kernel. Org

On Tue, Dec 10, 2019 at 1:00 PM Chen Wandun <chenwandun@huawei.com> wrote:
>
> Fixes gcc '-Wunused-but-set-variable' warning:
>
> drivers/misc/habanalabs/goya/goya.c: In function goya_pldm_init_cpu:
> drivers/misc/habanalabs/goya/goya.c:2195:6: warning: variable val set but not used [-Wunused-but-set-variable]
> drivers/misc/habanalabs/goya/goya.c: In function goya_hw_init:
> drivers/misc/habanalabs/goya/goya.c:2505:6: warning: variable val set but not used [-Wunused-but-set-variable]
>
> Fixes: 9494a8dd8d22 ("habanalabs: add h/w queues module")
> Signed-off-by: Chen Wandun <chenwandun@huawei.com>
> ---
>  drivers/misc/habanalabs/goya/goya.c | 15 +++++++--------
>  1 file changed, 7 insertions(+), 8 deletions(-)
>
> diff --git a/drivers/misc/habanalabs/goya/goya.c b/drivers/misc/habanalabs/goya/goya.c
> index c8d16aa..7344e8a 100644
> --- a/drivers/misc/habanalabs/goya/goya.c
> +++ b/drivers/misc/habanalabs/goya/goya.c
> @@ -2192,7 +2192,7 @@ static int goya_push_linux_to_device(struct hl_device *hdev)
>
>  static int goya_pldm_init_cpu(struct hl_device *hdev)
>  {
> -       u32 val, unit_rst_val;
> +       u32 unit_rst_val;
>         int rc;
>
>         /* Must initialize SRAM scrambler before pushing u-boot to SRAM */
> @@ -2200,14 +2200,14 @@ static int goya_pldm_init_cpu(struct hl_device *hdev)
>
>         /* Put ARM cores into reset */
>         WREG32(mmCPU_CA53_CFG_ARM_RST_CONTROL, CPU_RESET_ASSERT);
> -       val = RREG32(mmCPU_CA53_CFG_ARM_RST_CONTROL);
> +       RREG32(mmCPU_CA53_CFG_ARM_RST_CONTROL);
>
>         /* Reset the CA53 MACRO */
>         unit_rst_val = RREG32(mmPSOC_GLOBAL_CONF_UNIT_RST_N);
>         WREG32(mmPSOC_GLOBAL_CONF_UNIT_RST_N, CA53_RESET);
> -       val = RREG32(mmPSOC_GLOBAL_CONF_UNIT_RST_N);
> +       RREG32(mmPSOC_GLOBAL_CONF_UNIT_RST_N);
>         WREG32(mmPSOC_GLOBAL_CONF_UNIT_RST_N, unit_rst_val);
> -       val = RREG32(mmPSOC_GLOBAL_CONF_UNIT_RST_N);
> +       RREG32(mmPSOC_GLOBAL_CONF_UNIT_RST_N);
>
>         rc = goya_push_uboot_to_device(hdev);
>         if (rc)
> @@ -2228,7 +2228,7 @@ static int goya_pldm_init_cpu(struct hl_device *hdev)
>         /* Release ARM core 0 from reset */
>         WREG32(mmCPU_CA53_CFG_ARM_RST_CONTROL,
>                                         CPU_RESET_CORE0_DEASSERT);
> -       val = RREG32(mmCPU_CA53_CFG_ARM_RST_CONTROL);
> +       RREG32(mmCPU_CA53_CFG_ARM_RST_CONTROL);
>
>         return 0;
>  }
> @@ -2502,13 +2502,12 @@ int goya_mmu_init(struct hl_device *hdev)
>  static int goya_hw_init(struct hl_device *hdev)
>  {
>         struct asic_fixed_properties *prop = &hdev->asic_prop;
> -       u32 val;
>         int rc;
>
>         dev_info(hdev->dev, "Starting initialization of H/W\n");
>
>         /* Perform read from the device to make sure device is up */
> -       val = RREG32(mmPCIE_DBI_DEVICE_ID_VENDOR_ID_REG);
> +       RREG32(mmPCIE_DBI_DEVICE_ID_VENDOR_ID_REG);
>
>         /*
>          * Let's mark in the H/W that we have reached this point. We check
> @@ -2560,7 +2559,7 @@ static int goya_hw_init(struct hl_device *hdev)
>                 goto disable_queues;
>
>         /* Perform read from the device to flush all MSI-X configuration */
> -       val = RREG32(mmPCIE_DBI_DEVICE_ID_VENDOR_ID_REG);
> +       RREG32(mmPCIE_DBI_DEVICE_ID_VENDOR_ID_REG);
>
>         return 0;
>
> --
> 2.7.4
>

Thanks!
Applied to -fixes
Oded

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

end of thread, other threads:[~2019-12-13  2:09 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-12-10 11:06 [PATCH] habanalabs: remove variable 'val' set but not used Chen Wandun
2019-12-13  2:09 ` Oded Gabbay

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®