Skip to contentSkip to conversation

media: dvb-frontends/stv0367: remove redundant variable ADCClk_Hz

PATCH In review Colin King 2 participants 2 messages Oct 14, 2021 – Oct 15, 2021

Subsystems (2)
lore
Share & tools
lore

Colin King

author
#0 lore raw

PATCH 1/1 media: dvb-frontends/stv0367: remove redundant variable ADCClk_Hz

From: Colin Ian King <[email protected]>

Variable ADCClk_Hz is being initialised with a variable that is never read and then re-assigned immediately afterwards. Clean up the code by removing it and just returning the return value from the call to stv0367cab_get_mclk

Addresses-Coverity: ("Unused value")

---
 drivers/media/dvb-frontends/stv0367.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)
drivers/media/dvb-frontends/stv0367.c +1 -5
index 6c2b05fae1c5..95e376f23506 100644
@@ -1797,11 +1797,7 @@ static u32 stv0367cab_get_mclk(struct dvb_frontend *fe, u32 ExtClk_Hz)
 
 static u32 stv0367cab_get_adc_freq(struct dvb_frontend *fe, u32 ExtClk_Hz)
 {
-	u32 ADCClk_Hz = ExtClk_Hz;
-
-	ADCClk_Hz = stv0367cab_get_mclk(fe, ExtClk_Hz);
-
-	return ADCClk_Hz;
+	return stv0367cab_get_mclk(fe, ExtClk_Hz);
 }
 
 static enum stv0367cab_mod stv0367cab_SetQamSize(struct stv0367_state *state,
Signature · 1 line
2.32.0
Reviewed-by on v1 1/1
#1 lore raw

Quoting Colin King (2021-10-14 16:32:53)

Quoted 6 lines

From: Colin Ian King <[email protected]>

Variable ADCClk_Hz is being initialised with a variable that is never read and then re-assigned immediately afterwards. Clean up the code by removing it and just returning the return value from the call to stv0367cab_get_mclk

Indeed LGTM.

Quoted 26 lines

Addresses-Coverity: ("Unused value")

---
 drivers/media/dvb-frontends/stv0367.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)
drivers/media/dvb-frontends/stv0367.c +1 -5
index 6c2b05fae1c5..95e376f23506 100644
@@ -1797,11 +1797,7 @@ static u32 stv0367cab_get_mclk(struct dvb_frontend *fe, u32 ExtClk_Hz)
 
 static u32 stv0367cab_get_adc_freq(struct dvb_frontend *fe, u32 ExtClk_Hz)
 {
-       u32 ADCClk_Hz = ExtClk_Hz;
-
-       ADCClk_Hz = stv0367cab_get_mclk(fe, ExtClk_Hz);
-
-       return ADCClk_Hz;
+       return stv0367cab_get_mclk(fe, ExtClk_Hz);
 }
 
 static enum stv0367cab_mod stv0367cab_SetQamSize(struct stv0367_state *state,
Signature · 1 line
2.32.0