aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video
diff options
context:
space:
mode:
authorHans Verkuil <hverkuil@xs4all.nl>2008-09-03 16:11:54 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2008-09-03 17:37:13 -0400
commitc6eb8eafdba4ad18b4520a0d28a38bc9e61883ea (patch)
tree8b580ce4ac05617bc760272fb29382b1ffc73bad /drivers/media/video
parent980d4f17345fe420fda2a84cd4a28d5d41d73cef (diff)
V4L/DVB (8757): v4l-dvb: fix a bunch of sparse warnings
Fixed a lot of sparse warnings: mostly warnings about shadowed variables and signed/unsigned mismatches. Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video')
-rw-r--r--drivers/media/video/bt8xx/bttv-cards.c70
-rw-r--r--drivers/media/video/bt8xx/bttv-driver.c1
-rw-r--r--drivers/media/video/bt8xx/bttv-risc.c3
-rw-r--r--drivers/media/video/bt8xx/bttvp.h5
-rw-r--r--drivers/media/video/btcx-risc.c4
-rw-r--r--drivers/media/video/btcx-risc.h2
-rw-r--r--drivers/media/video/cpia2/cpia2_v4l.c1
-rw-r--r--drivers/media/video/cx18/cx18-av-firmware.c16
-rw-r--r--drivers/media/video/cx18/cx18-driver.c6
-rw-r--r--drivers/media/video/cx18/cx18-queue.c8
-rw-r--r--drivers/media/video/gspca/gspca.c2
-rw-r--r--drivers/media/video/ks0127.c31
-rw-r--r--drivers/media/video/mxb.c12
-rw-r--r--drivers/media/video/ov511.c14
-rw-r--r--drivers/media/video/pwc/pwc-ctrl.c18
-rw-r--r--drivers/media/video/usbvideo/ibmcam.c6
16 files changed, 108 insertions, 91 deletions
diff --git a/drivers/media/video/bt8xx/bttv-cards.c b/drivers/media/video/bt8xx/bttv-cards.c
index 1c56ae92ce7..9001de23332 100644
--- a/drivers/media/video/bt8xx/bttv-cards.c
+++ b/drivers/media/video/bt8xx/bttv-cards.c
@@ -3144,8 +3144,9 @@ static void identify_by_eeprom(struct bttv *btv, unsigned char eeprom_data[256])
3144 3144
3145static void flyvideo_gpio(struct bttv *btv) 3145static void flyvideo_gpio(struct bttv *btv)
3146{ 3146{
3147 int gpio,has_remote,has_radio,is_capture_only,is_lr90,has_tda9820_tda9821; 3147 int gpio, has_remote, has_radio, is_capture_only;
3148 int tuner=UNSET,ttype; 3148 int is_lr90, has_tda9820_tda9821;
3149 int tuner_type = UNSET, ttype;
3149 3150
3150 gpio_inout(0xffffff, 0); 3151 gpio_inout(0xffffff, 0);
3151 udelay(8); /* without this we would see the 0x1800 mask */ 3152 udelay(8); /* without this we would see the 0x1800 mask */
@@ -3163,20 +3164,26 @@ static void flyvideo_gpio(struct bttv *btv)
3163 * xxxF00(LR26/LR50), xxxFE0(LR90): Remote control chip (LVA001 or CF45) soldered 3164 * xxxF00(LR26/LR50), xxxFE0(LR90): Remote control chip (LVA001 or CF45) soldered
3164 * Note: Some bits are Audio_Mask ! 3165 * Note: Some bits are Audio_Mask !
3165 */ 3166 */
3166 ttype=(gpio&0x0f0000)>>16; 3167 ttype = (gpio & 0x0f0000) >> 16;
3167 switch(ttype) { 3168 switch (ttype) {
3168 case 0x0: tuner=2; /* NTSC, e.g. TPI8NSR11P */ 3169 case 0x0:
3170 tuner_type = 2; /* NTSC, e.g. TPI8NSR11P */
3169 break; 3171 break;
3170 case 0x2: tuner=39;/* LG NTSC (newer TAPC series) TAPC-H701P */ 3172 case 0x2:
3173 tuner_type = 39; /* LG NTSC (newer TAPC series) TAPC-H701P */
3171 break; 3174 break;
3172 case 0x4: tuner=5; /* Philips PAL TPI8PSB02P, TPI8PSB12P, TPI8PSB12D or FI1216, FM1216 */ 3175 case 0x4:
3176 tuner_type = 5; /* Philips PAL TPI8PSB02P, TPI8PSB12P, TPI8PSB12D or FI1216, FM1216 */
3173 break; 3177 break;
3174 case 0x6: tuner=37;/* LG PAL (newer TAPC series) TAPC-G702P */ 3178 case 0x6:
3179 tuner_type = 37; /* LG PAL (newer TAPC series) TAPC-G702P */
3175 break; 3180 break;
3176 case 0xC: tuner=3; /* Philips SECAM(+PAL) FQ1216ME or FI1216MF */ 3181 case 0xC:
3182 tuner_type = 3; /* Philips SECAM(+PAL) FQ1216ME or FI1216MF */
3177 break; 3183 break;
3178 default: 3184 default:
3179 printk(KERN_INFO "bttv%d: FlyVideo_gpio: unknown tuner type.\n", btv->c.nr); 3185 printk(KERN_INFO "bttv%d: FlyVideo_gpio: unknown tuner type.\n", btv->c.nr);
3186 break;
3180 } 3187 }
3181 3188
3182 has_remote = gpio & 0x800000; 3189 has_remote = gpio & 0x800000;
@@ -3189,23 +3196,26 @@ static void flyvideo_gpio(struct bttv *btv)
3189 /* 3196 /*
3190 * gpio & 0x001000 output bit for audio routing */ 3197 * gpio & 0x001000 output bit for audio routing */
3191 3198
3192 if(is_capture_only) 3199 if (is_capture_only)
3193 tuner = TUNER_ABSENT; /* No tuner present */ 3200 tuner_type = TUNER_ABSENT; /* No tuner present */
3194 3201
3195 printk(KERN_INFO "bttv%d: FlyVideo Radio=%s RemoteControl=%s Tuner=%d gpio=0x%06x\n", 3202 printk(KERN_INFO "bttv%d: FlyVideo Radio=%s RemoteControl=%s Tuner=%d gpio=0x%06x\n",
3196 btv->c.nr, has_radio? "yes":"no ", has_remote? "yes":"no ", tuner, gpio); 3203 btv->c.nr, has_radio ? "yes" : "no ",
3204 has_remote ? "yes" : "no ", tuner_type, gpio);
3197 printk(KERN_INFO "bttv%d: FlyVideo LR90=%s tda9821/tda9820=%s capture_only=%s\n", 3205 printk(KERN_INFO "bttv%d: FlyVideo LR90=%s tda9821/tda9820=%s capture_only=%s\n",
3198 btv->c.nr, is_lr90?"yes":"no ", has_tda9820_tda9821?"yes":"no ", 3206 btv->c.nr, is_lr90 ? "yes" : "no ",
3199 is_capture_only?"yes":"no "); 3207 has_tda9820_tda9821 ? "yes" : "no ",
3208 is_capture_only ? "yes" : "no ");
3200 3209
3201 if (tuner != UNSET) /* only set if known tuner autodetected, else let insmod option through */ 3210 if (tuner_type != UNSET) /* only set if known tuner autodetected, else let insmod option through */
3202 btv->tuner_type = tuner; 3211 btv->tuner_type = tuner_type;
3203 btv->has_radio = has_radio; 3212 btv->has_radio = has_radio;
3204 3213
3205 /* LR90 Audio Routing is done by 2 hef4052, so Audio_Mask has 4 bits: 0x001c80 3214 /* LR90 Audio Routing is done by 2 hef4052, so Audio_Mask has 4 bits: 0x001c80
3206 * LR26/LR50 only has 1 hef4052, Audio_Mask 0x000c00 3215 * LR26/LR50 only has 1 hef4052, Audio_Mask 0x000c00
3207 * Audio options: from tuner, from tda9821/tda9821(mono,stereo,sap), from tda9874, ext., mute */ 3216 * Audio options: from tuner, from tda9821/tda9821(mono,stereo,sap), from tda9874, ext., mute */
3208 if(has_tda9820_tda9821) btv->audio_mode_gpio = lt9415_audio; 3217 if (has_tda9820_tda9821)
3218 btv->audio_mode_gpio = lt9415_audio;
3209 /* todo: if(has_tda9874) btv->audio_mode_gpio = fv2000s_audio; */ 3219 /* todo: if(has_tda9874) btv->audio_mode_gpio = fv2000s_audio; */
3210} 3220}
3211 3221
@@ -3962,7 +3972,7 @@ static int tuner_1_table[] = {
3962 3972
3963static void __devinit avermedia_eeprom(struct bttv *btv) 3973static void __devinit avermedia_eeprom(struct bttv *btv)
3964{ 3974{
3965 int tuner_make,tuner_tv_fm,tuner_format,tuner=0; 3975 int tuner_make, tuner_tv_fm, tuner_format, tuner_type = 0;
3966 3976
3967 tuner_make = (eeprom_data[0x41] & 0x7); 3977 tuner_make = (eeprom_data[0x41] & 0x7);
3968 tuner_tv_fm = (eeprom_data[0x41] & 0x18) >> 3; 3978 tuner_tv_fm = (eeprom_data[0x41] & 0x18) >> 3;
@@ -3970,24 +3980,24 @@ static void __devinit avermedia_eeprom(struct bttv *btv)
3970 btv->has_remote = (eeprom_data[0x42] & 0x01); 3980 btv->has_remote = (eeprom_data[0x42] & 0x01);
3971 3981
3972 if (tuner_make == 0 || tuner_make == 2) 3982 if (tuner_make == 0 || tuner_make == 2)
3973 if(tuner_format <=0x0a) 3983 if (tuner_format <= 0x0a)
3974 tuner = tuner_0_table[tuner_format]; 3984 tuner_type = tuner_0_table[tuner_format];
3975 if (tuner_make == 1) 3985 if (tuner_make == 1)
3976 if(tuner_format <=9) 3986 if (tuner_format <= 9)
3977 tuner = tuner_1_table[tuner_format]; 3987 tuner_type = tuner_1_table[tuner_format];
3978 3988
3979 if (tuner_make == 4) 3989 if (tuner_make == 4)
3980 if(tuner_format == 0x09) 3990 if (tuner_format == 0x09)
3981 tuner = TUNER_LG_NTSC_NEW_TAPC; /* TAPC-G702P */ 3991 tuner_type = TUNER_LG_NTSC_NEW_TAPC; /* TAPC-G702P */
3982 3992
3983 printk(KERN_INFO "bttv%d: Avermedia eeprom[0x%02x%02x]: tuner=", 3993 printk(KERN_INFO "bttv%d: Avermedia eeprom[0x%02x%02x]: tuner=",
3984 btv->c.nr,eeprom_data[0x41],eeprom_data[0x42]); 3994 btv->c.nr, eeprom_data[0x41], eeprom_data[0x42]);
3985 if(tuner) { 3995 if (tuner_type) {
3986 btv->tuner_type=tuner; 3996 btv->tuner_type = tuner_type;
3987 printk("%d",tuner); 3997 printk(KERN_CONT "%d", tuner_type);
3988 } else 3998 } else
3989 printk("Unknown type"); 3999 printk(KERN_CONT "Unknown type");
3990 printk(" radio:%s remote control:%s\n", 4000 printk(KERN_CONT " radio:%s remote control:%s\n",
3991 tuner_tv_fm ? "yes" : "no", 4001 tuner_tv_fm ? "yes" : "no",
3992 btv->has_remote ? "yes" : "no"); 4002 btv->has_remote ? "yes" : "no");
3993} 4003}
diff --git a/drivers/media/video/bt8xx/bttv-driver.c b/drivers/media/video/bt8xx/bttv-driver.c
index 85bf31ab878..6ae4cc860ef 100644
--- a/drivers/media/video/bt8xx/bttv-driver.c
+++ b/drivers/media/video/bt8xx/bttv-driver.c
@@ -96,7 +96,6 @@ static unsigned int irq_iswitch;
96static unsigned int uv_ratio = 50; 96static unsigned int uv_ratio = 50;
97static unsigned int full_luma_range; 97static unsigned int full_luma_range;
98static unsigned int coring; 98static unsigned int coring;
99extern int no_overlay;
100 99
101/* API features (turn on/off stuff for testing) */ 100/* API features (turn on/off stuff for testing) */
102static unsigned int v4l2 = 1; 101static unsigned int v4l2 = 1;
diff --git a/drivers/media/video/bt8xx/bttv-risc.c b/drivers/media/video/bt8xx/bttv-risc.c
index 649682aac1a..5b1b8e4c78b 100644
--- a/drivers/media/video/bt8xx/bttv-risc.c
+++ b/drivers/media/video/bt8xx/bttv-risc.c
@@ -244,7 +244,8 @@ bttv_risc_overlay(struct bttv *btv, struct btcx_riscmem *risc,
244 const struct bttv_format *fmt, struct bttv_overlay *ov, 244 const struct bttv_format *fmt, struct bttv_overlay *ov,
245 int skip_even, int skip_odd) 245 int skip_even, int skip_odd)
246{ 246{
247 int dwords,rc,line,maxy,start,end,skip,nskips; 247 int dwords, rc, line, maxy, start, end;
248 unsigned skip, nskips;
248 struct btcx_skiplist *skips; 249 struct btcx_skiplist *skips;
249 __le32 *rp; 250 __le32 *rp;
250 u32 ri,ra; 251 u32 ri,ra;
diff --git a/drivers/media/video/bt8xx/bttvp.h b/drivers/media/video/bt8xx/bttvp.h
index 08ef54a22c9..b4d940b2e44 100644
--- a/drivers/media/video/bt8xx/bttvp.h
+++ b/drivers/media/video/bt8xx/bttvp.h
@@ -267,6 +267,11 @@ int bttv_sub_add_device(struct bttv_core *core, char *name);
267int bttv_sub_del_devices(struct bttv_core *core); 267int bttv_sub_del_devices(struct bttv_core *core);
268 268
269/* ---------------------------------------------------------- */ 269/* ---------------------------------------------------------- */
270/* bttv-cards.c */
271
272extern int no_overlay;
273
274/* ---------------------------------------------------------- */
270/* bttv-driver.c */ 275/* bttv-driver.c */
271 276
272/* insmod options */ 277/* insmod options */
diff --git a/drivers/media/video/btcx-risc.c b/drivers/media/video/btcx-risc.c
index f42701f82e7..3324ab38f58 100644
--- a/drivers/media/video/btcx-risc.c
+++ b/drivers/media/video/btcx-risc.c
@@ -184,12 +184,12 @@ btcx_sort_clips(struct v4l2_clip *clips, unsigned int nclips)
184} 184}
185 185
186void 186void
187btcx_calc_skips(int line, int width, unsigned int *maxy, 187btcx_calc_skips(int line, int width, int *maxy,
188 struct btcx_skiplist *skips, unsigned int *nskips, 188 struct btcx_skiplist *skips, unsigned int *nskips,
189 const struct v4l2_clip *clips, unsigned int nclips) 189 const struct v4l2_clip *clips, unsigned int nclips)
190{ 190{
191 unsigned int clip,skip; 191 unsigned int clip,skip;
192 int end,maxline; 192 int end, maxline;
193 193
194 skip=0; 194 skip=0;
195 maxline = 9999; 195 maxline = 9999;
diff --git a/drivers/media/video/btcx-risc.h b/drivers/media/video/btcx-risc.h
index 861bc811282..f8bc6e8e7b5 100644
--- a/drivers/media/video/btcx-risc.h
+++ b/drivers/media/video/btcx-risc.h
@@ -23,7 +23,7 @@ int btcx_screen_clips(int swidth, int sheight, struct v4l2_rect *win,
23int btcx_align(struct v4l2_rect *win, struct v4l2_clip *clips, 23int btcx_align(struct v4l2_rect *win, struct v4l2_clip *clips,
24 unsigned int n, int mask); 24 unsigned int n, int mask);
25void btcx_sort_clips(struct v4l2_clip *clips, unsigned int nclips); 25void btcx_sort_clips(struct v4l2_clip *clips, unsigned int nclips);
26void btcx_calc_skips(int line, int width, unsigned int *maxy, 26void btcx_calc_skips(int line, int width, int *maxy,
27 struct btcx_skiplist *skips, unsigned int *nskips, 27 struct btcx_skiplist *skips, unsigned int *nskips,
28 const struct v4l2_clip *clips, unsigned int nclips); 28 const struct v4l2_clip *clips, unsigned int nclips);
29 29
diff --git a/drivers/media/video/cpia2/cpia2_v4l.c b/drivers/media/video/cpia2/cpia2_v4l.c
index 515c8b57a60..c8257060642 100644
--- a/drivers/media/video/cpia2/cpia2_v4l.c
+++ b/drivers/media/video/cpia2/cpia2_v4l.c
@@ -1024,7 +1024,6 @@ static int ioctl_queryctrl(void *arg,struct camera_data *cam)
1024 if(cam->params.pnp_id.device_type == DEVICE_STV_672 && 1024 if(cam->params.pnp_id.device_type == DEVICE_STV_672 &&
1025 cam->params.version.sensor_flags==CPIA2_VP_SENSOR_FLAGS_500){ 1025 cam->params.version.sensor_flags==CPIA2_VP_SENSOR_FLAGS_500){
1026 // Maximum 15fps 1026 // Maximum 15fps
1027 int i;
1028 for(i=0; i<c->maximum; ++i) { 1027 for(i=0; i<c->maximum; ++i) {
1029 if(framerate_controls[i].value == 1028 if(framerate_controls[i].value ==
1030 CPIA2_VP_FRAMERATE_15) { 1029 CPIA2_VP_FRAMERATE_15) {
diff --git a/drivers/media/video/cx18/cx18-av-firmware.c b/drivers/media/video/cx18/cx18-av-firmware.c
index 834b9248242..e996a4e3123 100644
--- a/drivers/media/video/cx18/cx18-av-firmware.c
+++ b/drivers/media/video/cx18/cx18-av-firmware.c
@@ -32,7 +32,7 @@ int cx18_av_loadfw(struct cx18 *cx)
32 u32 v; 32 u32 v;
33 const u8 *ptr; 33 const u8 *ptr;
34 int i; 34 int i;
35 int retries = 0; 35 int retries1 = 0;
36 36
37 if (request_firmware(&fw, FWFILE, &cx->dev->dev) != 0) { 37 if (request_firmware(&fw, FWFILE, &cx->dev->dev) != 0) {
38 CX18_ERR("unable to open firmware %s\n", FWFILE); 38 CX18_ERR("unable to open firmware %s\n", FWFILE);
@@ -41,7 +41,7 @@ int cx18_av_loadfw(struct cx18 *cx)
41 41
42 /* The firmware load often has byte errors, so allow for several 42 /* The firmware load often has byte errors, so allow for several
43 retries, both at byte level and at the firmware load level. */ 43 retries, both at byte level and at the firmware load level. */
44 while (retries < 5) { 44 while (retries1 < 5) {
45 cx18_av_write4(cx, CXADEC_CHIP_CTRL, 0x00010000); 45 cx18_av_write4(cx, CXADEC_CHIP_CTRL, 0x00010000);
46 cx18_av_write(cx, CXADEC_STD_DET_CTL, 0xf6); 46 cx18_av_write(cx, CXADEC_STD_DET_CTL, 0xf6);
47 47
@@ -57,9 +57,9 @@ int cx18_av_loadfw(struct cx18 *cx)
57 for (i = 0; i < size; i++) { 57 for (i = 0; i < size; i++) {
58 u32 dl_control = 0x0F000000 | i | ((u32)ptr[i] << 16); 58 u32 dl_control = 0x0F000000 | i | ((u32)ptr[i] << 16);
59 u32 value = 0; 59 u32 value = 0;
60 int retries; 60 int retries2;
61 61
62 for (retries = 0; retries < 5; retries++) { 62 for (retries2 = 0; retries2 < 5; retries2++) {
63 cx18_av_write4(cx, CXADEC_DL_CTL, dl_control); 63 cx18_av_write4(cx, CXADEC_DL_CTL, dl_control);
64 udelay(10); 64 udelay(10);
65 value = cx18_av_read4(cx, CXADEC_DL_CTL); 65 value = cx18_av_read4(cx, CXADEC_DL_CTL);
@@ -69,18 +69,18 @@ int cx18_av_loadfw(struct cx18 *cx)
69 the address. We can only write the lower 69 the address. We can only write the lower
70 address byte of the address. */ 70 address byte of the address. */
71 if ((value & 0x3F00) != (dl_control & 0x3F00)) { 71 if ((value & 0x3F00) != (dl_control & 0x3F00)) {
72 retries = 5; 72 retries2 = 5;
73 break; 73 break;
74 } 74 }
75 } 75 }
76 if (retries >= 5) 76 if (retries2 >= 5)
77 break; 77 break;
78 } 78 }
79 if (i == size) 79 if (i == size)
80 break; 80 break;
81 retries++; 81 retries1++;
82 } 82 }
83 if (retries >= 5) { 83 if (retries1 >= 5) {
84 CX18_ERR("unable to load firmware %s\n", FWFILE); 84 CX18_ERR("unable to load firmware %s\n", FWFILE);
85 release_firmware(fw); 85 release_firmware(fw);
86 return -EIO; 86 return -EIO;
diff --git a/drivers/media/video/cx18/cx18-driver.c b/drivers/media/video/cx18/cx18-driver.c
index 22434aadde3..bd18afebbf8 100644
--- a/drivers/media/video/cx18/cx18-driver.c
+++ b/drivers/media/video/cx18/cx18-driver.c
@@ -74,9 +74,9 @@ static int radio[CX18_MAX_CARDS] = { -1, -1, -1, -1, -1, -1, -1, -1,
74 -1, -1, -1, -1, -1, -1, -1, -1, 74 -1, -1, -1, -1, -1, -1, -1, -1,
75 -1, -1, -1, -1, -1, -1, -1, -1 }; 75 -1, -1, -1, -1, -1, -1, -1, -1 };
76 76
77static int cardtype_c = 1; 77static unsigned cardtype_c = 1;
78static int tuner_c = 1; 78static unsigned tuner_c = 1;
79static int radio_c = 1; 79static unsigned radio_c = 1;
80static char pal[] = "--"; 80static char pal[] = "--";
81static char secam[] = "--"; 81static char secam[] = "--";
82static char ntsc[] = "-"; 82static char ntsc[] = "-";
diff --git a/drivers/media/video/cx18/cx18-queue.c b/drivers/media/video/cx18/cx18-queue.c
index 8a4dd821fd9..a31da49f912 100644
--- a/drivers/media/video/cx18/cx18-queue.c
+++ b/drivers/media/video/cx18/cx18-queue.c
@@ -217,10 +217,10 @@ int cx18_stream_alloc(struct cx18_stream *s)
217 s->name, s->buffers, s->buf_size, 217 s->name, s->buffers, s->buf_size,
218 s->buffers * s->buf_size / 1024); 218 s->buffers * s->buf_size / 1024);
219 219
220 if (((char *)&cx->scb->cpu_mdl[cx->mdl_offset + s->buffers] - 220 if (((char __iomem *)&cx->scb->cpu_mdl[cx->mdl_offset + s->buffers] -
221 (char *)cx->scb) > SCB_RESERVED_SIZE) { 221 (char __iomem *)cx->scb) > SCB_RESERVED_SIZE) {
222 unsigned bufsz = (((char *)cx->scb) + SCB_RESERVED_SIZE - 222 unsigned bufsz = (((char __iomem *)cx->scb) + SCB_RESERVED_SIZE -
223 ((char *)cx->scb->cpu_mdl)); 223 ((char __iomem *)cx->scb->cpu_mdl));
224 224
225 CX18_ERR("Too many buffers, cannot fit in SCB area\n"); 225 CX18_ERR("Too many buffers, cannot fit in SCB area\n");
226 CX18_ERR("Max buffers = %zd\n", 226 CX18_ERR("Max buffers = %zd\n",
diff --git a/drivers/media/video/gspca/gspca.c b/drivers/media/video/gspca/gspca.c
index 3461bc9e473..0b292ca0c08 100644
--- a/drivers/media/video/gspca/gspca.c
+++ b/drivers/media/video/gspca/gspca.c
@@ -1401,7 +1401,7 @@ static int vidioc_dqbuf(struct file *file, void *priv,
1401 i = ret; /* frame index */ 1401 i = ret; /* frame index */
1402 frame = &gspca_dev->frame[i]; 1402 frame = &gspca_dev->frame[i];
1403 if (gspca_dev->memory == V4L2_MEMORY_USERPTR) { 1403 if (gspca_dev->memory == V4L2_MEMORY_USERPTR) {
1404 if (copy_to_user((__u8 *) frame->v4l2_buf.m.userptr, 1404 if (copy_to_user((__u8 __user *) frame->v4l2_buf.m.userptr,
1405 frame->data, 1405 frame->data,
1406 frame->v4l2_buf.bytesused)) { 1406 frame->v4l2_buf.bytesused)) {
1407 PDEBUG(D_ERR|D_STREAM, 1407 PDEBUG(D_ERR|D_STREAM,
diff --git a/drivers/media/video/ks0127.c b/drivers/media/video/ks0127.c
index 4895540be19..2fd4b4a44aa 100644
--- a/drivers/media/video/ks0127.c
+++ b/drivers/media/video/ks0127.c
@@ -679,26 +679,27 @@ static int ks0127_command(struct i2c_client *client,
679 679
680 case DECODER_ENABLE_OUTPUT: 680 case DECODER_ENABLE_OUTPUT:
681 { 681 {
682 int enable;
682 683
683 int *iarg = arg; 684 iarg = arg;
684 int enable = (*iarg != 0); 685 enable = (*iarg != 0);
685 if (enable) { 686 if (enable) {
686 dprintk("ks0127: command " 687 dprintk("ks0127: command "
687 "DECODER_ENABLE_OUTPUT on " 688 "DECODER_ENABLE_OUTPUT on "
688 "(%d)\n", enable); 689 "(%d)\n", enable);
689 /* All output pins on */ 690 /* All output pins on */
690 ks0127_and_or(ks, KS_OFMTA, 0xcf, 0x30); 691 ks0127_and_or(ks, KS_OFMTA, 0xcf, 0x30);
691 /* Obey the OEN pin */ 692 /* Obey the OEN pin */
692 ks0127_and_or(ks, KS_CDEM, 0x7f, 0x00); 693 ks0127_and_or(ks, KS_CDEM, 0x7f, 0x00);
693 } else { 694 } else {
694 dprintk("ks0127: command " 695 dprintk("ks0127: command "
695 "DECODER_ENABLE_OUTPUT off " 696 "DECODER_ENABLE_OUTPUT off "
696 "(%d)\n", enable); 697 "(%d)\n", enable);
697 /* Video output pins off */ 698 /* Video output pins off */
698 ks0127_and_or(ks, KS_OFMTA, 0xcf, 0x00); 699 ks0127_and_or(ks, KS_OFMTA, 0xcf, 0x00);
699 /* Ignore the OEN pin */ 700 /* Ignore the OEN pin */
700 ks0127_and_or(ks, KS_CDEM, 0x7f, 0x80); 701 ks0127_and_or(ks, KS_CDEM, 0x7f, 0x80);
701 } 702 }
702 } 703 }
703 break; 704 break;
704 705
diff --git a/drivers/media/video/mxb.c b/drivers/media/video/mxb.c
index f68e91fbe7f..8ef578caba3 100644
--- a/drivers/media/video/mxb.c
+++ b/drivers/media/video/mxb.c
@@ -931,27 +931,29 @@ static int mxb_ioctl(struct saa7146_fh *fh, unsigned int cmd, void *arg)
931 return 0; 931 return 0;
932} 932}
933 933
934static int std_callback(struct saa7146_dev* dev, struct saa7146_standard *std) 934static int std_callback(struct saa7146_dev *dev, struct saa7146_standard *standard)
935{ 935{
936 struct mxb* mxb = (struct mxb*)dev->ext_priv; 936 struct mxb *mxb = (struct mxb *)dev->ext_priv;
937 int zero = 0; 937 int zero = 0;
938 int one = 1; 938 int one = 1;
939 939
940 if(V4L2_STD_PAL_I == std->id ) { 940 if (V4L2_STD_PAL_I == standard->id) {
941 v4l2_std_id std = V4L2_STD_PAL_I; 941 v4l2_std_id std = V4L2_STD_PAL_I;
942
942 DEB_D(("VIDIOC_S_STD: setting mxb for PAL_I.\n")); 943 DEB_D(("VIDIOC_S_STD: setting mxb for PAL_I.\n"));
943 /* set the 7146 gpio register -- I don't know what this does exactly */ 944 /* set the 7146 gpio register -- I don't know what this does exactly */
944 saa7146_write(dev, GPIO_CTRL, 0x00404050); 945 saa7146_write(dev, GPIO_CTRL, 0x00404050);
945 /* unset the 7111 gpio register -- I don't know what this does exactly */ 946 /* unset the 7111 gpio register -- I don't know what this does exactly */
946 mxb->saa7111a->driver->command(mxb->saa7111a,DECODER_SET_GPIO, &zero); 947 mxb->saa7111a->driver->command(mxb->saa7111a, DECODER_SET_GPIO, &zero);
947 mxb->tuner->driver->command(mxb->tuner, VIDIOC_S_STD, &std); 948 mxb->tuner->driver->command(mxb->tuner, VIDIOC_S_STD, &std);
948 } else { 949 } else {
949 v4l2_std_id std = V4L2_STD_PAL_BG; 950 v4l2_std_id std = V4L2_STD_PAL_BG;
951
950 DEB_D(("VIDIOC_S_STD: setting mxb for PAL/NTSC/SECAM.\n")); 952 DEB_D(("VIDIOC_S_STD: setting mxb for PAL/NTSC/SECAM.\n"));
951 /* set the 7146 gpio register -- I don't know what this does exactly */ 953 /* set the 7146 gpio register -- I don't know what this does exactly */
952 saa7146_write(dev, GPIO_CTRL, 0x00404050); 954 saa7146_write(dev, GPIO_CTRL, 0x00404050);
953 /* set the 7111 gpio register -- I don't know what this does exactly */ 955 /* set the 7111 gpio register -- I don't know what this does exactly */
954 mxb->saa7111a->driver->command(mxb->saa7111a,DECODER_SET_GPIO, &one); 956 mxb->saa7111a->driver->command(mxb->saa7111a, DECODER_SET_GPIO, &one);
955 mxb->tuner->driver->command(mxb->tuner, VIDIOC_S_STD, &std); 957 mxb->tuner->driver->command(mxb->tuner, VIDIOC_S_STD, &std);
956 } 958 }
957 return 0; 959 return 0;
diff --git a/drivers/media/video/ov511.c b/drivers/media/video/ov511.c
index 9edaca4371d..3d3c48db45d 100644
--- a/drivers/media/video/ov511.c
+++ b/drivers/media/video/ov511.c
@@ -626,9 +626,9 @@ ov511_i2c_write_internal(struct usb_ov511 *ov,
626 break; 626 break;
627 627
628 /* Retry until idle */ 628 /* Retry until idle */
629 do 629 do {
630 rc = reg_r(ov, R511_I2C_CTL); 630 rc = reg_r(ov, R511_I2C_CTL);
631 while (rc > 0 && ((rc&1) == 0)); 631 } while (rc > 0 && ((rc&1) == 0));
632 if (rc < 0) 632 if (rc < 0)
633 break; 633 break;
634 634
@@ -703,9 +703,9 @@ ov511_i2c_read_internal(struct usb_ov511 *ov, unsigned char reg)
703 return rc; 703 return rc;
704 704
705 /* Retry until idle */ 705 /* Retry until idle */
706 do 706 do {
707 rc = reg_r(ov, R511_I2C_CTL); 707 rc = reg_r(ov, R511_I2C_CTL);
708 while (rc > 0 && ((rc&1) == 0)); 708 } while (rc > 0 && ((rc & 1) == 0));
709 if (rc < 0) 709 if (rc < 0)
710 return rc; 710 return rc;
711 711
@@ -729,9 +729,9 @@ ov511_i2c_read_internal(struct usb_ov511 *ov, unsigned char reg)
729 return rc; 729 return rc;
730 730
731 /* Retry until idle */ 731 /* Retry until idle */
732 do 732 do {
733 rc = reg_r(ov, R511_I2C_CTL); 733 rc = reg_r(ov, R511_I2C_CTL);
734 while (rc > 0 && ((rc&1) == 0)); 734 } while (rc > 0 && ((rc&1) == 0));
735 if (rc < 0) 735 if (rc < 0)
736 return rc; 736 return rc;
737 737
diff --git a/drivers/media/video/pwc/pwc-ctrl.c b/drivers/media/video/pwc/pwc-ctrl.c
index 1cccd5c7704..dbc56074255 100644
--- a/drivers/media/video/pwc/pwc-ctrl.c
+++ b/drivers/media/video/pwc/pwc-ctrl.c
@@ -1635,15 +1635,15 @@ int pwc_ioctl(struct pwc_device *pdev, unsigned int cmd, void *arg)
1635 1635
1636 case VIDIOCPWCGVIDCMD: 1636 case VIDIOCPWCGVIDCMD:
1637 { 1637 {
1638 ARG_DEF(struct pwc_video_command, cmd); 1638 ARG_DEF(struct pwc_video_command, vcmd);
1639 1639
1640 ARGR(cmd).type = pdev->type; 1640 ARGR(vcmd).type = pdev->type;
1641 ARGR(cmd).release = pdev->release; 1641 ARGR(vcmd).release = pdev->release;
1642 ARGR(cmd).command_len = pdev->cmd_len; 1642 ARGR(vcmd).command_len = pdev->cmd_len;
1643 memcpy(&ARGR(cmd).command_buf, pdev->cmd_buf, pdev->cmd_len); 1643 memcpy(&ARGR(vcmd).command_buf, pdev->cmd_buf, pdev->cmd_len);
1644 ARGR(cmd).bandlength = pdev->vbandlength; 1644 ARGR(vcmd).bandlength = pdev->vbandlength;
1645 ARGR(cmd).frame_size = pdev->frame_size; 1645 ARGR(vcmd).frame_size = pdev->frame_size;
1646 ARG_OUT(cmd) 1646 ARG_OUT(vcmd)
1647 break; 1647 break;
1648 } 1648 }
1649 /* 1649 /*
diff --git a/drivers/media/video/usbvideo/ibmcam.c b/drivers/media/video/usbvideo/ibmcam.c
index 59166b76010..cc27efe121d 100644
--- a/drivers/media/video/usbvideo/ibmcam.c
+++ b/drivers/media/video/usbvideo/ibmcam.c
@@ -736,12 +736,12 @@ static enum ParseState ibmcam_model2_320x240_parse_lines(
736 * make black color and quit the horizontal scanning loop. 736 * make black color and quit the horizontal scanning loop.
737 */ 737 */
738 if (((frame->curline + 2) >= scanHeight) || (i >= scanLength)) { 738 if (((frame->curline + 2) >= scanHeight) || (i >= scanLength)) {
739 const int j = i * V4L_BYTES_PER_PIXEL; 739 const int offset = i * V4L_BYTES_PER_PIXEL;
740#if USES_IBMCAM_PUTPIXEL 740#if USES_IBMCAM_PUTPIXEL
741 /* Refresh 'f' because we don't use it much with PUTPIXEL */ 741 /* Refresh 'f' because we don't use it much with PUTPIXEL */
742 f = frame->data + (v4l_linesize * frame->curline) + j; 742 f = frame->data + (v4l_linesize * frame->curline) + offset;
743#endif 743#endif
744 memset(f, 0, v4l_linesize - j); 744 memset(f, 0, v4l_linesize - offset);
745 break; 745 break;
746 } 746 }
747 747