Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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: Steven Toth <stoth@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>

authored by

Steven Toth and committed by
Mauro Carvalho Chehab
82d7669d e5cefa82

+3 -2
+1 -2
drivers/media/dvb/dvb-core/dvb_frontend.c
··· 848 848 { 849 849 int i; 850 850 851 - if( (tvp->cmd <= 0 || tvp->cmd > DTV_DELIVERY_SYSTEM) && 852 - tvp->cmd != DTV_API_VERSION) { 851 + if (tvp->cmd <= 0 || tvp->cmd > DTV_MAX_COMMAND) { 853 852 printk("%s: tvp.cmd = 0x%08x (undefined/unknown/invalid)\n", 854 853 __func__, tvp->cmd); 855 854 return;
+2
include/linux/dvb/frontend.h
··· 270 270 271 271 #define DTV_API_VERSION 35 272 272 273 + #define DTV_MAX_COMMAND DTV_API_VERSION 274 + 273 275 typedef enum fe_pilot { 274 276 PILOT_ON, 275 277 PILOT_OFF,