Skip to content

Commit

Permalink
V4L/DVB (9173): S2API: Remove the hardcoded command limit during vali…
Browse files Browse the repository at this point in the history
…dation

This means that when developers add new commands then they'll be see
the DTV_MAX_COMMAND define and will be more likely to modify it, without
having to modify the command validation code.

Signed-off-by: Steven Toth <stoth@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
  • Loading branch information
Steven Toth authored and Mauro Carvalho Chehab committed Oct 13, 2008
1 parent e5cefa8 commit 82d7669
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 1 addition & 2 deletions drivers/media/dvb/dvb-core/dvb_frontend.c
Original file line number Diff line number Diff line change
Expand Up @@ -848,8 +848,7 @@ void dtv_property_dump(struct dtv_property *tvp)
{
int i;

if( (tvp->cmd <= 0 || tvp->cmd > DTV_DELIVERY_SYSTEM) &&
tvp->cmd != DTV_API_VERSION) {
if (tvp->cmd <= 0 || tvp->cmd > DTV_MAX_COMMAND) {
printk("%s: tvp.cmd = 0x%08x (undefined/unknown/invalid)\n",
__func__, tvp->cmd);
return;
Expand Down
2 changes: 2 additions & 0 deletions include/linux/dvb/frontend.h
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,8 @@ struct dvb_frontend_event {

#define DTV_API_VERSION 35

#define DTV_MAX_COMMAND DTV_API_VERSION

typedef enum fe_pilot {
PILOT_ON,
PILOT_OFF,
Expand Down

0 comments on commit 82d7669

Please sign in to comment.