From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Herrmann Subject: [PATCH] drm/tda998x: BUG() on invalid audio format Date: Sun, 1 Sep 2013 15:23:04 +0200 Message-ID: <1378041784-4207-1-git-send-email-dh.herrmann@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail-ea0-f182.google.com (mail-ea0-f182.google.com [209.85.215.182]) by gabe.freedesktop.org (Postfix) with ESMTP id 9A655E60B0 for ; Sun, 1 Sep 2013 06:23:19 -0700 (PDT) Received: by mail-ea0-f182.google.com with SMTP id o10so1802990eaj.41 for ; Sun, 01 Sep 2013 06:23:18 -0700 (PDT) List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: dri-devel-bounces+sf-dri-devel=m.gmane.org@lists.freedesktop.org Errors-To: dri-devel-bounces+sf-dri-devel=m.gmane.org@lists.freedesktop.org To: dri-devel@lists.freedesktop.org List-Id: dri-devel@lists.freedesktop.org Suppress warning of unused-variables by adding a BUG()+return for invalid audio-formats. Cc: Rob Clark Signed-off-by: David Herrmann --- 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