From 4ef2ccc2611456667ea78c6f418ce87e1fa9fac5 Mon Sep 17 00:00:00 2001 From: Trent Piepho Date: Wed, 28 Jan 2009 21:32:58 -0300 Subject: V4L/DVB (10558): bttv: norm value should be unsigned The norm value in the driver is an index into an array and the the driver doesn't allow it to be negative or otherwise invalid. It should be unsigned but wasn't in all places. Fix some structs and functions to have the norm be unsigned. Get rid of useless checks for "< 0". Most of the driver code can't handle a norm value that's out of range, so change some ">= BTTV_TVNORMS" checks to BUG_ON(). There's no point in silently ignoring invalid driver state just to crash because of it later. Reported-by: Roel Kluin Signed-off-by: Trent Piepho Signed-off-by: Mauro Carvalho Chehab --- drivers/media/video/bt8xx/bttv-cards.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/media/video/bt8xx/bttv-cards.c') diff --git a/drivers/media/video/bt8xx/bttv-cards.c b/drivers/media/video/bt8xx/bttv-cards.c index 9dfd8c70e4fb..2df0ce2afe98 100644 --- a/drivers/media/video/bt8xx/bttv-cards.c +++ b/drivers/media/video/bt8xx/bttv-cards.c @@ -4085,7 +4085,7 @@ static void __devinit avermedia_eeprom(struct bttv *btv) } /* used on Voodoo TV/FM (Voodoo 200), S0 wired to 0x10000 */ -void bttv_tda9880_setnorm(struct bttv *btv, int norm) +void bttv_tda9880_setnorm(struct bttv *btv, unsigned int norm) { /* fix up our card entry */ if(norm==V4L2_STD_NTSC) { -- cgit v1.2.3