diff mbox

[v2,3/5] mxl5005: Fix warning caused by new entries in an enum

Message ID 4DC7151E.1060606@linuxtv.org (mailing list archive)
State Accepted
Headers show

Commit Message

Andreas Oberritter May 8, 2011, 10:11 p.m. UTC
On 05/08/2011 09:17 PM, Steve Kerrison wrote:
> Additional bandwidth modes have been added in frontend.h
> mxl5005s.c had no default case so the compiler was warning about
> a non-exhausive switch statement.
> 
> Signed-off-by: Steve Kerrison <steve@stevekerrison.com>
> ---
>  drivers/media/common/tuners/mxl5005s.c |    4 ++++
>  1 files changed, 4 insertions(+), 0 deletions(-)
> 
> diff --git a/drivers/media/common/tuners/mxl5005s.c b/drivers/media/common/tuners/mxl5005s.c
> index 0d6e094..d80e6f3 100644
> --- a/drivers/media/common/tuners/mxl5005s.c
> +++ b/drivers/media/common/tuners/mxl5005s.c
> @@ -4020,6 +4020,10 @@ static int mxl5005s_set_params(struct dvb_frontend *fe,
>  			case BANDWIDTH_7_MHZ:
>  				req_bw  = MXL5005S_BANDWIDTH_7MHZ;
>  				break;
> +			default:
> +				dprintk(1,"%s: Unsupported bandwidth mode %u, reverting to default\n",
> +					__func__,params->u.ofdm.bandwidth);
> +				/* Fall back to auto */
>  			case BANDWIDTH_AUTO:
>  			case BANDWIDTH_8_MHZ:
>  				req_bw  = MXL5005S_BANDWIDTH_8MHZ;

Same as in 2/5.

From 9492d6c7665bf8b55ec3a42577794cea3e87ee15 Mon Sep 17 00:00:00 2001
From: Andreas Oberritter <obi@linuxtv.org>
Date: Fri, 8 Apr 2011 16:37:57 +0000
Subject: [PATCH 1/2] DVB: mxl5005s: handle new bandwidths by returning -EINVAL

Signed-off-by: Andreas Oberritter <obi@linuxtv.org>
---
 drivers/media/common/tuners/mxl5005s.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
diff mbox

Patch

diff --git a/drivers/media/common/tuners/mxl5005s.c b/drivers/media/common/tuners/mxl5005s.c
index 605e28b..5618b35 100644
--- a/drivers/media/common/tuners/mxl5005s.c
+++ b/drivers/media/common/tuners/mxl5005s.c
@@ -4024,6 +4024,8 @@  static int mxl5005s_set_params(struct dvb_frontend *fe,
 			case BANDWIDTH_8_MHZ:
 				req_bw  = MXL5005S_BANDWIDTH_8MHZ;
 				break;
+			default:
+				return -EINVAL;
 			}
 		}