Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Hans Verkuil and committed by
Mauro Carvalho Chehab
c6eb8eaf 980d4f17

+145 -130
+1 -3
drivers/media/common/saa7146_video.c
··· 1068 1068 { 1069 1069 v4l2_std_id *id = arg; 1070 1070 int found = 0; 1071 - int i, err; 1071 + int i; 1072 1072 1073 1073 DEB_EE(("VIDIOC_S_STD\n")); 1074 1074 ··· 1116 1116 case VIDIOC_OVERLAY: 1117 1117 { 1118 1118 int on = *(int *)arg; 1119 - int err = 0; 1120 1119 1121 1120 DEB_D(("VIDIOC_OVERLAY on:%d\n",on)); 1122 1121 if (on != 0) { ··· 1191 1192 case VIDIOCGMBUF: 1192 1193 { 1193 1194 struct video_mbuf *mbuf = arg; 1194 - struct videobuf_queue *q; 1195 1195 int i; 1196 1196 1197 1197 /* fixme: number of capture buffers and sizes for v4l apps */
+17 -16
drivers/media/common/tuners/tuner-simple.c
··· 253 253 254 254 static int simple_config_lookup(struct dvb_frontend *fe, 255 255 struct tuner_params *t_params, 256 - int *frequency, u8 *config, u8 *cb) 256 + unsigned *frequency, u8 *config, u8 *cb) 257 257 { 258 258 struct tuner_simple_priv *priv = fe->tuner_priv; 259 259 int i; ··· 587 587 priv->last_div = div; 588 588 if (t_params->has_tda9887) { 589 589 struct v4l2_priv_tun_config tda9887_cfg; 590 - int config = 0; 590 + int tda_config = 0; 591 591 int is_secam_l = (params->std & (V4L2_STD_SECAM_L | 592 592 V4L2_STD_SECAM_LC)) && 593 593 !(params->std & ~(V4L2_STD_SECAM_L | 594 594 V4L2_STD_SECAM_LC)); 595 595 596 596 tda9887_cfg.tuner = TUNER_TDA9887; 597 - tda9887_cfg.priv = &config; 597 + tda9887_cfg.priv = &tda_config; 598 598 599 599 if (params->std == V4L2_STD_SECAM_LC) { 600 600 if (t_params->port1_active ^ t_params->port1_invert_for_secam_lc) 601 - config |= TDA9887_PORT1_ACTIVE; 601 + tda_config |= TDA9887_PORT1_ACTIVE; 602 602 if (t_params->port2_active ^ t_params->port2_invert_for_secam_lc) 603 - config |= TDA9887_PORT2_ACTIVE; 603 + tda_config |= TDA9887_PORT2_ACTIVE; 604 604 } else { 605 605 if (t_params->port1_active) 606 - config |= TDA9887_PORT1_ACTIVE; 606 + tda_config |= TDA9887_PORT1_ACTIVE; 607 607 if (t_params->port2_active) 608 - config |= TDA9887_PORT2_ACTIVE; 608 + tda_config |= TDA9887_PORT2_ACTIVE; 609 609 } 610 610 if (t_params->intercarrier_mode) 611 - config |= TDA9887_INTERCARRIER; 611 + tda_config |= TDA9887_INTERCARRIER; 612 612 if (is_secam_l) { 613 613 if (i == 0 && t_params->default_top_secam_low) 614 - config |= TDA9887_TOP(t_params->default_top_secam_low); 614 + tda_config |= TDA9887_TOP(t_params->default_top_secam_low); 615 615 else if (i == 1 && t_params->default_top_secam_mid) 616 - config |= TDA9887_TOP(t_params->default_top_secam_mid); 616 + tda_config |= TDA9887_TOP(t_params->default_top_secam_mid); 617 617 else if (t_params->default_top_secam_high) 618 - config |= TDA9887_TOP(t_params->default_top_secam_high); 618 + tda_config |= TDA9887_TOP(t_params->default_top_secam_high); 619 619 } else { 620 620 if (i == 0 && t_params->default_top_low) 621 - config |= TDA9887_TOP(t_params->default_top_low); 621 + tda_config |= TDA9887_TOP(t_params->default_top_low); 622 622 else if (i == 1 && t_params->default_top_mid) 623 - config |= TDA9887_TOP(t_params->default_top_mid); 623 + tda_config |= TDA9887_TOP(t_params->default_top_mid); 624 624 else if (t_params->default_top_high) 625 - config |= TDA9887_TOP(t_params->default_top_high); 625 + tda_config |= TDA9887_TOP(t_params->default_top_high); 626 626 } 627 627 if (t_params->default_pll_gating_18) 628 - config |= TDA9887_GATING_18; 628 + tda_config |= TDA9887_GATING_18; 629 629 i2c_clients_command(priv->i2c_props.adap, TUNER_SET_CONFIG, 630 630 &tda9887_cfg); 631 631 } ··· 813 813 static struct tuner_params *t_params; 814 814 u8 config, cb; 815 815 u32 div; 816 - int ret, frequency = params->frequency / 62500; 816 + int ret; 817 + unsigned frequency = params->frequency / 62500; 817 818 818 819 t_params = simple_tuner_params(fe, TUNER_PARAM_TYPE_DIGITAL); 819 820 ret = simple_config_lookup(fe, t_params, &frequency, &config, &cb);
-1
drivers/media/dvb/dvb-core/dmxdev.c
··· 641 641 struct timespec timeout = { 0 }; 642 642 struct dmx_pes_filter_params *para = &filter->params.pes; 643 643 dmx_output_t otype; 644 - int ret; 645 644 int ts_type; 646 645 enum dmx_ts_pes ts_pes; 647 646 struct dmx_ts_feed **tsfeed = &filter->feed.ts;
+2 -2
drivers/media/dvb/dvb-core/dvb_ca_en50221.c
··· 1032 1032 /* we need this extra check for annoying interfaces like the budget-av */ 1033 1033 if ((!(ca->flags & DVB_CA_EN50221_FLAG_IRQ_CAMCHANGE)) && 1034 1034 (ca->pub->poll_slot_status)) { 1035 - int status = ca->pub->poll_slot_status(ca->pub, slot, 0); 1035 + status = ca->pub->poll_slot_status(ca->pub, slot, 0); 1036 1036 if (!(status & DVB_CA_EN50221_POLL_CAM_PRESENT)) { 1037 1037 ca->slot_info[slot].slot_state = DVB_CA_SLOTSTATE_NONE; 1038 1038 dvb_ca_en50221_thread_update_delay(ca); ··· 1089 1089 /* we need this extra check for annoying interfaces like the budget-av */ 1090 1090 if ((!(ca->flags & DVB_CA_EN50221_FLAG_IRQ_CAMCHANGE)) && 1091 1091 (ca->pub->poll_slot_status)) { 1092 - int status = ca->pub->poll_slot_status(ca->pub, slot, 0); 1092 + status = ca->pub->poll_slot_status(ca->pub, slot, 0); 1093 1093 if (!(status & DVB_CA_EN50221_POLL_CAM_PRESENT)) { 1094 1094 ca->slot_info[slot].slot_state = DVB_CA_SLOTSTATE_NONE; 1095 1095 dvb_ca_en50221_thread_update_delay(ca);
+4 -4
drivers/media/dvb/dvb-core/dvb_frontend.c
··· 889 889 * initialization, so parg is 8 bits and does not 890 890 * include the initialization or start bit 891 891 */ 892 - unsigned long cmd = ((unsigned long) parg) << 1; 892 + unsigned long swcmd = ((unsigned long) parg) << 1; 893 893 struct timeval nexttime; 894 894 struct timeval tv[10]; 895 895 int i; 896 896 u8 last = 1; 897 897 if (dvb_frontend_debug) 898 - printk("%s switch command: 0x%04lx\n", __func__, cmd); 898 + printk("%s switch command: 0x%04lx\n", __func__, swcmd); 899 899 do_gettimeofday(&nexttime); 900 900 if (dvb_frontend_debug) 901 901 memcpy(&tv[0], &nexttime, sizeof(struct timeval)); ··· 908 908 for (i = 0; i < 9; i++) { 909 909 if (dvb_frontend_debug) 910 910 do_gettimeofday(&tv[i + 1]); 911 - if ((cmd & 0x01) != last) { 911 + if ((swcmd & 0x01) != last) { 912 912 /* set voltage to (last ? 13V : 18V) */ 913 913 fe->ops.set_voltage(fe, (last) ? SEC_VOLTAGE_13 : SEC_VOLTAGE_18); 914 914 last = (last) ? 0 : 1; 915 915 } 916 - cmd = cmd >> 1; 916 + swcmd = swcmd >> 1; 917 917 if (i != 8) 918 918 dvb_frontend_sleep_until(&nexttime, 8000); 919 919 }
+1 -1
drivers/media/dvb/dvb-usb/cxusb.c
··· 210 210 if (d->state == DVB_USB_STATE_INIT && 211 211 usb_set_interface(d->udev, 0, 0) < 0) 212 212 err("set interface failed"); 213 - do; while (!(ret = cxusb_ctrl_msg(d, CMD_POWER_ON, NULL, 0, NULL, 0)) && 213 + do {} while (!(ret = cxusb_ctrl_msg(d, CMD_POWER_ON, NULL, 0, NULL, 0)) && 214 214 !(ret = cxusb_ctrl_msg(d, 0x15, NULL, 0, NULL, 0)) && 215 215 !(ret = cxusb_ctrl_msg(d, 0x17, NULL, 0, NULL, 0)) && 0); 216 216 if (!ret) {
+13 -13
drivers/media/radio/radio-maxiradio.c
··· 156 156 { 157 157 unsigned long int si; 158 158 int bl; 159 - int data = FREQ2BITS(freq); 159 + int val = FREQ2BITS(freq); 160 160 161 161 /* TEA5757 shift register bits (see pdf) */ 162 162 163 - outbit(0,io); // 24 search 164 - outbit(1,io); // 23 search up/down 163 + outbit(0, io); /* 24 search */ 164 + outbit(1, io); /* 23 search up/down */ 165 165 166 - outbit(0,io); // 22 stereo/mono 166 + outbit(0, io); /* 22 stereo/mono */ 167 167 168 - outbit(0,io); // 21 band 169 - outbit(0,io); // 20 band (only 00=FM works I think) 168 + outbit(0, io); /* 21 band */ 169 + outbit(0, io); /* 20 band (only 00=FM works I think) */ 170 170 171 - outbit(0,io); // 19 port ? 172 - outbit(0,io); // 18 port ? 171 + outbit(0, io); /* 19 port ? */ 172 + outbit(0, io); /* 18 port ? */ 173 173 174 - outbit(0,io); // 17 search level 175 - outbit(0,io); // 16 search level 174 + outbit(0, io); /* 17 search level */ 175 + outbit(0, io); /* 16 search level */ 176 176 177 177 si = 0x8000; 178 - for (bl = 1; bl <= 16 ; bl++) { 179 - outbit(data & si,io); 180 - si >>=1; 178 + for (bl = 1; bl <= 16; bl++) { 179 + outbit(val & si, io); 180 + si >>= 1; 181 181 } 182 182 183 183 dprintk(1, "Radio freq set to %d.%02d MHz\n",
+40 -30
drivers/media/video/bt8xx/bttv-cards.c
··· 3144 3144 3145 3145 static void flyvideo_gpio(struct bttv *btv) 3146 3146 { 3147 - int gpio,has_remote,has_radio,is_capture_only,is_lr90,has_tda9820_tda9821; 3148 - int tuner=UNSET,ttype; 3147 + int gpio, has_remote, has_radio, is_capture_only; 3148 + int is_lr90, has_tda9820_tda9821; 3149 + int tuner_type = UNSET, ttype; 3149 3150 3150 3151 gpio_inout(0xffffff, 0); 3151 3152 udelay(8); /* without this we would see the 0x1800 mask */ ··· 3164 3163 * xxxF00(LR26/LR50), xxxFE0(LR90): Remote control chip (LVA001 or CF45) soldered 3165 3164 * Note: Some bits are Audio_Mask ! 3166 3165 */ 3167 - ttype=(gpio&0x0f0000)>>16; 3168 - switch(ttype) { 3169 - case 0x0: tuner=2; /* NTSC, e.g. TPI8NSR11P */ 3166 + ttype = (gpio & 0x0f0000) >> 16; 3167 + switch (ttype) { 3168 + case 0x0: 3169 + tuner_type = 2; /* NTSC, e.g. TPI8NSR11P */ 3170 3170 break; 3171 - case 0x2: tuner=39;/* LG NTSC (newer TAPC series) TAPC-H701P */ 3171 + case 0x2: 3172 + tuner_type = 39; /* LG NTSC (newer TAPC series) TAPC-H701P */ 3172 3173 break; 3173 - case 0x4: tuner=5; /* Philips PAL TPI8PSB02P, TPI8PSB12P, TPI8PSB12D or FI1216, FM1216 */ 3174 + case 0x4: 3175 + tuner_type = 5; /* Philips PAL TPI8PSB02P, TPI8PSB12P, TPI8PSB12D or FI1216, FM1216 */ 3174 3176 break; 3175 - case 0x6: tuner=37;/* LG PAL (newer TAPC series) TAPC-G702P */ 3177 + case 0x6: 3178 + tuner_type = 37; /* LG PAL (newer TAPC series) TAPC-G702P */ 3176 3179 break; 3177 - case 0xC: tuner=3; /* Philips SECAM(+PAL) FQ1216ME or FI1216MF */ 3180 + case 0xC: 3181 + tuner_type = 3; /* Philips SECAM(+PAL) FQ1216ME or FI1216MF */ 3178 3182 break; 3179 3183 default: 3180 3184 printk(KERN_INFO "bttv%d: FlyVideo_gpio: unknown tuner type.\n", btv->c.nr); 3185 + break; 3181 3186 } 3182 3187 3183 3188 has_remote = gpio & 0x800000; ··· 3196 3189 /* 3197 3190 * gpio & 0x001000 output bit for audio routing */ 3198 3191 3199 - if(is_capture_only) 3200 - tuner = TUNER_ABSENT; /* No tuner present */ 3192 + if (is_capture_only) 3193 + tuner_type = TUNER_ABSENT; /* No tuner present */ 3201 3194 3202 3195 printk(KERN_INFO "bttv%d: FlyVideo Radio=%s RemoteControl=%s Tuner=%d gpio=0x%06x\n", 3203 - btv->c.nr, has_radio? "yes":"no ", has_remote? "yes":"no ", tuner, gpio); 3196 + btv->c.nr, has_radio ? "yes" : "no ", 3197 + has_remote ? "yes" : "no ", tuner_type, gpio); 3204 3198 printk(KERN_INFO "bttv%d: FlyVideo LR90=%s tda9821/tda9820=%s capture_only=%s\n", 3205 - btv->c.nr, is_lr90?"yes":"no ", has_tda9820_tda9821?"yes":"no ", 3206 - is_capture_only?"yes":"no "); 3199 + btv->c.nr, is_lr90 ? "yes" : "no ", 3200 + has_tda9820_tda9821 ? "yes" : "no ", 3201 + is_capture_only ? "yes" : "no "); 3207 3202 3208 - if (tuner != UNSET) /* only set if known tuner autodetected, else let insmod option through */ 3209 - btv->tuner_type = tuner; 3203 + if (tuner_type != UNSET) /* only set if known tuner autodetected, else let insmod option through */ 3204 + btv->tuner_type = tuner_type; 3210 3205 btv->has_radio = has_radio; 3211 3206 3212 3207 /* LR90 Audio Routing is done by 2 hef4052, so Audio_Mask has 4 bits: 0x001c80 3213 3208 * LR26/LR50 only has 1 hef4052, Audio_Mask 0x000c00 3214 3209 * Audio options: from tuner, from tda9821/tda9821(mono,stereo,sap), from tda9874, ext., mute */ 3215 - if(has_tda9820_tda9821) btv->audio_mode_gpio = lt9415_audio; 3210 + if (has_tda9820_tda9821) 3211 + btv->audio_mode_gpio = lt9415_audio; 3216 3212 /* todo: if(has_tda9874) btv->audio_mode_gpio = fv2000s_audio; */ 3217 3213 } 3218 3214 ··· 3972 3962 3973 3963 static void __devinit avermedia_eeprom(struct bttv *btv) 3974 3964 { 3975 - int tuner_make,tuner_tv_fm,tuner_format,tuner=0; 3965 + int tuner_make, tuner_tv_fm, tuner_format, tuner_type = 0; 3976 3966 3977 3967 tuner_make = (eeprom_data[0x41] & 0x7); 3978 3968 tuner_tv_fm = (eeprom_data[0x41] & 0x18) >> 3; ··· 3980 3970 btv->has_remote = (eeprom_data[0x42] & 0x01); 3981 3971 3982 3972 if (tuner_make == 0 || tuner_make == 2) 3983 - if(tuner_format <=0x0a) 3984 - tuner = tuner_0_table[tuner_format]; 3973 + if (tuner_format <= 0x0a) 3974 + tuner_type = tuner_0_table[tuner_format]; 3985 3975 if (tuner_make == 1) 3986 - if(tuner_format <=9) 3987 - tuner = tuner_1_table[tuner_format]; 3976 + if (tuner_format <= 9) 3977 + tuner_type = tuner_1_table[tuner_format]; 3988 3978 3989 3979 if (tuner_make == 4) 3990 - if(tuner_format == 0x09) 3991 - tuner = TUNER_LG_NTSC_NEW_TAPC; /* TAPC-G702P */ 3980 + if (tuner_format == 0x09) 3981 + tuner_type = TUNER_LG_NTSC_NEW_TAPC; /* TAPC-G702P */ 3992 3982 3993 3983 printk(KERN_INFO "bttv%d: Avermedia eeprom[0x%02x%02x]: tuner=", 3994 - btv->c.nr,eeprom_data[0x41],eeprom_data[0x42]); 3995 - if(tuner) { 3996 - btv->tuner_type=tuner; 3997 - printk("%d",tuner); 3984 + btv->c.nr, eeprom_data[0x41], eeprom_data[0x42]); 3985 + if (tuner_type) { 3986 + btv->tuner_type = tuner_type; 3987 + printk(KERN_CONT "%d", tuner_type); 3998 3988 } else 3999 - printk("Unknown type"); 4000 - printk(" radio:%s remote control:%s\n", 3989 + printk(KERN_CONT "Unknown type"); 3990 + printk(KERN_CONT " radio:%s remote control:%s\n", 4001 3991 tuner_tv_fm ? "yes" : "no", 4002 3992 btv->has_remote ? "yes" : "no"); 4003 3993 }
-1
drivers/media/video/bt8xx/bttv-driver.c
··· 96 96 static unsigned int uv_ratio = 50; 97 97 static unsigned int full_luma_range; 98 98 static unsigned int coring; 99 - extern int no_overlay; 100 99 101 100 /* API features (turn on/off stuff for testing) */ 102 101 static unsigned int v4l2 = 1;
+2 -1
drivers/media/video/bt8xx/bttv-risc.c
··· 244 244 const struct bttv_format *fmt, struct bttv_overlay *ov, 245 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 249 struct btcx_skiplist *skips; 249 250 __le32 *rp; 250 251 u32 ri,ra;
+5
drivers/media/video/bt8xx/bttvp.h
··· 267 267 int bttv_sub_del_devices(struct bttv_core *core); 268 268 269 269 /* ---------------------------------------------------------- */ 270 + /* bttv-cards.c */ 271 + 272 + extern int no_overlay; 273 + 274 + /* ---------------------------------------------------------- */ 270 275 /* bttv-driver.c */ 271 276 272 277 /* insmod options */
+2 -2
drivers/media/video/btcx-risc.c
··· 184 184 } 185 185 186 186 void 187 - btcx_calc_skips(int line, int width, unsigned int *maxy, 187 + btcx_calc_skips(int line, int width, int *maxy, 188 188 struct btcx_skiplist *skips, unsigned int *nskips, 189 189 const struct v4l2_clip *clips, unsigned int nclips) 190 190 { 191 191 unsigned int clip,skip; 192 - int end,maxline; 192 + int end, maxline; 193 193 194 194 skip=0; 195 195 maxline = 9999;
+1 -1
drivers/media/video/btcx-risc.h
··· 23 23 int btcx_align(struct v4l2_rect *win, struct v4l2_clip *clips, 24 24 unsigned int n, int mask); 25 25 void btcx_sort_clips(struct v4l2_clip *clips, unsigned int nclips); 26 - void btcx_calc_skips(int line, int width, unsigned int *maxy, 26 + void btcx_calc_skips(int line, int width, int *maxy, 27 27 struct btcx_skiplist *skips, unsigned int *nskips, 28 28 const struct v4l2_clip *clips, unsigned int nclips); 29 29
-1
drivers/media/video/cpia2/cpia2_v4l.c
··· 1024 1024 if(cam->params.pnp_id.device_type == DEVICE_STV_672 && 1025 1025 cam->params.version.sensor_flags==CPIA2_VP_SENSOR_FLAGS_500){ 1026 1026 // Maximum 15fps 1027 - int i; 1028 1027 for(i=0; i<c->maximum; ++i) { 1029 1028 if(framerate_controls[i].value == 1030 1029 CPIA2_VP_FRAMERATE_15) {
+8 -8
drivers/media/video/cx18/cx18-av-firmware.c
··· 32 32 u32 v; 33 33 const u8 *ptr; 34 34 int i; 35 - int retries = 0; 35 + int retries1 = 0; 36 36 37 37 if (request_firmware(&fw, FWFILE, &cx->dev->dev) != 0) { 38 38 CX18_ERR("unable to open firmware %s\n", FWFILE); ··· 41 41 42 42 /* The firmware load often has byte errors, so allow for several 43 43 retries, both at byte level and at the firmware load level. */ 44 - while (retries < 5) { 44 + while (retries1 < 5) { 45 45 cx18_av_write4(cx, CXADEC_CHIP_CTRL, 0x00010000); 46 46 cx18_av_write(cx, CXADEC_STD_DET_CTL, 0xf6); 47 47 ··· 57 57 for (i = 0; i < size; i++) { 58 58 u32 dl_control = 0x0F000000 | i | ((u32)ptr[i] << 16); 59 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 63 cx18_av_write4(cx, CXADEC_DL_CTL, dl_control); 64 64 udelay(10); 65 65 value = cx18_av_read4(cx, CXADEC_DL_CTL); ··· 69 69 the address. We can only write the lower 70 70 address byte of the address. */ 71 71 if ((value & 0x3F00) != (dl_control & 0x3F00)) { 72 - retries = 5; 72 + retries2 = 5; 73 73 break; 74 74 } 75 75 } 76 - if (retries >= 5) 76 + if (retries2 >= 5) 77 77 break; 78 78 } 79 79 if (i == size) 80 80 break; 81 - retries++; 81 + retries1++; 82 82 } 83 - if (retries >= 5) { 83 + if (retries1 >= 5) { 84 84 CX18_ERR("unable to load firmware %s\n", FWFILE); 85 85 release_firmware(fw); 86 86 return -EIO;
+3 -3
drivers/media/video/cx18/cx18-driver.c
··· 74 74 -1, -1, -1, -1, -1, -1, -1, -1, 75 75 -1, -1, -1, -1, -1, -1, -1, -1 }; 76 76 77 - static int cardtype_c = 1; 78 - static int tuner_c = 1; 79 - static int radio_c = 1; 77 + static unsigned cardtype_c = 1; 78 + static unsigned tuner_c = 1; 79 + static unsigned radio_c = 1; 80 80 static char pal[] = "--"; 81 81 static char secam[] = "--"; 82 82 static char ntsc[] = "-";
+4 -4
drivers/media/video/cx18/cx18-queue.c
··· 217 217 s->name, s->buffers, s->buf_size, 218 218 s->buffers * s->buf_size / 1024); 219 219 220 - if (((char *)&cx->scb->cpu_mdl[cx->mdl_offset + s->buffers] - 221 - (char *)cx->scb) > SCB_RESERVED_SIZE) { 222 - unsigned bufsz = (((char *)cx->scb) + SCB_RESERVED_SIZE - 223 - ((char *)cx->scb->cpu_mdl)); 220 + if (((char __iomem *)&cx->scb->cpu_mdl[cx->mdl_offset + s->buffers] - 221 + (char __iomem *)cx->scb) > SCB_RESERVED_SIZE) { 222 + unsigned bufsz = (((char __iomem *)cx->scb) + SCB_RESERVED_SIZE - 223 + ((char __iomem *)cx->scb->cpu_mdl)); 224 224 225 225 CX18_ERR("Too many buffers, cannot fit in SCB area\n"); 226 226 CX18_ERR("Max buffers = %zd\n",
+1 -1
drivers/media/video/gspca/gspca.c
··· 1401 1401 i = ret; /* frame index */ 1402 1402 frame = &gspca_dev->frame[i]; 1403 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 1405 frame->data, 1406 1406 frame->v4l2_buf.bytesused)) { 1407 1407 PDEBUG(D_ERR|D_STREAM,
+16 -15
drivers/media/video/ks0127.c
··· 679 679 680 680 case DECODER_ENABLE_OUTPUT: 681 681 { 682 + int enable; 682 683 683 - int *iarg = arg; 684 - int enable = (*iarg != 0); 685 - if (enable) { 686 - dprintk("ks0127: command " 684 + iarg = arg; 685 + enable = (*iarg != 0); 686 + if (enable) { 687 + dprintk("ks0127: command " 687 688 "DECODER_ENABLE_OUTPUT on " 688 689 "(%d)\n", enable); 689 - /* All output pins on */ 690 - ks0127_and_or(ks, KS_OFMTA, 0xcf, 0x30); 691 - /* Obey the OEN pin */ 692 - ks0127_and_or(ks, KS_CDEM, 0x7f, 0x00); 693 - } else { 694 - dprintk("ks0127: command " 690 + /* All output pins on */ 691 + ks0127_and_or(ks, KS_OFMTA, 0xcf, 0x30); 692 + /* Obey the OEN pin */ 693 + ks0127_and_or(ks, KS_CDEM, 0x7f, 0x00); 694 + } else { 695 + dprintk("ks0127: command " 695 696 "DECODER_ENABLE_OUTPUT off " 696 697 "(%d)\n", enable); 697 - /* Video output pins off */ 698 - ks0127_and_or(ks, KS_OFMTA, 0xcf, 0x00); 699 - /* Ignore the OEN pin */ 700 - ks0127_and_or(ks, KS_CDEM, 0x7f, 0x80); 701 - } 698 + /* Video output pins off */ 699 + ks0127_and_or(ks, KS_OFMTA, 0xcf, 0x00); 700 + /* Ignore the OEN pin */ 701 + ks0127_and_or(ks, KS_CDEM, 0x7f, 0x80); 702 + } 702 703 } 703 704 break; 704 705
+7 -5
drivers/media/video/mxb.c
··· 931 931 return 0; 932 932 } 933 933 934 - static int std_callback(struct saa7146_dev* dev, struct saa7146_standard *std) 934 + static 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 937 int zero = 0; 938 938 int one = 1; 939 939 940 - if(V4L2_STD_PAL_I == std->id ) { 940 + if (V4L2_STD_PAL_I == standard->id) { 941 941 v4l2_std_id std = V4L2_STD_PAL_I; 942 + 942 943 DEB_D(("VIDIOC_S_STD: setting mxb for PAL_I.\n")); 943 944 /* set the 7146 gpio register -- I don't know what this does exactly */ 944 945 saa7146_write(dev, GPIO_CTRL, 0x00404050); 945 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 948 mxb->tuner->driver->command(mxb->tuner, VIDIOC_S_STD, &std); 948 949 } else { 949 950 v4l2_std_id std = V4L2_STD_PAL_BG; 951 + 950 952 DEB_D(("VIDIOC_S_STD: setting mxb for PAL/NTSC/SECAM.\n")); 951 953 /* set the 7146 gpio register -- I don't know what this does exactly */ 952 954 saa7146_write(dev, GPIO_CTRL, 0x00404050); 953 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 957 mxb->tuner->driver->command(mxb->tuner, VIDIOC_S_STD, &std); 956 958 } 957 959 return 0;
+7 -7
drivers/media/video/ov511.c
··· 626 626 break; 627 627 628 628 /* Retry until idle */ 629 - do 629 + do { 630 630 rc = reg_r(ov, R511_I2C_CTL); 631 - while (rc > 0 && ((rc&1) == 0)); 631 + } while (rc > 0 && ((rc&1) == 0)); 632 632 if (rc < 0) 633 633 break; 634 634 ··· 703 703 return rc; 704 704 705 705 /* Retry until idle */ 706 - do 707 - rc = reg_r(ov, R511_I2C_CTL); 708 - while (rc > 0 && ((rc&1) == 0)); 706 + do { 707 + rc = reg_r(ov, R511_I2C_CTL); 708 + } while (rc > 0 && ((rc & 1) == 0)); 709 709 if (rc < 0) 710 710 return rc; 711 711 ··· 729 729 return rc; 730 730 731 731 /* Retry until idle */ 732 - do 732 + do { 733 733 rc = reg_r(ov, R511_I2C_CTL); 734 - while (rc > 0 && ((rc&1) == 0)); 734 + } while (rc > 0 && ((rc&1) == 0)); 735 735 if (rc < 0) 736 736 return rc; 737 737
+8 -8
drivers/media/video/pwc/pwc-ctrl.c
··· 1635 1635 1636 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; 1641 - ARGR(cmd).release = pdev->release; 1642 - ARGR(cmd).command_len = pdev->cmd_len; 1643 - memcpy(&ARGR(cmd).command_buf, pdev->cmd_buf, pdev->cmd_len); 1644 - ARGR(cmd).bandlength = pdev->vbandlength; 1645 - ARGR(cmd).frame_size = pdev->frame_size; 1646 - ARG_OUT(cmd) 1640 + ARGR(vcmd).type = pdev->type; 1641 + ARGR(vcmd).release = pdev->release; 1642 + ARGR(vcmd).command_len = pdev->cmd_len; 1643 + memcpy(&ARGR(vcmd).command_buf, pdev->cmd_buf, pdev->cmd_len); 1644 + ARGR(vcmd).bandlength = pdev->vbandlength; 1645 + ARGR(vcmd).frame_size = pdev->frame_size; 1646 + ARG_OUT(vcmd) 1647 1647 break; 1648 1648 } 1649 1649 /*
+3 -3
drivers/media/video/usbvideo/ibmcam.c
··· 736 736 * make black color and quit the horizontal scanning loop. 737 737 */ 738 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 740 #if USES_IBMCAM_PUTPIXEL 741 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 743 #endif 744 - memset(f, 0, v4l_linesize - j); 744 + memset(f, 0, v4l_linesize - offset); 745 745 break; 746 746 } 747 747