All of lore.kernel.org
 help / color / mirror / Atom feed
From: Steve Kerrison <steve@stevekerrison.com>
To: Andreas Oberritter <obi@linuxtv.org>
Cc: Antti Palosaari <crope@iki.fi>,
	Mauro Carvalho Chehab <mchehab@redhat.com>,
	linux-media@vger.kernel.org
Subject: Re: [PATCH v2 2/5] drxd: Fix warning caused by new entries in an enum
Date: Mon, 09 May 2011 10:15:48 +0100	[thread overview]
Message-ID: <1304932548.2920.33.camel@ares> (raw)
In-Reply-To: <4DC714EC.2060606@linuxtv.org>

Hi Andreas,

> I'd prefer returning -EINVAL for unsupported parameters.
>
> [snip]
> 
> I already had a patch for this, but forgot to submit it together with
> the frontend.h bits.

That seems reasonable. Do I need to do anything with this? I'm happy for
Mauro to scrub my drxd and mxl patches and use yours instead.

> Btw., "status = status;" looks odd.

Heh, yes it does. I wonder if that was put in to deal with an "unused
variable" compiler warning before the switch statement had a default
case? Otherwise, perhaps it's from the department of redundancy
department.

Regards,
-- 
Steve Kerrison MEng Hons.
http://www.stevekerrison.com/ 

