* [PATCH] drm/amd/pm: remove unused num_of_active_display variable
@ 2023-03-31 16:40 Tom Rix
2023-04-07 18:17 ` Nick Desaulniers
2023-04-10 0:48 ` Quan, Evan
0 siblings, 2 replies; 4+ messages in thread
From: Tom Rix @ 2023-03-31 16:40 UTC (permalink / raw)
To: evan.quan, alexander.deucher, christian.koenig, Xinhui.Pan,
airlied, daniel, nathan, ndesaulniers, Hawking.Zhang,
kenneth.feng, lijo.lazar, KevinYang.Wang, tim.huang, andrealmeid,
Kun.Liu2, mario.limonciello
Cc: amd-gfx, dri-devel, linux-kernel, llvm, Tom Rix
clang with W=1 reports
drivers/gpu/drm/amd/amdgpu/../pm/swsmu/amdgpu_smu.c:1700:6: error: variable
'num_of_active_display' set but not used [-Werror,-Wunused-but-set-variable]
int num_of_active_display = 0;
^
This variable is not used so remove it.
Signed-off-by: Tom Rix <trix@redhat.com>
---
drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c | 7 -------
1 file changed, 7 deletions(-)
diff --git a/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c b/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c
index b5d64749990e..f93f7a9ed631 100644
--- a/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c
+++ b/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c
@@ -1696,8 +1696,6 @@ static int smu_display_configuration_change(void *handle,
const struct amd_pp_display_configuration *display_config)
{
struct smu_context *smu = handle;
- int index = 0;
- int num_of_active_display = 0;
if (!smu->pm_enabled || !smu->adev->pm.dpm_enabled)
return -EOPNOTSUPP;
@@ -1708,11 +1706,6 @@ static int smu_display_configuration_change(void *handle,
smu_set_min_dcef_deep_sleep(smu,
display_config->min_dcef_deep_sleep_set_clk / 100);
- for (index = 0; index < display_config->num_path_including_non_display; index++) {
- if (display_config->displays[index].controller_id != 0)
- num_of_active_display++;
- }
-
return 0;
}
--
2.27.0
^ permalink raw reply related [flat|nested] 4+ messages in thread* Re: [PATCH] drm/amd/pm: remove unused num_of_active_display variable 2023-03-31 16:40 [PATCH] drm/amd/pm: remove unused num_of_active_display variable Tom Rix @ 2023-04-07 18:17 ` Nick Desaulniers 2023-04-10 0:48 ` Quan, Evan 1 sibling, 0 replies; 4+ messages in thread From: Nick Desaulniers @ 2023-04-07 18:17 UTC (permalink / raw) To: Tom Rix Cc: evan.quan, alexander.deucher, christian.koenig, Xinhui.Pan, airlied, daniel, nathan, Hawking.Zhang, kenneth.feng, lijo.lazar, KevinYang.Wang, tim.huang, andrealmeid, Kun.Liu2, mario.limonciello, amd-gfx, dri-devel, linux-kernel, llvm On Fri, Mar 31, 2023 at 9:40 AM Tom Rix <trix@redhat.com> wrote: > > clang with W=1 reports > drivers/gpu/drm/amd/amdgpu/../pm/swsmu/amdgpu_smu.c:1700:6: error: variable > 'num_of_active_display' set but not used [-Werror,-Wunused-but-set-variable] > int num_of_active_display = 0; > ^ > This variable is not used so remove it. > > Signed-off-by: Tom Rix <trix@redhat.com> Thanks for the patch! Fixes: commit 75145aab7a0d ("drm/amdgpu/swsmu: clean up a bunch of stale interfaces") Reviewed-by: Nick Desaulniers <ndesaulniers@google.com> > --- > drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c | 7 ------- > 1 file changed, 7 deletions(-) > > diff --git a/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c b/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c > index b5d64749990e..f93f7a9ed631 100644 > --- a/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c > +++ b/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c > @@ -1696,8 +1696,6 @@ static int smu_display_configuration_change(void *handle, > const struct amd_pp_display_configuration *display_config) > { > struct smu_context *smu = handle; > - int index = 0; > - int num_of_active_display = 0; > > if (!smu->pm_enabled || !smu->adev->pm.dpm_enabled) > return -EOPNOTSUPP; > @@ -1708,11 +1706,6 @@ static int smu_display_configuration_change(void *handle, > smu_set_min_dcef_deep_sleep(smu, > display_config->min_dcef_deep_sleep_set_clk / 100); > > - for (index = 0; index < display_config->num_path_including_non_display; index++) { > - if (display_config->displays[index].controller_id != 0) > - num_of_active_display++; > - } > - > return 0; > } > > -- > 2.27.0 > -- Thanks, ~Nick Desaulniers ^ permalink raw reply [flat|nested] 4+ messages in thread
* RE: [PATCH] drm/amd/pm: remove unused num_of_active_display variable 2023-03-31 16:40 [PATCH] drm/amd/pm: remove unused num_of_active_display variable Tom Rix 2023-04-07 18:17 ` Nick Desaulniers @ 2023-04-10 0:48 ` Quan, Evan 2023-04-11 14:46 ` Alex Deucher 1 sibling, 1 reply; 4+ messages in thread From: Quan, Evan @ 2023-04-10 0:48 UTC (permalink / raw) To: Tom Rix, Deucher, Alexander, Koenig, Christian, Pan, Xinhui, airlied@gmail.com, daniel@ffwll.ch, nathan@kernel.org, ndesaulniers@google.com, Zhang, Hawking, Feng, Kenneth, Lazar, Lijo, Wang, Yang(Kevin), Huang, Tim, andrealmeid@igalia.com, Liu, Kun, Limonciello, Mario Cc: amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, llvm@lists.linux.dev [AMD Official Use Only - General] Reviewed-by: Evan Quan <evan.quan@amd.com> > -----Original Message----- > From: Tom Rix <trix@redhat.com> > Sent: Saturday, April 1, 2023 12:41 AM > To: Quan, Evan <Evan.Quan@amd.com>; Deucher, Alexander > <Alexander.Deucher@amd.com>; Koenig, Christian > <Christian.Koenig@amd.com>; Pan, Xinhui <Xinhui.Pan@amd.com>; > airlied@gmail.com; daniel@ffwll.ch; nathan@kernel.org; > ndesaulniers@google.com; Zhang, Hawking <Hawking.Zhang@amd.com>; > Feng, Kenneth <Kenneth.Feng@amd.com>; Lazar, Lijo > <Lijo.Lazar@amd.com>; Wang, Yang(Kevin) <KevinYang.Wang@amd.com>; > Huang, Tim <Tim.Huang@amd.com>; andrealmeid@igalia.com; Liu, Kun > <Kun.Liu2@amd.com>; Limonciello, Mario <Mario.Limonciello@amd.com> > Cc: amd-gfx@lists.freedesktop.org; dri-devel@lists.freedesktop.org; linux- > kernel@vger.kernel.org; llvm@lists.linux.dev; Tom Rix <trix@redhat.com> > Subject: [PATCH] drm/amd/pm: remove unused num_of_active_display > variable > > clang with W=1 reports > drivers/gpu/drm/amd/amdgpu/../pm/swsmu/amdgpu_smu.c:1700:6: error: > variable > 'num_of_active_display' set but not used [-Werror,-Wunused-but-set- > variable] > int num_of_active_display = 0; > ^ > This variable is not used so remove it. > > Signed-off-by: Tom Rix <trix@redhat.com> > --- > drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c | 7 ------- > 1 file changed, 7 deletions(-) > > diff --git a/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c > b/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c > index b5d64749990e..f93f7a9ed631 100644 > --- a/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c > +++ b/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c > @@ -1696,8 +1696,6 @@ static int smu_display_configuration_change(void > *handle, > const struct > amd_pp_display_configuration *display_config) { > struct smu_context *smu = handle; > - int index = 0; > - int num_of_active_display = 0; > > if (!smu->pm_enabled || !smu->adev->pm.dpm_enabled) > return -EOPNOTSUPP; > @@ -1708,11 +1706,6 @@ static int smu_display_configuration_change(void > *handle, > smu_set_min_dcef_deep_sleep(smu, > display_config- > >min_dcef_deep_sleep_set_clk / 100); > > - for (index = 0; index < display_config- > >num_path_including_non_display; index++) { > - if (display_config->displays[index].controller_id != 0) > - num_of_active_display++; > - } > - > return 0; > } > > -- > 2.27.0 ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] drm/amd/pm: remove unused num_of_active_display variable 2023-04-10 0:48 ` Quan, Evan @ 2023-04-11 14:46 ` Alex Deucher 0 siblings, 0 replies; 4+ messages in thread From: Alex Deucher @ 2023-04-11 14:46 UTC (permalink / raw) To: Quan, Evan Cc: Tom Rix, Deucher, Alexander, Koenig, Christian, Pan, Xinhui, airlied@gmail.com, daniel@ffwll.ch, nathan@kernel.org, ndesaulniers@google.com, Zhang, Hawking, Feng, Kenneth, Lazar, Lijo, Wang, Yang(Kevin), Huang, Tim, andrealmeid@igalia.com, Liu, Kun, Limonciello, Mario, llvm@lists.linux.dev, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, linux-kernel@vger.kernel.org Applied. Thanks! On Sun, Apr 9, 2023 at 8:48 PM Quan, Evan <Evan.Quan@amd.com> wrote: > > [AMD Official Use Only - General] > > Reviewed-by: Evan Quan <evan.quan@amd.com> > > > -----Original Message----- > > From: Tom Rix <trix@redhat.com> > > Sent: Saturday, April 1, 2023 12:41 AM > > To: Quan, Evan <Evan.Quan@amd.com>; Deucher, Alexander > > <Alexander.Deucher@amd.com>; Koenig, Christian > > <Christian.Koenig@amd.com>; Pan, Xinhui <Xinhui.Pan@amd.com>; > > airlied@gmail.com; daniel@ffwll.ch; nathan@kernel.org; > > ndesaulniers@google.com; Zhang, Hawking <Hawking.Zhang@amd.com>; > > Feng, Kenneth <Kenneth.Feng@amd.com>; Lazar, Lijo > > <Lijo.Lazar@amd.com>; Wang, Yang(Kevin) <KevinYang.Wang@amd.com>; > > Huang, Tim <Tim.Huang@amd.com>; andrealmeid@igalia.com; Liu, Kun > > <Kun.Liu2@amd.com>; Limonciello, Mario <Mario.Limonciello@amd.com> > > Cc: amd-gfx@lists.freedesktop.org; dri-devel@lists.freedesktop.org; linux- > > kernel@vger.kernel.org; llvm@lists.linux.dev; Tom Rix <trix@redhat.com> > > Subject: [PATCH] drm/amd/pm: remove unused num_of_active_display > > variable > > > > clang with W=1 reports > > drivers/gpu/drm/amd/amdgpu/../pm/swsmu/amdgpu_smu.c:1700:6: error: > > variable > > 'num_of_active_display' set but not used [-Werror,-Wunused-but-set- > > variable] > > int num_of_active_display = 0; > > ^ > > This variable is not used so remove it. > > > > Signed-off-by: Tom Rix <trix@redhat.com> > > --- > > drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c | 7 ------- > > 1 file changed, 7 deletions(-) > > > > diff --git a/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c > > b/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c > > index b5d64749990e..f93f7a9ed631 100644 > > --- a/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c > > +++ b/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c > > @@ -1696,8 +1696,6 @@ static int smu_display_configuration_change(void > > *handle, > > const struct > > amd_pp_display_configuration *display_config) { > > struct smu_context *smu = handle; > > - int index = 0; > > - int num_of_active_display = 0; > > > > if (!smu->pm_enabled || !smu->adev->pm.dpm_enabled) > > return -EOPNOTSUPP; > > @@ -1708,11 +1706,6 @@ static int smu_display_configuration_change(void > > *handle, > > smu_set_min_dcef_deep_sleep(smu, > > display_config- > > >min_dcef_deep_sleep_set_clk / 100); > > > > - for (index = 0; index < display_config- > > >num_path_including_non_display; index++) { > > - if (display_config->displays[index].controller_id != 0) > > - num_of_active_display++; > > - } > > - > > return 0; > > } > > > > -- > > 2.27.0 ^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2023-04-11 14:46 UTC | newest] Thread overview: 4+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2023-03-31 16:40 [PATCH] drm/amd/pm: remove unused num_of_active_display variable Tom Rix 2023-04-07 18:17 ` Nick Desaulniers 2023-04-10 0:48 ` Quan, Evan 2023-04-11 14:46 ` Alex Deucher
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox