Message ID | 4DC714EC.2060606@linuxtv.org (mailing list archive) |
---|---|
State | Superseded |
Headers | show |
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,
Em 09-05-2011 11:15, Steve Kerrison escreveu: > 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. Yes, there is. Linux defines a macro for it: uninitialized_var() (it basically will do status = status internally with newer gcc versions, but it helps to document what's happening there) it is sometimes better to initialize the var, as the warning may help to detect troubles after some changes. Cheers, Mauro. -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
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)