diff mbox series

drm/amdgpu: remove unneeded variable

Message ID 1ccd72cc9fa4b0f1c5acceef0c21d9fb@208suo.com (mailing list archive)
State New, archived
Headers show
Series drm/amdgpu: remove unneeded variable | expand

Commit Message

baomingtong001@208suo.com June 14, 2023, 2:26 a.m. UTC
fix the following coccicheck warning:

drivers/gpu/drm/amd/pm/powerplay/hwmgr/smu7_powertune.c:1156:5-11: 
Unneeded variable: "result".

Signed-off-by: Mingtong Bao <baomingtong001@208suo.com>
---
  drivers/gpu/drm/amd/pm/powerplay/hwmgr/smu7_powertune.c | 3 +--
  1 file changed, 1 insertion(+), 2 deletions(-)

      data->power_containment_features = 0;
@@ -1191,7 +1190,7 @@ int smu7_enable_power_containment(struct pp_hwmgr 
*hwmgr)
              }
          }
      }
-    return result;
+    return 0;
  }

  int smu7_disable_power_containment(struct pp_hwmgr *hwmgr)

Comments

Alex Deucher June 15, 2023, 5:16 p.m. UTC | #1
On Wed, Jun 14, 2023 at 3:20 AM <baomingtong001@208suo.com> wrote:
>
> fix the following coccicheck warning:
>
> drivers/gpu/drm/amd/pm/powerplay/hwmgr/smu7_powertune.c:1156:5-11:
> Unneeded variable: "result".
>

This variable is used and the code fails to compile with it removed.

Alex

> Signed-off-by: Mingtong Bao <baomingtong001@208suo.com>
> ---
>   drivers/gpu/drm/amd/pm/powerplay/hwmgr/smu7_powertune.c | 3 +--
>   1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/pm/powerplay/hwmgr/smu7_powertune.c
> b/drivers/gpu/drm/amd/pm/powerplay/hwmgr/smu7_powertune.c
> index 21be23ec3c79..36aa7657c66d 100644
> --- a/drivers/gpu/drm/amd/pm/powerplay/hwmgr/smu7_powertune.c
> +++ b/drivers/gpu/drm/amd/pm/powerplay/hwmgr/smu7_powertune.c
> @@ -1153,7 +1153,6 @@ int smu7_enable_power_containment(struct pp_hwmgr
> *hwmgr)
>       struct phm_ppt_v1_information *table_info =
>               (struct phm_ppt_v1_information *)(hwmgr->pptable);
>       int smc_result;
> -    int result = 0;
>       struct phm_cac_tdp_table *cac_table;
>
>       data->power_containment_features = 0;
> @@ -1191,7 +1190,7 @@ int smu7_enable_power_containment(struct pp_hwmgr
> *hwmgr)
>               }
>           }
>       }
> -    return result;
> +    return 0;
>   }
>
>   int smu7_disable_power_containment(struct pp_hwmgr *hwmgr)
diff mbox series

Patch

diff --git a/drivers/gpu/drm/amd/pm/powerplay/hwmgr/smu7_powertune.c 
b/drivers/gpu/drm/amd/pm/powerplay/hwmgr/smu7_powertune.c
index 21be23ec3c79..36aa7657c66d 100644
--- a/drivers/gpu/drm/amd/pm/powerplay/hwmgr/smu7_powertune.c
+++ b/drivers/gpu/drm/amd/pm/powerplay/hwmgr/smu7_powertune.c
@@ -1153,7 +1153,6 @@  int smu7_enable_power_containment(struct pp_hwmgr 
*hwmgr)
      struct phm_ppt_v1_information *table_info =
              (struct phm_ppt_v1_information *)(hwmgr->pptable);
      int smc_result;
-    int result = 0;
      struct phm_cac_tdp_table *cac_table;