* [PATCH] drm/amd/pm: remove unneeded variable
[not found] <20230614021546.39168-1-luojianhong@cdjrlc.com>
@ 2023-06-14 2:19 ` baomingtong001
2023-06-15 17:22 ` Alex Deucher
0 siblings, 1 reply; 2+ messages in thread
From: baomingtong001 @ 2023-06-14 2:19 UTC (permalink / raw)
To: evan.quan, alexander.deucher, christian.koenig, airlied
Cc: dri-devel, amd-gfx
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)
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] drm/amd/pm: remove unneeded variable
2023-06-14 2:19 ` [PATCH] drm/amd/pm: remove unneeded variable baomingtong001
@ 2023-06-15 17:22 ` Alex Deucher
0 siblings, 0 replies; 2+ messages in thread
From: Alex Deucher @ 2023-06-15 17:22 UTC (permalink / raw)
To: baomingtong001
Cc: dri-devel, amd-gfx, alexander.deucher, evan.quan, christian.koenig
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)
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2023-06-15 17:23 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <20230614021546.39168-1-luojianhong@cdjrlc.com>
2023-06-14 2:19 ` [PATCH] drm/amd/pm: remove unneeded variable baomingtong001
2023-06-15 17:22 ` Alex Deucher
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).