Skip to contentSkip to conversation

drm/tda998x: BUG() on invalid audio format

PATCH New David Herrmann 1 participant 1 message Sep 1, 2013

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

PATCH 1/1 drm/tda998x: BUG() on invalid audio format

Suppress warning of unused-variables by adding a BUG()+return for invalid audio-formats.

---
Hey Rob

No idea whether it's correct. But all I know is when we hit the default: path, several variables will be unset. To avoid gcc warn about it, I added the BUG(). If we should just silently return, feel free to adjust the patch to your needs.

Cheers
David

 drivers/gpu/drm/i2c/tda998x_drv.c | 4 ++++
 1 file changed, 4 insertions(+)
drivers/gpu/drm/i2c/tda998x_drv.c +4 -0
index c2bd711..b1f8fc6 100644
@@ -596,6 +596,10 @@ tda998x_configure_audio(struct drm_encoder *encoder,
 		cts_n = CTS_N_M(3) | CTS_N_K(3);
 		ca_i2s = CA_I2S_CA_I2S(0);
 		break;
+
+	default:
+		BUG();
+		return;
 	}
 
 	reg_write(encoder, REG_AIP_CLKSEL, clksel_aip);
Signature · 1 line
1.8.4