]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
V4L/DVB (9173): S2API: Remove the hardcoded command limit during validation
authorSteven Toth <stoth@linuxtv.org>
Mon, 6 Oct 2008 23:44:04 +0000 (20:44 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Mon, 13 Oct 2008 14:25:35 +0000 (12:25 -0200)
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>
drivers/media/dvb/dvb-core/dvb_frontend.c
include/linux/dvb/frontend.h

index ff8cda0ac333eb5966257fa50cbd3e23094bcf61..7fe9b3fb1e34d70c4dfb5fa8c972c3e1d4a5dc67 100644 (file)
@@ -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;
index eb98f8c37cad5b8da5f685340328e343d50dac0d..1cfcd1a86e8ad40d51c57b15b990aff99ed94f81 100644 (file)
@@ -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,