提交 82d7669d 编写于 作者: S Steven Toth 提交者: Mauro Carvalho Chehab

V4L/DVB (9173): S2API: Remove the hardcoded command limit during validation

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: NSteven Toth <stoth@linuxtv.org>
Signed-off-by: NMauro Carvalho Chehab <mchehab@redhat.com>
上级 e5cefa82
...@@ -848,8 +848,7 @@ void dtv_property_dump(struct dtv_property *tvp) ...@@ -848,8 +848,7 @@ void dtv_property_dump(struct dtv_property *tvp)
{ {
int i; int i;
if( (tvp->cmd <= 0 || tvp->cmd > DTV_DELIVERY_SYSTEM) && if (tvp->cmd <= 0 || tvp->cmd > DTV_MAX_COMMAND) {
tvp->cmd != DTV_API_VERSION) {
printk("%s: tvp.cmd = 0x%08x (undefined/unknown/invalid)\n", printk("%s: tvp.cmd = 0x%08x (undefined/unknown/invalid)\n",
__func__, tvp->cmd); __func__, tvp->cmd);
return; return;
......
...@@ -270,6 +270,8 @@ struct dvb_frontend_event { ...@@ -270,6 +270,8 @@ struct dvb_frontend_event {
#define DTV_API_VERSION 35 #define DTV_API_VERSION 35
#define DTV_MAX_COMMAND DTV_API_VERSION
typedef enum fe_pilot { typedef enum fe_pilot {
PILOT_ON, PILOT_ON,
PILOT_OFF, PILOT_OFF,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册