diff mbox series

drm/amd/pm: remove unneeded variable

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

Commit Message

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

drivers/gpu/drm/amd/pm/swsmu/smu11/navi10_ppt.c:1657:14-18: Unneeded 
variable: "size".

Signed-off-by: Mingtong Bao <baomingtong001@208suo.com>
---
  drivers/gpu/drm/amd/pm/swsmu/smu11/navi10_ppt.c | 10 +++++-----
  1 file changed, 5 insertions(+), 5 deletions(-)


      soft_min_level = mask ? (ffs(mask) - 1) : 0;
@@ -1675,15 +1675,15 @@ static int navi10_force_clk_levels(struct 
smu_context *smu,

          ret = smu_v11_0_get_dpm_freq_by_index(smu, clk_type, 
soft_min_level, &min_freq);
          if (ret)
-            return size;
+            return 0;

          ret = smu_v11_0_get_dpm_freq_by_index(smu, clk_type, 
soft_max_level, &max_freq);
          if (ret)
-            return size;
+            return 0;

          ret = smu_v11_0_set_soft_freq_limited_range(smu, clk_type, 
min_freq, max_freq);
          if (ret)
-            return size;
+            return 0;
          break;
      case SMU_DCEFCLK:
          dev_info(smu->adev->dev,"Setting DCEFCLK min/max dpm level is 
not supported!\n");
@@ -1693,7 +1693,7 @@ static int navi10_force_clk_levels(struct 
smu_context *smu,
          break;
      }

-    return size;
+    return 0;
  }

  static int navi10_populate_umd_state_clk(struct smu_context *smu)

Comments

Alex Deucher June 15, 2023, 5:22 p.m. UTC | #1
Applied, but please check your mailer.  I had to manually fix this up.

Alex

On Wed, Jun 14, 2023 at 3:21 AM <baomingtong001@208suo.com> wrote:
>
> fix the following coccicheck warning:
>
> drivers/gpu/drm/amd/pm/swsmu/smu11/navi10_ppt.c:1657:14-18: Unneeded
> variable: "size".
>
> Signed-off-by: Mingtong Bao <baomingtong001@208suo.com>
> ---
>   drivers/gpu/drm/amd/pm/swsmu/smu11/navi10_ppt.c | 10 +++++-----
>   1 file changed, 5 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/pm/swsmu/smu11/navi10_ppt.c
> b/drivers/gpu/drm/amd/pm/swsmu/smu11/navi10_ppt.c
> index 275f708db636..c94d825a871b 100644
> --- a/drivers/gpu/drm/amd/pm/swsmu/smu11/navi10_ppt.c
> +++ b/drivers/gpu/drm/amd/pm/swsmu/smu11/navi10_ppt.c
> @@ -1654,7 +1654,7 @@ static int navi10_force_clk_levels(struct
> smu_context *smu,
>                      enum smu_clk_type clk_type, uint32_t mask)
>   {
>
> -    int ret = 0, size = 0;
> +    int ret = 0;
>       uint32_t soft_min_level = 0, soft_max_level = 0, min_freq = 0,
> max_freq = 0;
>
>       soft_min_level = mask ? (ffs(mask) - 1) : 0;
> @@ -1675,15 +1675,15 @@ static int navi10_force_clk_levels(struct
> smu_context *smu,
>
>           ret = smu_v11_0_get_dpm_freq_by_index(smu, clk_type,
> soft_min_level, &min_freq);
>           if (ret)
> -            return size;
> +            return 0;
>
>           ret = smu_v11_0_get_dpm_freq_by_index(smu, clk_type,
> soft_max_level, &max_freq);
>           if (ret)
> -            return size;
> +            return 0;
>
>           ret = smu_v11_0_set_soft_freq_limited_range(smu, clk_type,
> min_freq, max_freq);
>           if (ret)
> -            return size;
> +            return 0;
>           break;
>       case SMU_DCEFCLK:
>           dev_info(smu->adev->dev,"Setting DCEFCLK min/max dpm level is
> not supported!\n");
> @@ -1693,7 +1693,7 @@ static int navi10_force_clk_levels(struct
> smu_context *smu,
>           break;
>       }
>
> -    return size;
> +    return 0;
>   }
>
>   static int navi10_populate_umd_state_clk(struct smu_context *smu)
diff mbox series

Patch

diff --git a/drivers/gpu/drm/amd/pm/swsmu/smu11/navi10_ppt.c 
b/drivers/gpu/drm/amd/pm/swsmu/smu11/navi10_ppt.c
index 275f708db636..c94d825a871b 100644
--- a/drivers/gpu/drm/amd/pm/swsmu/smu11/navi10_ppt.c
+++ b/drivers/gpu/drm/amd/pm/swsmu/smu11/navi10_ppt.c
@@ -1654,7 +1654,7 @@  static int navi10_force_clk_levels(struct 
smu_context *smu,
                     enum smu_clk_type clk_type, uint32_t mask)
  {

-    int ret = 0, size = 0;
+    int ret = 0;
      uint32_t soft_min_level = 0, soft_max_level = 0, min_freq = 0, 
max_freq = 0;