[PATCH 1/3] drm/amd/display: Remove set but not used variables 'bl_pwm_cntl', 'pwm_period_cntl'

zhengbin zhengbin13 at huawei.com
Wed Oct 9 06:25:10 UTC 2019


Fixes gcc '-Wunused-but-set-variable' warning:

drivers/gpu/drm/amd/display/dc/dce/dce_abm.c: In function calculate_16_bit_backlight_from_pwm:
drivers/gpu/drm/amd/display/dc/dce/dce_abm.c:83:11: warning: variable bl_pwm_cntl set but not used [-Wunused-but-set-variable]
drivers/gpu/drm/amd/display/dc/dce/dce_abm.c: In function calculate_16_bit_backlight_from_pwm:
drivers/gpu/drm/amd/display/dc/dce/dce_abm.c:82:11: warning: variable pwm_period_cntl set but not used [-Wunused-but-set-variable]

They are not used since commit 5e7773a219f7 ("drm/amd/display:
DMCU Compile and Load")

Reported-by: Hulk Robot <hulkci at huawei.com>
Signed-off-by: zhengbin <zhengbin13 at huawei.com>
---
 drivers/gpu/drm/amd/display/dc/dce/dce_abm.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/amd/display/dc/dce/dce_abm.c b/drivers/gpu/drm/amd/display/dc/dce/dce_abm.c
index 9edd369..b306fb1 100644
--- a/drivers/gpu/drm/amd/display/dc/dce/dce_abm.c
+++ b/drivers/gpu/drm/amd/display/dc/dce/dce_abm.c
@@ -84,15 +84,15 @@ static unsigned int calculate_16_bit_backlight_from_pwm(struct dce_abm *abm_dce)
 {
 	uint64_t current_backlight;
 	uint32_t round_result;
-	uint32_t pwm_period_cntl, bl_period, bl_int_count;
-	uint32_t bl_pwm_cntl, bl_pwm, fractional_duty_cycle_en;
+	uint32_t bl_period, bl_int_count;
+	uint32_t bl_pwm, fractional_duty_cycle_en;
 	uint32_t bl_period_mask, bl_pwm_mask;

-	pwm_period_cntl = REG_READ(BL_PWM_PERIOD_CNTL);
+	REG_READ(BL_PWM_PERIOD_CNTL);
 	REG_GET(BL_PWM_PERIOD_CNTL, BL_PWM_PERIOD, &bl_period);
 	REG_GET(BL_PWM_PERIOD_CNTL, BL_PWM_PERIOD_BITCNT, &bl_int_count);

-	bl_pwm_cntl = REG_READ(BL_PWM_CNTL);
+	REG_READ(BL_PWM_CNTL);
 	REG_GET(BL_PWM_CNTL, BL_ACTIVE_INT_FRAC_CNT, (uint32_t *)(&bl_pwm));
 	REG_GET(BL_PWM_CNTL, BL_PWM_FRACTIONAL_EN, &fractional_duty_cycle_en);

--
2.7.4



More information about the dri-devel mailing list