diff mbox series

[08/30] drm/radeon/ci_dpm: Remove set but unused variable 'dpm_event_src'

Message ID 20201110193112.988999-9-lee.jones@linaro.org
State Accepted
Commit bf81a58144d241ff26a891218a5214d2e3586200
Headers show
Series Rid W=1 warnings from GPU | expand

Commit Message

Lee Jones Nov. 10, 2020, 7:30 p.m. UTC
And the piece of code that has never been executed.

Fixes the following W=1 kernel build warning(s):

 drivers/gpu/drm/radeon/ci_dpm.c: In function ‘ci_set_dpm_event_sources’:
 drivers/gpu/drm/radeon/ci_dpm.c:1369:28: warning: variable ‘dpm_event_src’ set but not used [-Wunused-but-set-variable]

Cc: Alex Deucher <alexander.deucher@amd.com>
Cc: "Christian König" <christian.koenig@amd.com>
Cc: David Airlie <airlied@linux.ie>
Cc: Daniel Vetter <daniel@ffwll.ch>
Cc: amd-gfx@lists.freedesktop.org
Cc: dri-devel@lists.freedesktop.org
Signed-off-by: Lee Jones <lee.jones@linaro.org>
---
 drivers/gpu/drm/radeon/ci_dpm.c | 12 ------------
 1 file changed, 12 deletions(-)

Comments

Alex Deucher Nov. 10, 2020, 11:42 p.m. UTC | #1
On Tue, Nov 10, 2020 at 2:31 PM Lee Jones <lee.jones@linaro.org> wrote:
>
> And the piece of code that has never been executed.
>
> Fixes the following W=1 kernel build warning(s):
>
>  drivers/gpu/drm/radeon/ci_dpm.c: In function ‘ci_set_dpm_event_sources’:
>  drivers/gpu/drm/radeon/ci_dpm.c:1369:28: warning: variable ‘dpm_event_src’ set but not used [-Wunused-but-set-variable]
>
> Cc: Alex Deucher <alexander.deucher@amd.com>
> Cc: "Christian König" <christian.koenig@amd.com>
> Cc: David Airlie <airlied@linux.ie>
> Cc: Daniel Vetter <daniel@ffwll.ch>
> Cc: amd-gfx@lists.freedesktop.org
> Cc: dri-devel@lists.freedesktop.org
> Signed-off-by: Lee Jones <lee.jones@linaro.org>

Applied.  Thanks!

Alex

> ---
>  drivers/gpu/drm/radeon/ci_dpm.c | 12 ------------
>  1 file changed, 12 deletions(-)
>
> diff --git a/drivers/gpu/drm/radeon/ci_dpm.c b/drivers/gpu/drm/radeon/ci_dpm.c
> index 886e9959496fe..8324aca5fd006 100644
> --- a/drivers/gpu/drm/radeon/ci_dpm.c
> +++ b/drivers/gpu/drm/radeon/ci_dpm.c
> @@ -1366,7 +1366,6 @@ static void ci_set_dpm_event_sources(struct radeon_device *rdev, u32 sources)
>  {
>         struct ci_power_info *pi = ci_get_pi(rdev);
>         bool want_thermal_protection;
> -       enum radeon_dpm_event_src dpm_event_src;
>         u32 tmp;
>
>         switch (sources) {
> @@ -1376,28 +1375,17 @@ static void ci_set_dpm_event_sources(struct radeon_device *rdev, u32 sources)
>                 break;
>         case (1 << RADEON_DPM_AUTO_THROTTLE_SRC_THERMAL):
>                 want_thermal_protection = true;
> -               dpm_event_src = RADEON_DPM_EVENT_SRC_DIGITAL;
>                 break;
>         case (1 << RADEON_DPM_AUTO_THROTTLE_SRC_EXTERNAL):
>                 want_thermal_protection = true;
> -               dpm_event_src = RADEON_DPM_EVENT_SRC_EXTERNAL;
>                 break;
>         case ((1 << RADEON_DPM_AUTO_THROTTLE_SRC_EXTERNAL) |
>               (1 << RADEON_DPM_AUTO_THROTTLE_SRC_THERMAL)):
>                 want_thermal_protection = true;
> -               dpm_event_src = RADEON_DPM_EVENT_SRC_DIGIAL_OR_EXTERNAL;
>                 break;
>         }
>
>         if (want_thermal_protection) {
> -#if 0
> -               /* XXX: need to figure out how to handle this properly */
> -               tmp = RREG32_SMC(CG_THERMAL_CTRL);
> -               tmp &= DPM_EVENT_SRC_MASK;
> -               tmp |= DPM_EVENT_SRC(dpm_event_src);
> -               WREG32_SMC(CG_THERMAL_CTRL, tmp);
> -#endif
> -
>                 tmp = RREG32_SMC(GENERAL_PWRMGT);
>                 if (pi->thermal_protection)
>                         tmp &= ~THERMAL_PROTECTION_DIS;
> --
> 2.25.1
>
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
diff mbox series

Patch

diff --git a/drivers/gpu/drm/radeon/ci_dpm.c b/drivers/gpu/drm/radeon/ci_dpm.c
index 886e9959496fe..8324aca5fd006 100644
--- a/drivers/gpu/drm/radeon/ci_dpm.c
+++ b/drivers/gpu/drm/radeon/ci_dpm.c
@@ -1366,7 +1366,6 @@  static void ci_set_dpm_event_sources(struct radeon_device *rdev, u32 sources)
 {
 	struct ci_power_info *pi = ci_get_pi(rdev);
 	bool want_thermal_protection;
-	enum radeon_dpm_event_src dpm_event_src;
 	u32 tmp;
 
 	switch (sources) {
@@ -1376,28 +1375,17 @@  static void ci_set_dpm_event_sources(struct radeon_device *rdev, u32 sources)
 		break;
 	case (1 << RADEON_DPM_AUTO_THROTTLE_SRC_THERMAL):
 		want_thermal_protection = true;
-		dpm_event_src = RADEON_DPM_EVENT_SRC_DIGITAL;
 		break;
 	case (1 << RADEON_DPM_AUTO_THROTTLE_SRC_EXTERNAL):
 		want_thermal_protection = true;
-		dpm_event_src = RADEON_DPM_EVENT_SRC_EXTERNAL;
 		break;
 	case ((1 << RADEON_DPM_AUTO_THROTTLE_SRC_EXTERNAL) |
 	      (1 << RADEON_DPM_AUTO_THROTTLE_SRC_THERMAL)):
 		want_thermal_protection = true;
-		dpm_event_src = RADEON_DPM_EVENT_SRC_DIGIAL_OR_EXTERNAL;
 		break;
 	}
 
 	if (want_thermal_protection) {
-#if 0
-		/* XXX: need to figure out how to handle this properly */
-		tmp = RREG32_SMC(CG_THERMAL_CTRL);
-		tmp &= DPM_EVENT_SRC_MASK;
-		tmp |= DPM_EVENT_SRC(dpm_event_src);
-		WREG32_SMC(CG_THERMAL_CTRL, tmp);
-#endif
-
 		tmp = RREG32_SMC(GENERAL_PWRMGT);
 		if (pi->thermal_protection)
 			tmp &= ~THERMAL_PROTECTION_DIS;