summaryrefslogtreecommitdiff
path: root/linux/drivers/media/video/bt8xx/bttvp.h
diff options
context:
space:
mode:
authorTrent Piepho <xyzzy@speakeasy.org>2009-01-28 16:32:58 -0800
committerTrent Piepho <xyzzy@speakeasy.org>2009-01-28 16:32:58 -0800
commit562378e1f982f3a817c81594e61d40ffa05fac7d (patch)
tree29717f3f822e1720a6e922418392c364c0991839 /linux/drivers/media/video/bt8xx/bttvp.h
parent471270c843cfbff8d1b8944c0c54850c121dd6e2 (diff)
downloadmediapointer-dvb-s2-562378e1f982f3a817c81594e61d40ffa05fac7d.tar.gz
mediapointer-dvb-s2-562378e1f982f3a817c81594e61d40ffa05fac7d.tar.bz2
bttv: norm value should be unsigned
From: Trent Piepho <xyzzy@speakeasy.org> 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. Priority: normal Reported-by: Roel Kluin <roel.kluin@gmail.com> Signed-off-by: Trent Piepho <xyzzy@speakeasy.org>
Diffstat (limited to 'linux/drivers/media/video/bt8xx/bttvp.h')
-rw-r--r--linux/drivers/media/video/bt8xx/bttvp.h9
1 files changed, 5 insertions, 4 deletions
diff --git a/linux/drivers/media/video/bt8xx/bttvp.h b/linux/drivers/media/video/bt8xx/bttvp.h
index 92961e130..71289d832 100644
--- a/linux/drivers/media/video/bt8xx/bttvp.h
+++ b/linux/drivers/media/video/bt8xx/bttvp.h
@@ -137,7 +137,7 @@ struct bttv_buffer {
/* bttv specific */
const struct bttv_format *fmt;
- int tvnorm;
+ unsigned int tvnorm;
int btformat;
int btswap;
struct bttv_geometry geo;
@@ -156,7 +156,7 @@ struct bttv_buffer_set {
};
struct bttv_overlay {
- int tvnorm;
+ unsigned int tvnorm;
struct v4l2_rect w;
enum v4l2_field field;
struct v4l2_clip *clips;
@@ -176,7 +176,7 @@ struct bttv_vbi_fmt {
};
/* bttv-vbi.c */
-void bttv_vbi_fmt_reset(struct bttv_vbi_fmt *f, int norm);
+void bttv_vbi_fmt_reset(struct bttv_vbi_fmt *f, unsigned int norm);
struct bttv_crop {
/* A cropping rectangle in struct bttv_tvnorm.cropcap units. */
@@ -380,7 +380,8 @@ struct bttv {
unsigned int audio;
unsigned int mute;
unsigned long freq;
- int tvnorm,hue,contrast,bright,saturation;
+ unsigned int tvnorm;
+ int hue, contrast, bright, saturation;
struct v4l2_framebuffer fbuf;
unsigned int field_count;