Re: [PATCH] drm/amd/pm: remove unused num_of_active_display variable

2023-04-11 Thread Alex Deucher
Applied.  Thanks!

On Sun, Apr 9, 2023 at 8:48 PM Quan, Evan  wrote:
>
> [AMD Official Use Only - General]
>
> Reviewed-by: Evan Quan 
>
> > -Original Message-
> > From: Tom Rix 
> > Sent: Saturday, April 1, 2023 12:41 AM
> > To: Quan, Evan ; Deucher, Alexander
> > ; Koenig, Christian
> > ; Pan, Xinhui ;
> > airl...@gmail.com; dan...@ffwll.ch; nat...@kernel.org;
> > ndesaulni...@google.com; Zhang, Hawking ;
> > Feng, Kenneth ; Lazar, Lijo
> > ; Wang, Yang(Kevin) ;
> > Huang, Tim ; andrealm...@igalia.com; Liu, Kun
> > ; Limonciello, Mario 
> > Cc: amd-...@lists.freedesktop.org; dri-devel@lists.freedesktop.org; linux-
> > ker...@vger.kernel.org; l...@lists.linux.dev; Tom Rix 
> > 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 
> > ---
> >  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


RE: [PATCH] drm/amd/pm: remove unused num_of_active_display variable

2023-04-09 Thread Quan, Evan
[AMD Official Use Only - General]

Reviewed-by: Evan Quan 

> -Original Message-
> From: Tom Rix 
> Sent: Saturday, April 1, 2023 12:41 AM
> To: Quan, Evan ; Deucher, Alexander
> ; Koenig, Christian
> ; Pan, Xinhui ;
> airl...@gmail.com; dan...@ffwll.ch; nat...@kernel.org;
> ndesaulni...@google.com; Zhang, Hawking ;
> Feng, Kenneth ; Lazar, Lijo
> ; Wang, Yang(Kevin) ;
> Huang, Tim ; andrealm...@igalia.com; Liu, Kun
> ; Limonciello, Mario 
> Cc: amd-...@lists.freedesktop.org; dri-devel@lists.freedesktop.org; linux-
> ker...@vger.kernel.org; l...@lists.linux.dev; Tom Rix 
> 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 
> ---
>  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


Re: [PATCH] drm/amd/pm: remove unused num_of_active_display variable

2023-04-07 Thread Nick Desaulniers
On Fri, Mar 31, 2023 at 9:40 AM Tom Rix  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 

Thanks for the patch!
Fixes: commit 75145aab7a0d ("drm/amdgpu/swsmu: clean up a bunch of
stale interfaces")
Reviewed-by: Nick Desaulniers 

> ---
>  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


[PATCH] drm/amd/pm: remove unused num_of_active_display variable

2023-03-31 Thread 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 
---
 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