On Mon, 2011-05-09 at 00:10 +0200, Andreas Oberritter wrote:
> On 05/08/2011 09:17 PM, Steve Kerrison wrote:
> > Additional bandwidth modes have been added in frontend.h
> > drxd_hard.c had no default case so the compiler was warning about
> > a non-exhausive switch statement.
> > 
> > This has been fixed by making the default behaviour the same as
> > BANDWIDTH_AUTO, with the addition of a printk to notify if this
> > ever happens.
> > 
> > Signed-off-by: Steve Kerrison <steve@stevekerrison.com>
> > ---
> >  drivers/media/dvb/frontends/drxd_hard.c |    4 ++++
> >  1 files changed, 4 insertions(+), 0 deletions(-)
> > 
> > diff --git a/drivers/media/dvb/frontends/drxd_hard.c b/drivers/media/dvb/frontends/drxd_hard.c
> > index 30a78af..b3b0704 100644
> > --- a/drivers/media/dvb/frontends/drxd_hard.c
> > +++ b/drivers/media/dvb/frontends/drxd_hard.c
> > @@ -2325,6 +2325,10 @@ static int DRX_Start(struct drxd_state *state, s32 off)
> >  		   InitEC and ResetEC
> >  		   functions */
> >  		switch (p->bandwidth) {
> > +		default:
> > +			printk(KERN_INFO "drxd: Unsupported bandwidth mode %u, reverting to default\n",
> > +				p->bandwidth);
> > +			/* Fall back to auto */
> 
> I'd prefer returning -EINVAL for unsupported parameters.
> 
> >  		case BANDWIDTH_AUTO:
> >  		case BANDWIDTH_8_MHZ:
> >  			/* (64/7)*(8/8)*1000000 */
> 
> I already had a patch for this, but forgot to submit it together with the frontend.h bits.
> 
> From 73d630b57f584d7e35cac5e27149cbc564aedde2 Mon Sep 17 00:00:00 2001
> From: Andreas Oberritter <obi@linuxtv.org>
> Date: Fri, 8 Apr 2011 16:39:20 +0000
> Subject: [PATCH 2/2] DVB: drxd_hard: handle new bandwidths by returning -EINVAL
> 
> Signed-off-by: Andreas Oberritter <obi@linuxtv.org>
> ---
>  drivers/media/dvb/frontends/drxd_hard.c |    3 +++
>  1 files changed, 3 insertions(+), 0 deletions(-)
> 
> diff --git a/drivers/media/dvb/frontends/drxd_hard.c b/drivers/media/dvb/frontends/drxd_hard.c
> index 30a78af..53319f4 100644
> --- a/drivers/media/dvb/frontends/drxd_hard.c
> +++ b/drivers/media/dvb/frontends/drxd_hard.c
> @@ -2348,6 +2348,9 @@ static int DRX_Start(struct drxd_state *state, s32 off)
>  			status = Write16(state,
>  					 FE_AG_REG_IND_DEL__A, 71, 0x0000);
>  			break;
> +		default:
> +			status = -EINVAL;
> +			break;
>  		}
>  		status = status;
>  		if (status < 0)


  reply	other threads:[~2011-05-09  9:15 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20110506125542.ADA1D162E7@stevekerrison.com>
2011-05-06 13:46 ` [git:v4l-dvb/for_v2.6.40] [media] Sony CXD2820R DVB-T/T2/C demodulator driver Antti Palosaari
2011-05-06 15:30 ` Mauro Carvalho Chehab
2011-05-06 15:46   ` Mauro Carvalho Chehab
2011-05-08 15:51     ` [PATCH 0/6] DVB-T2 API updates, documentation and accompanying small fixes Steve Kerrison
2011-05-08 16:04       ` Mauro Carvalho Chehab
2011-05-08 19:17         ` [PATCH v2 0/5] " Steve Kerrison
2011-05-08 19:17         ` [PATCH v2 1/5] DVB: Add basic API support for DVB-T2 and bump minor version Steve Kerrison
2011-05-08 22:22           ` Andreas Oberritter
2011-05-08 22:38             ` Andreas Oberritter
2011-05-12 21:11               ` [PATCH v3] " Steve Kerrison
2011-05-08 19:17         ` [PATCH v2 2/5] drxd: Fix warning caused by new entries in an enum Steve Kerrison
2011-05-08 22:10           ` Andreas Oberritter
2011-05-09  9:15             ` Steve Kerrison [this message]
2011-05-09  9:25               ` Mauro Carvalho Chehab
2011-05-08 19:17         ` [PATCH v2 3/5] mxl5005: " Steve Kerrison
2011-05-08 22:11           ` Andreas Oberritter
2011-05-08 19:17         ` [PATCH v2 4/5] cxd2820r: Update frontend capabilities to advertise QAM-256 Steve Kerrison
2011-05-09 21:45           ` Antti Palosaari
2011-05-08 19:17         ` [PATCH v2 5/5] Documentation: Update to include DVB-T2 additions Steve Kerrison
2011-05-12 21:18           ` Steve Kerrison
     [not found]         ` <1304875061.2920.13.camel@ares>
2011-05-08 22:26           ` [PATCH 0/6] DVB-T2 API updates, documentation and accompanying small fixes Andreas Oberritter
2011-05-09  3:10             ` Mauro Carvalho Chehab
2011-05-12 22:06       ` Antti Palosaari
2011-05-08 15:51     ` [PATCH 1/6] DVB: Add basic API support for DVB-T2 and bump minor version Steve Kerrison
2011-05-08 15:51     ` [PATCH 2/6] cxd2820r: Remove temporary T2 API hack Steve Kerrison
2011-05-08 16:06       ` Mauro Carvalho Chehab
2011-05-08 15:51     ` [PATCH 3/6] drxd: Fix warning caused by new entries in an enum Steve Kerrison
2011-05-08 15:51     ` [PATCH 4/6] mxl5005: " Steve Kerrison
2011-05-08 15:51     ` [PATCH 5/6] cxd2820r: Update frontend capabilities to advertise QAM-256 Steve Kerrison
2011-05-08 15:51     ` [PATCH 6/6] Documentation: Update to include DVB-T2 additions Steve Kerrison
2011-05-08 16:20       ` Mauro Carvalho Chehab
2011-05-08 19:13         ` Steve Kerrison
2011-05-08 22:05           ` Andreas Oberritter

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1304932548.2920.33.camel@ares \
    --to=steve@stevekerrison.com \
    --cc=crope@iki.fi \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@redhat.com \
    --cc=obi@linuxtv.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.