dri-devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/tda998x: BUG() on invalid audio format
@ 2013-09-01 13:23 David Herrmann
  0 siblings, 0 replies; only message in thread
From: David Herrmann @ 2013-09-01 13:23 UTC (permalink / raw)
  To: dri-devel

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

Cc: Rob Clark <robdclark@gmail.com>
Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
---
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(+)

diff --git a/drivers/gpu/drm/i2c/tda998x_drv.c b/drivers/gpu/drm/i2c/tda998x_drv.c
index c2bd711..b1f8fc6 100644
--- a/drivers/gpu/drm/i2c/tda998x_drv.c
+++ b/drivers/gpu/drm/i2c/tda998x_drv.c
@@ -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);
-- 
1.8.4

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2013-09-01 13:23 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-09-01 13:23 [PATCH] drm/tda998x: BUG() on invalid audio format David Herrmann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox