Skip to contentSkip to conversation

drm/amd/display: remove gcc warning Wunused-but-set-variable

PATCH Applied Chen Wandun 2 participants 2 messages Oct 19, 2019 – Oct 25, 2019

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/amd/display: remove gcc warning Wunused-but-set-variable

From: Chenwandun <[email protected]>

drivers/gpu/drm/amd/display/dc/dce/dce_aux.c: In function dce_aux_configure_timeout:
drivers/gpu/drm/amd/display/dc/dce/dce_aux.c: warning: variable timeout set but not used [-Wunused-but-set-variable]

---
 drivers/gpu/drm/amd/display/dc/dce/dce_aux.c | 5 -----
 1 file changed, 5 deletions(-)
drivers/gpu/drm/amd/display/dc/dce/dce_aux.c +0 -5
index 976bd49..739f8e2 100644
@@ -432,7 +432,6 @@ static bool dce_aux_configure_timeout(struct ddc_service *ddc,
 {
 	uint32_t multiplier = 0;
 	uint32_t length = 0;
-	uint32_t timeout = 0;
 	struct ddc *ddc_pin = ddc->ddc_pin;
 	struct dce_aux *aux_engine = ddc->ctx->dc->res_pool->engines[ddc_pin->pin_data->en];
 	struct aux_engine_dce110 *aux110 = FROM_AUX_ENGINE(aux_engine);
@@ -446,25 +445,21 @@ static bool dce_aux_configure_timeout(struct ddc_service *ddc,
 		length = timeout_in_us/TIME_OUT_MULTIPLIER_8;
 		if (timeout_in_us % TIME_OUT_MULTIPLIER_8 != 0)
 			length++;
-		timeout = length * TIME_OUT_MULTIPLIER_8;
 	} else if (timeout_in_us <= 2 * TIME_OUT_INCREMENT) {
 		multiplier = 1;
 		length = timeout_in_us/TIME_OUT_MULTIPLIER_16;
 		if (timeout_in_us % TIME_OUT_MULTIPLIER_16 != 0)
 			length++;
-		timeout = length * TIME_OUT_MULTIPLIER_16;
 	} else if (timeout_in_us <= 4 * TIME_OUT_INCREMENT) {
 		multiplier = 2;
 		length = timeout_in_us/TIME_OUT_MULTIPLIER_32;
 		if (timeout_in_us % TIME_OUT_MULTIPLIER_32 != 0)
 			length++;
-		timeout = length * TIME_OUT_MULTIPLIER_32;
 	} else if (timeout_in_us > 4 * TIME_OUT_INCREMENT) {
 		multiplier = 3;
 		length = timeout_in_us/TIME_OUT_MULTIPLIER_64;
 		if (timeout_in_us % TIME_OUT_MULTIPLIER_64 != 0)
 			length++;
-		timeout = length * TIME_OUT_MULTIPLIER_64;
 	}
 
 	length = (length < MAX_TIMEOUT_LENGTH) ? length : MAX_TIMEOUT_LENGTH;
Signature · 1 line
2.7.4
Applied
#1 lore raw
Quoted 7 lines · Chen Wandun

From: Chenwandun <[email protected]>

drivers/gpu/drm/amd/display/dc/dce/dce_aux.c: In function dce_aux_configure_timeout:
drivers/gpu/drm/amd/display/dc/dce/dce_aux.c: warning: variable timeout set but not used [-Wunused-but-set-variable]

Applied. Thanks!

Alex

Quoted 45 lines
---
 drivers/gpu/drm/amd/display/dc/dce/dce_aux.c | 5 -----
 1 file changed, 5 deletions(-)
drivers/gpu/drm/amd/display/dc/dce/dce_aux.c +0 -6
index 976bd49..739f8e2 100644
@@ -432,7 +432,6 @@ static bool dce_aux_configure_timeout(struct ddc_service *ddc,
 {
        uint32_t multiplier = 0;
        uint32_t length = 0;
-       uint32_t timeout = 0;
        struct ddc *ddc_pin = ddc->ddc_pin;
        struct dce_aux *aux_engine = ddc->ctx->dc->res_pool->engines[ddc_pin->pin_data->en];
        struct aux_engine_dce110 *aux110 = FROM_AUX_ENGINE(aux_engine);
@@ -446,25 +445,21 @@ static bool dce_aux_configure_timeout(struct ddc_service *ddc,
                length = timeout_in_us/TIME_OUT_MULTIPLIER_8;
                if (timeout_in_us % TIME_OUT_MULTIPLIER_8 != 0)
                        length++;
-               timeout = length * TIME_OUT_MULTIPLIER_8;
        } else if (timeout_in_us <= 2 * TIME_OUT_INCREMENT) {
                multiplier = 1;
                length = timeout_in_us/TIME_OUT_MULTIPLIER_16;
                if (timeout_in_us % TIME_OUT_MULTIPLIER_16 != 0)
                        length++;
-               timeout = length * TIME_OUT_MULTIPLIER_16;
        } else if (timeout_in_us <= 4 * TIME_OUT_INCREMENT) {
                multiplier = 2;
                length = timeout_in_us/TIME_OUT_MULTIPLIER_32;
                if (timeout_in_us % TIME_OUT_MULTIPLIER_32 != 0)
                        length++;
-               timeout = length * TIME_OUT_MULTIPLIER_32;
        } else if (timeout_in_us > 4 * TIME_OUT_INCREMENT) {
                multiplier = 3;
                length = timeout_in_us/TIME_OUT_MULTIPLIER_64;
                if (timeout_in_us % TIME_OUT_MULTIPLIER_64 != 0)
                        length++;
-               timeout = length * TIME_OUT_MULTIPLIER_64;
        }
 
        length = (length < MAX_TIMEOUT_LENGTH) ? length : MAX_TIMEOUT_LENGTH;
--

2.7.4

Quoted 4 lines

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel