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/bttvp.h | |
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/bttvp.h')
-rw-r--r-- | drivers/media/video/bt8xx/bttvp.h | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/drivers/media/video/bt8xx/bttvp.h b/drivers/media/video/bt8xx/bttvp.h index 199a4d225caf..230e148e78fe 100644 --- a/drivers/media/video/bt8xx/bttvp.h +++ b/drivers/media/video/bt8xx/bttvp.h | |||
@@ -135,7 +135,7 @@ struct bttv_buffer { | |||
135 | 135 | ||
136 | /* bttv specific */ | 136 | /* bttv specific */ |
137 | const struct bttv_format *fmt; | 137 | const struct bttv_format *fmt; |
138 | int tvnorm; | 138 | unsigned int tvnorm; |
139 | int btformat; | 139 | int btformat; |
140 | int btswap; | 140 | int btswap; |
141 | struct bttv_geometry geo; | 141 | struct bttv_geometry geo; |
@@ -154,7 +154,7 @@ struct bttv_buffer_set { | |||
154 | }; | 154 | }; |
155 | 155 | ||
156 | struct bttv_overlay { | 156 | struct bttv_overlay { |
157 | int tvnorm; | 157 | unsigned int tvnorm; |
158 | struct v4l2_rect w; | 158 | struct v4l2_rect w; |
159 | enum v4l2_field field; | 159 | enum v4l2_field field; |
160 | struct v4l2_clip *clips; | 160 | struct v4l2_clip *clips; |
@@ -174,7 +174,7 @@ struct bttv_vbi_fmt { | |||
174 | }; | 174 | }; |
175 | 175 | ||
176 | /* bttv-vbi.c */ | 176 | /* bttv-vbi.c */ |
177 | void bttv_vbi_fmt_reset(struct bttv_vbi_fmt *f, int norm); | 177 | void bttv_vbi_fmt_reset(struct bttv_vbi_fmt *f, unsigned int norm); |
178 | 178 | ||
179 | struct bttv_crop { | 179 | struct bttv_crop { |
180 | /* A cropping rectangle in struct bttv_tvnorm.cropcap units. */ | 180 | /* A cropping rectangle in struct bttv_tvnorm.cropcap units. */ |
@@ -378,7 +378,8 @@ struct bttv { | |||
378 | unsigned int audio; | 378 | unsigned int audio; |
379 | unsigned int mute; | 379 | unsigned int mute; |
380 | unsigned long freq; | 380 | unsigned long freq; |
381 | int tvnorm,hue,contrast,bright,saturation; | 381 | unsigned int tvnorm; |
382 | int hue, contrast, bright, saturation; | ||
382 | struct v4l2_framebuffer fbuf; | 383 | struct v4l2_framebuffer fbuf; |
383 | unsigned int field_count; | 384 | unsigned int field_count; |
384 | 385 | ||