diff options
author | Trent Piepho <xyzzy@speakeasy.org> | 2009-01-28 19:32:58 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2009-03-30 11:42:46 -0400 |
commit | 4ef2ccc2611456667ea78c6f418ce87e1fa9fac5 (patch) | |
tree | edb8e2540969dfe6143cd75c35ed18d1937f74df /drivers/media/video/bt8xx/bttv-vbi.c | |
parent | 1d6af821a91df15e3fc2720c223ec514ae83dc86 (diff) |
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 <roel.kluin@gmail.com>
Signed-off-by: Trent Piepho <xyzzy@speakeasy.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/bt8xx/bttv-vbi.c')
-rw-r--r-- | drivers/media/video/bt8xx/bttv-vbi.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/media/video/bt8xx/bttv-vbi.c b/drivers/media/video/bt8xx/bttv-vbi.c index 6819e21a3773..e79a402fa6cd 100644 --- a/drivers/media/video/bt8xx/bttv-vbi.c +++ b/drivers/media/video/bt8xx/bttv-vbi.c | |||
@@ -411,7 +411,7 @@ int bttv_g_fmt_vbi_cap(struct file *file, void *f, struct v4l2_format *frt) | |||
411 | return 0; | 411 | return 0; |
412 | } | 412 | } |
413 | 413 | ||
414 | void bttv_vbi_fmt_reset(struct bttv_vbi_fmt *f, int norm) | 414 | void bttv_vbi_fmt_reset(struct bttv_vbi_fmt *f, unsigned int norm) |
415 | { | 415 | { |
416 | const struct bttv_tvnorm *tvnorm; | 416 | const struct bttv_tvnorm *tvnorm; |
417 | unsigned int real_samples_per_line; | 417 | unsigned int real_samples_per_line; |