diff options
author | Jean-Francois Moine <moinejf@free.fr> | 2009-12-12 04:58:01 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2009-12-15 21:18:49 -0500 |
commit | 83955556669f69fccfd332b52e9b1796d60c77bd (patch) | |
tree | 29b94e2cb24c5de83523838a7dfaa0fe88cf53b8 /drivers/media | |
parent | 37b372e5ebe187037e01885151a0afb546a38520 (diff) |
V4L/DVB (13626): gspca - many subdrivers: Fix some warnings.
- gl860.c:332:15: warning: cast to restricted __le16
- gl860.c:333:15: warning: cast to restricted __le16
- gl860-mi1320.c:348:5: warning: symbol 'mi1320_camera_settings' was not declared. Should it be static?
- gl860-mi2020.c:772:5: warning: symbol 'mi2020_camera_settings' was not declared. Should it be static?
- m5602_ov9650.c:444:7: warning: symbol 'data' shadows an earlier one
- m5602_core.c:84:5: warning: symbol 'm5602_wait_for_i2c' was not declared. Should it be static?
- m5602_core.c:391:6: warning: symbol 'm5602_disconnect' was not declared. Should it be static?
- m5602_s5k4aa.c:530:23: warning: dubious: x | !y
- m5602_s5k4aa.c:575:23: warning: dubious: x | !y
- gspca.c:1196:13: warning: potentially expensive pointer subtraction
- mr97310a.c:70:5: warning: symbol 'force_sensor_type' was not declared. Should it be static?
- ov519.c:2025:4: warning: do-while statement is not a compound statement
- ov519.c:2063:4: warning: do-while statement is not a compound statement
- ov519.c:2089:4: warning: do-while statement is not a compound statement
- ov519.c:1985:34: warning: incorrect type in assignment (different base types)
- sn9c20x.c:1164:5: warning: symbol 'i2c_r1' was not declared. Should it be static?
- sn9c20x.c:1189:5: warning: symbol 'i2c_r2' was not declared. Should it be static?
- sn9c20x.c:2237:27: warning: right shift by bigger than source value
- sn9c20x.c:2237:27: warning: right shift by bigger than source value
Signed-off-by: Jean-Francois Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media')
-rw-r--r-- | drivers/media/video/gspca/gl860/gl860-mi1320.c | 2 | ||||
-rw-r--r-- | drivers/media/video/gspca/gl860/gl860-mi2020.c | 2 | ||||
-rw-r--r-- | drivers/media/video/gspca/gl860/gl860.c | 10 | ||||
-rw-r--r-- | drivers/media/video/gspca/gspca.c | 6 | ||||
-rw-r--r-- | drivers/media/video/gspca/m5602/m5602_core.c | 4 | ||||
-rw-r--r-- | drivers/media/video/gspca/m5602/m5602_ov9650.c | 2 | ||||
-rw-r--r-- | drivers/media/video/gspca/m5602/m5602_s5k4aa.c | 10 | ||||
-rw-r--r-- | drivers/media/video/gspca/mr97310a.c | 2 | ||||
-rw-r--r-- | drivers/media/video/gspca/ov519.c | 14 | ||||
-rw-r--r-- | drivers/media/video/gspca/sn9c20x.c | 7 |
10 files changed, 33 insertions, 26 deletions
diff --git a/drivers/media/video/gspca/gl860/gl860-mi1320.c b/drivers/media/video/gspca/gl860/gl860-mi1320.c index 1355e526ee84..c276a7debdec 100644 --- a/drivers/media/video/gspca/gl860/gl860-mi1320.c +++ b/drivers/media/video/gspca/gl860/gl860-mi1320.c | |||
@@ -345,7 +345,7 @@ static int mi1320_configure_alt(struct gspca_dev *gspca_dev) | |||
345 | return 0; | 345 | return 0; |
346 | } | 346 | } |
347 | 347 | ||
348 | int mi1320_camera_settings(struct gspca_dev *gspca_dev) | 348 | static int mi1320_camera_settings(struct gspca_dev *gspca_dev) |
349 | { | 349 | { |
350 | struct sd *sd = (struct sd *) gspca_dev; | 350 | struct sd *sd = (struct sd *) gspca_dev; |
351 | 351 | ||
diff --git a/drivers/media/video/gspca/gl860/gl860-mi2020.c b/drivers/media/video/gspca/gl860/gl860-mi2020.c index 80cb3f1b36f7..7c31b4f2abea 100644 --- a/drivers/media/video/gspca/gl860/gl860-mi2020.c +++ b/drivers/media/video/gspca/gl860/gl860-mi2020.c | |||
@@ -769,7 +769,7 @@ static int mi2020_configure_alt(struct gspca_dev *gspca_dev) | |||
769 | return 0; | 769 | return 0; |
770 | } | 770 | } |
771 | 771 | ||
772 | int mi2020_camera_settings(struct gspca_dev *gspca_dev) | 772 | static int mi2020_camera_settings(struct gspca_dev *gspca_dev) |
773 | { | 773 | { |
774 | struct sd *sd = (struct sd *) gspca_dev; | 774 | struct sd *sd = (struct sd *) gspca_dev; |
775 | 775 | ||
diff --git a/drivers/media/video/gspca/gl860/gl860.c b/drivers/media/video/gspca/gl860/gl860.c index bd3c21a37be6..4878c8f66543 100644 --- a/drivers/media/video/gspca/gl860/gl860.c +++ b/drivers/media/video/gspca/gl860/gl860.c | |||
@@ -40,7 +40,7 @@ static void sd_pkt_scan(struct gspca_dev *gspca_dev, | |||
40 | static void sd_callback(struct gspca_dev *gspca_dev); | 40 | static void sd_callback(struct gspca_dev *gspca_dev); |
41 | 41 | ||
42 | static int gl860_guess_sensor(struct gspca_dev *gspca_dev, | 42 | static int gl860_guess_sensor(struct gspca_dev *gspca_dev, |
43 | s32 vendor_id, s32 product_id); | 43 | u16 vendor_id, u16 product_id); |
44 | 44 | ||
45 | /*============================ driver options ==============================*/ | 45 | /*============================ driver options ==============================*/ |
46 | 46 | ||
@@ -326,11 +326,11 @@ static int sd_config(struct gspca_dev *gspca_dev, | |||
326 | { | 326 | { |
327 | struct sd *sd = (struct sd *) gspca_dev; | 327 | struct sd *sd = (struct sd *) gspca_dev; |
328 | struct cam *cam; | 328 | struct cam *cam; |
329 | s32 vendor_id, product_id; | 329 | u16 vendor_id, product_id; |
330 | 330 | ||
331 | /* Get USB VendorID and ProductID */ | 331 | /* Get USB VendorID and ProductID */ |
332 | vendor_id = le16_to_cpu(id->idVendor); | 332 | vendor_id = id->idVendor; |
333 | product_id = le16_to_cpu(id->idProduct); | 333 | product_id = id->idProduct; |
334 | 334 | ||
335 | sd->nbRightUp = 1; | 335 | sd->nbRightUp = 1; |
336 | sd->nbIm = -1; | 336 | sd->nbIm = -1; |
@@ -673,7 +673,7 @@ void fetch_idxdata(struct gspca_dev *gspca_dev, struct idxdata *tbl, int len) | |||
673 | } | 673 | } |
674 | 674 | ||
675 | static int gl860_guess_sensor(struct gspca_dev *gspca_dev, | 675 | static int gl860_guess_sensor(struct gspca_dev *gspca_dev, |
676 | s32 vendor_id, s32 product_id) | 676 | u16 vendor_id, u16 product_id) |
677 | { | 677 | { |
678 | struct sd *sd = (struct sd *) gspca_dev; | 678 | struct sd *sd = (struct sd *) gspca_dev; |
679 | u8 probe, nb26, nb96, nOV, ntry; | 679 | u8 probe, nb26, nb96, nOV, ntry; |
diff --git a/drivers/media/video/gspca/gspca.c b/drivers/media/video/gspca/gspca.c index 95a8b84d4cf0..e930a67d526b 100644 --- a/drivers/media/video/gspca/gspca.c +++ b/drivers/media/video/gspca/gspca.c | |||
@@ -1175,12 +1175,14 @@ static int vidioc_queryctrl(struct file *file, void *priv, | |||
1175 | continue; | 1175 | continue; |
1176 | ctrls = &gspca_dev->sd_desc->ctrls[i]; | 1176 | ctrls = &gspca_dev->sd_desc->ctrls[i]; |
1177 | } | 1177 | } |
1178 | if (ctrls == NULL) | ||
1179 | return -EINVAL; | ||
1178 | } else { | 1180 | } else { |
1179 | ctrls = get_ctrl(gspca_dev, id); | 1181 | ctrls = get_ctrl(gspca_dev, id); |
1182 | if (ctrls == NULL) | ||
1183 | return -EINVAL; | ||
1180 | i = ctrls - gspca_dev->sd_desc->ctrls; | 1184 | i = ctrls - gspca_dev->sd_desc->ctrls; |
1181 | } | 1185 | } |
1182 | if (ctrls == NULL) | ||
1183 | return -EINVAL; | ||
1184 | memcpy(q_ctrl, ctrls, sizeof *q_ctrl); | 1186 | memcpy(q_ctrl, ctrls, sizeof *q_ctrl); |
1185 | if (gspca_dev->ctrl_inac & (1 << i)) | 1187 | if (gspca_dev->ctrl_inac & (1 << i)) |
1186 | q_ctrl->flags |= V4L2_CTRL_FLAG_INACTIVE; | 1188 | q_ctrl->flags |= V4L2_CTRL_FLAG_INACTIVE; |
diff --git a/drivers/media/video/gspca/m5602/m5602_core.c b/drivers/media/video/gspca/m5602/m5602_core.c index 844fc1d886d1..4294c75e3b11 100644 --- a/drivers/media/video/gspca/m5602/m5602_core.c +++ b/drivers/media/video/gspca/m5602/m5602_core.c | |||
@@ -81,7 +81,7 @@ int m5602_write_bridge(struct sd *sd, const u8 address, const u8 i2c_data) | |||
81 | return (err < 0) ? err : 0; | 81 | return (err < 0) ? err : 0; |
82 | } | 82 | } |
83 | 83 | ||
84 | int m5602_wait_for_i2c(struct sd *sd) | 84 | static int m5602_wait_for_i2c(struct sd *sd) |
85 | { | 85 | { |
86 | int err; | 86 | int err; |
87 | u8 data; | 87 | u8 data; |
@@ -388,7 +388,7 @@ static int m5602_probe(struct usb_interface *intf, | |||
388 | THIS_MODULE); | 388 | THIS_MODULE); |
389 | } | 389 | } |
390 | 390 | ||
391 | void m5602_disconnect(struct usb_interface *intf) | 391 | static void m5602_disconnect(struct usb_interface *intf) |
392 | { | 392 | { |
393 | struct gspca_dev *gspca_dev = usb_get_intfdata(intf); | 393 | struct gspca_dev *gspca_dev = usb_get_intfdata(intf); |
394 | struct sd *sd = (struct sd *) gspca_dev; | 394 | struct sd *sd = (struct sd *) gspca_dev; |
diff --git a/drivers/media/video/gspca/m5602/m5602_ov9650.c b/drivers/media/video/gspca/m5602/m5602_ov9650.c index c2739d6605a1..923cdd5f7a6b 100644 --- a/drivers/media/video/gspca/m5602/m5602_ov9650.c +++ b/drivers/media/video/gspca/m5602/m5602_ov9650.c | |||
@@ -439,7 +439,7 @@ int ov9650_start(struct sd *sd) | |||
439 | err = m5602_write_bridge(sd, res_init_ov9650[i][1], | 439 | err = m5602_write_bridge(sd, res_init_ov9650[i][1], |
440 | res_init_ov9650[i][2]); | 440 | res_init_ov9650[i][2]); |
441 | else if (res_init_ov9650[i][0] == SENSOR) { | 441 | else if (res_init_ov9650[i][0] == SENSOR) { |
442 | u8 data = res_init_ov9650[i][2]; | 442 | data = res_init_ov9650[i][2]; |
443 | err = m5602_write_sensor(sd, | 443 | err = m5602_write_sensor(sd, |
444 | res_init_ov9650[i][1], &data, 1); | 444 | res_init_ov9650[i][1], &data, 1); |
445 | } | 445 | } |
diff --git a/drivers/media/video/gspca/m5602/m5602_s5k4aa.c b/drivers/media/video/gspca/m5602/m5602_s5k4aa.c index a27afeb6f39b..aa2f3c7e2cb5 100644 --- a/drivers/media/video/gspca/m5602/m5602_s5k4aa.c +++ b/drivers/media/video/gspca/m5602/m5602_s5k4aa.c | |||
@@ -525,7 +525,10 @@ static int s5k4aa_set_vflip(struct gspca_dev *gspca_dev, __s32 val) | |||
525 | err = m5602_read_sensor(sd, S5K4AA_ROWSTART_LO, &data, 1); | 525 | err = m5602_read_sensor(sd, S5K4AA_ROWSTART_LO, &data, 1); |
526 | if (err < 0) | 526 | if (err < 0) |
527 | return err; | 527 | return err; |
528 | data = (data & 0xfe) | !val; | 528 | if (val) |
529 | data &= 0xfe; | ||
530 | else | ||
531 | data |= 0x01; | ||
529 | err = m5602_write_sensor(sd, S5K4AA_ROWSTART_LO, &data, 1); | 532 | err = m5602_write_sensor(sd, S5K4AA_ROWSTART_LO, &data, 1); |
530 | return err; | 533 | return err; |
531 | } | 534 | } |
@@ -570,7 +573,10 @@ static int s5k4aa_set_hflip(struct gspca_dev *gspca_dev, __s32 val) | |||
570 | err = m5602_read_sensor(sd, S5K4AA_COLSTART_LO, &data, 1); | 573 | err = m5602_read_sensor(sd, S5K4AA_COLSTART_LO, &data, 1); |
571 | if (err < 0) | 574 | if (err < 0) |
572 | return err; | 575 | return err; |
573 | data = (data & 0xfe) | !val; | 576 | if (val) |
577 | data &= 0xfe; | ||
578 | else | ||
579 | data |= 0x01; | ||
574 | err = m5602_write_sensor(sd, S5K4AA_COLSTART_LO, &data, 1); | 580 | err = m5602_write_sensor(sd, S5K4AA_COLSTART_LO, &data, 1); |
575 | return err; | 581 | return err; |
576 | } | 582 | } |
diff --git a/drivers/media/video/gspca/mr97310a.c b/drivers/media/video/gspca/mr97310a.c index 126d968dd9e0..9154870e07d2 100644 --- a/drivers/media/video/gspca/mr97310a.c +++ b/drivers/media/video/gspca/mr97310a.c | |||
@@ -67,7 +67,7 @@ MODULE_DESCRIPTION("GSPCA/Mars-Semi MR97310A USB Camera Driver"); | |||
67 | MODULE_LICENSE("GPL"); | 67 | MODULE_LICENSE("GPL"); |
68 | 68 | ||
69 | /* global parameters */ | 69 | /* global parameters */ |
70 | int force_sensor_type = -1; | 70 | static int force_sensor_type = -1; |
71 | module_param(force_sensor_type, int, 0644); | 71 | module_param(force_sensor_type, int, 0644); |
72 | MODULE_PARM_DESC(force_sensor_type, "Force sensor type (-1 (auto), 0 or 1)"); | 72 | MODULE_PARM_DESC(force_sensor_type, "Force sensor type (-1 (auto), 0 or 1)"); |
73 | 73 | ||
diff --git a/drivers/media/video/gspca/ov519.c b/drivers/media/video/gspca/ov519.c index ad9ec339981d..b4f965731244 100644 --- a/drivers/media/video/gspca/ov519.c +++ b/drivers/media/video/gspca/ov519.c | |||
@@ -1982,7 +1982,7 @@ static int ov518_reg_w32(struct sd *sd, __u16 index, u32 value, int n) | |||
1982 | { | 1982 | { |
1983 | int ret; | 1983 | int ret; |
1984 | 1984 | ||
1985 | *((u32 *)sd->gspca_dev.usb_buf) = __cpu_to_le32(value); | 1985 | *((__le32 *) sd->gspca_dev.usb_buf) = __cpu_to_le32(value); |
1986 | 1986 | ||
1987 | ret = usb_control_msg(sd->gspca_dev.dev, | 1987 | ret = usb_control_msg(sd->gspca_dev.dev, |
1988 | usb_sndctrlpipe(sd->gspca_dev.dev, 0), | 1988 | usb_sndctrlpipe(sd->gspca_dev.dev, 0), |
@@ -2021,9 +2021,9 @@ static int ov511_i2c_w(struct sd *sd, __u8 reg, __u8 value) | |||
2021 | if (rc < 0) | 2021 | if (rc < 0) |
2022 | return rc; | 2022 | return rc; |
2023 | 2023 | ||
2024 | do | 2024 | do { |
2025 | rc = reg_r(sd, R511_I2C_CTL); | 2025 | rc = reg_r(sd, R511_I2C_CTL); |
2026 | while (rc > 0 && ((rc & 1) == 0)); /* Retry until idle */ | 2026 | } while (rc > 0 && ((rc & 1) == 0)); /* Retry until idle */ |
2027 | 2027 | ||
2028 | if (rc < 0) | 2028 | if (rc < 0) |
2029 | return rc; | 2029 | return rc; |
@@ -2055,9 +2055,9 @@ static int ov511_i2c_r(struct sd *sd, __u8 reg) | |||
2055 | if (rc < 0) | 2055 | if (rc < 0) |
2056 | return rc; | 2056 | return rc; |
2057 | 2057 | ||
2058 | do | 2058 | do { |
2059 | rc = reg_r(sd, R511_I2C_CTL); | 2059 | rc = reg_r(sd, R511_I2C_CTL); |
2060 | while (rc > 0 && ((rc & 1) == 0)); /* Retry until idle */ | 2060 | } while (rc > 0 && ((rc & 1) == 0)); /* Retry until idle */ |
2061 | 2061 | ||
2062 | if (rc < 0) | 2062 | if (rc < 0) |
2063 | return rc; | 2063 | return rc; |
@@ -2081,9 +2081,9 @@ static int ov511_i2c_r(struct sd *sd, __u8 reg) | |||
2081 | if (rc < 0) | 2081 | if (rc < 0) |
2082 | return rc; | 2082 | return rc; |
2083 | 2083 | ||
2084 | do | 2084 | do { |
2085 | rc = reg_r(sd, R511_I2C_CTL); | 2085 | rc = reg_r(sd, R511_I2C_CTL); |
2086 | while (rc > 0 && ((rc & 1) == 0)); /* Retry until idle */ | 2086 | } while (rc > 0 && ((rc & 1) == 0)); /* Retry until idle */ |
2087 | 2087 | ||
2088 | if (rc < 0) | 2088 | if (rc < 0) |
2089 | return rc; | 2089 | return rc; |
diff --git a/drivers/media/video/gspca/sn9c20x.c b/drivers/media/video/gspca/sn9c20x.c index a3d8f4675c04..4cff8035614f 100644 --- a/drivers/media/video/gspca/sn9c20x.c +++ b/drivers/media/video/gspca/sn9c20x.c | |||
@@ -1158,7 +1158,7 @@ static int i2c_w2(struct gspca_dev *gspca_dev, u8 reg, u16 val) | |||
1158 | return i2c_w(gspca_dev, row); | 1158 | return i2c_w(gspca_dev, row); |
1159 | } | 1159 | } |
1160 | 1160 | ||
1161 | int i2c_r1(struct gspca_dev *gspca_dev, u8 reg, u8 *val) | 1161 | static int i2c_r1(struct gspca_dev *gspca_dev, u8 reg, u8 *val) |
1162 | { | 1162 | { |
1163 | struct sd *sd = (struct sd *) gspca_dev; | 1163 | struct sd *sd = (struct sd *) gspca_dev; |
1164 | u8 row[8]; | 1164 | u8 row[8]; |
@@ -1183,7 +1183,7 @@ int i2c_r1(struct gspca_dev *gspca_dev, u8 reg, u8 *val) | |||
1183 | return 0; | 1183 | return 0; |
1184 | } | 1184 | } |
1185 | 1185 | ||
1186 | int i2c_r2(struct gspca_dev *gspca_dev, u8 reg, u16 *val) | 1186 | static int i2c_r2(struct gspca_dev *gspca_dev, u8 reg, u16 *val) |
1187 | { | 1187 | { |
1188 | struct sd *sd = (struct sd *) gspca_dev; | 1188 | struct sd *sd = (struct sd *) gspca_dev; |
1189 | u8 row[8]; | 1189 | u8 row[8]; |
@@ -2175,8 +2175,7 @@ static void configure_sensor_output(struct gspca_dev *gspca_dev, int mode) | |||
2175 | } | 2175 | } |
2176 | 2176 | ||
2177 | #define HW_WIN(mode, hstart, vstart) \ | 2177 | #define HW_WIN(mode, hstart, vstart) \ |
2178 | ((const u8 []){hstart & 0xff, hstart >> 8, \ | 2178 | ((const u8 []){hstart, 0, vstart, 0, \ |
2179 | vstart & 0xff, vstart >> 8, \ | ||
2180 | (mode & MODE_SXGA ? 1280 >> 4 : 640 >> 4), \ | 2179 | (mode & MODE_SXGA ? 1280 >> 4 : 640 >> 4), \ |
2181 | (mode & MODE_SXGA ? 1024 >> 3 : 480 >> 3)}) | 2180 | (mode & MODE_SXGA ? 1024 >> 3 : 480 >> 3)}) |
2182 | 2181 | ||