Skip to contentSkip to conversation

au8522: remove duplicate code

PATCH In review Gustavo A. R. Silva 2 participants 2 messages May 22, 2018 Media (V4L/DVB)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 au8522: remove duplicate code

This code has been there for nine years now, and it has been working "good enough" since then [1].

Remove duplicate code by getting rid of the if-else statement.

[1] https://marc.info/?l=linux-kernel&m=152693550225081&w=2

---
 drivers/media/dvb-frontends/au8522_decoder.c | 14 ++++++--------
 1 file changed, 6 insertions(+), 8 deletions(-)
drivers/media/dvb-frontends/au8522_decoder.c +6 -8
index 343dc92..f285096 100644
@@ -280,14 +280,12 @@ static void setup_decoder_defaults(struct au8522_state *state, bool is_svideo)
 			AU8522_TOREGAAGC_REG0E5H_CVBS);
 	au8522_writereg(state, AU8522_REG016H, AU8522_REG016H_CVBS);
 
-	if (is_svideo) {
-		/* Despite what the table says, for the HVR-950q we still need
-		   to be in CVBS mode for the S-Video input (reason unknown). */
-		/* filter_coef_type = 3; */
-		filter_coef_type = 5;
-	} else {
-		filter_coef_type = 5;
-	}
+	/*
+	 * Despite what the table says, for the HVR-950q we still need
+	 * to be in CVBS mode for the S-Video input (reason unknown).
+	 */
+	/* filter_coef_type = 3; */
+	filter_coef_type = 5;
 
 	/* Load the Video Decoder Filter Coefficients */
 	for (i = 0; i < NUM_FILTER_COEF; i++) {
Signature · 1 line
2.7.4
Reviewed-by on v1 1/1
#1 lore raw

Devin

Quoted 41 lines · Gustavo A. R. Silva

This code has been there for nine years now, and it has been working "good enough" since then [1].

Remove duplicate code by getting rid of the if-else statement.

[1] https://marc.info/?l=linux-kernel&m=152693550225081&w=2

---
 drivers/media/dvb-frontends/au8522_decoder.c | 14 ++++++--------
 1 file changed, 6 insertions(+), 8 deletions(-)
drivers/media/dvb-frontends/au8522_decoder.c +6 -9
index 343dc92..f285096 100644
@@ -280,14 +280,12 @@ static void setup_decoder_defaults(struct au8522_state *state, bool is_svideo)
                        AU8522_TOREGAAGC_REG0E5H_CVBS);
        au8522_writereg(state, AU8522_REG016H, AU8522_REG016H_CVBS);
 
-       if (is_svideo) {
-               /* Despite what the table says, for the HVR-950q we still need
-                  to be in CVBS mode for the S-Video input (reason unknown). */
-               /* filter_coef_type = 3; */
-               filter_coef_type = 5;
-       } else {
-               filter_coef_type = 5;
-       }
+       /*
+        * Despite what the table says, for the HVR-950q we still need
+        * to be in CVBS mode for the S-Video input (reason unknown).
+        */
+       /* filter_coef_type = 3; */
+       filter_coef_type = 5;
 
        /* Load the Video Decoder Filter Coefficients */
        for (i = 0; i < NUM_FILTER_COEF; i++) {
--

2.7.4

Signature · 2 lines
Devin J. Heitmueller - Kernel Labs
http://www.kernellabs.com