aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video
diff options
context:
space:
mode:
authorHarvey Harrison <harvey.harrison@gmail.com>2008-07-05 05:12:47 -0400
committerMauro Carvalho Chehab <mchehab@infradead.org>2008-07-20 06:17:11 -0400
commitefab8211db79d20032fa7d09b8a3671e68a9c5b9 (patch)
tree34ca0e9e7ab193355ad3fd8229585481a50d226e /drivers/media/video
parent46ccdafa71c1c95de002ce7a31e700cf5c8195df (diff)
V4L/DVB (8199): gspca: Compile warnings about NULL ptr.
Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com> Signed-off-by: Jean-Francois Moine <moinejf@free.fr> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers/media/video')
-rw-r--r--drivers/media/video/gspca/gspca.c17
-rw-r--r--drivers/media/video/gspca/t613.c36
-rw-r--r--drivers/media/video/gspca/zc3xx.c30
3 files changed, 42 insertions, 41 deletions
diff --git a/drivers/media/video/gspca/gspca.c b/drivers/media/video/gspca/gspca.c
index 708270a46e1f..1225c0fe26f0 100644
--- a/drivers/media/video/gspca/gspca.c
+++ b/drivers/media/video/gspca/gspca.c
@@ -334,7 +334,7 @@ static void *rvmalloc(unsigned long size)
334 334
335/* size = PAGE_ALIGN(size); (already done) */ 335/* size = PAGE_ALIGN(size); (already done) */
336 mem = vmalloc_32(size); 336 mem = vmalloc_32(size);
337 if (mem != 0) { 337 if (mem != NULL) {
338 memset(mem, 0, size); 338 memset(mem, 0, size);
339 adr = (unsigned long) mem; 339 adr = (unsigned long) mem;
340 while ((long) size > 0) { 340 while ((long) size > 0) {
@@ -464,7 +464,7 @@ static void frame_free(struct gspca_dev *gspca_dev)
464 int i; 464 int i;
465 465
466 PDEBUG(D_STREAM, "frame free"); 466 PDEBUG(D_STREAM, "frame free");
467 if (gspca_dev->frbuf != 0) { 467 if (gspca_dev->frbuf != NULL) {
468 rvfree(gspca_dev->frbuf, 468 rvfree(gspca_dev->frbuf,
469 gspca_dev->nframes * gspca_dev->frsz); 469 gspca_dev->nframes * gspca_dev->frsz);
470 gspca_dev->frbuf = NULL; 470 gspca_dev->frbuf = NULL;
@@ -487,7 +487,7 @@ static void destroy_urbs(struct gspca_dev *gspca_dev)
487 487
488 gspca_dev->urb[i] = NULL; 488 gspca_dev->urb[i] = NULL;
489 usb_kill_urb(urb); 489 usb_kill_urb(urb);
490 if (urb->transfer_buffer != 0) 490 if (urb->transfer_buffer != NULL)
491 usb_buffer_free(gspca_dev->dev, 491 usb_buffer_free(gspca_dev->dev,
492 urb->transfer_buffer_length, 492 urb->transfer_buffer_length,
493 urb->transfer_buffer, 493 urb->transfer_buffer,
@@ -991,7 +991,7 @@ static int dev_close(struct inode *inode, struct file *file)
991 gspca_dev->sd_desc->close(gspca_dev); 991 gspca_dev->sd_desc->close(gspca_dev);
992 mutex_unlock(&gspca_dev->usb_lock); 992 mutex_unlock(&gspca_dev->usb_lock);
993 frame_free(gspca_dev); 993 frame_free(gspca_dev);
994 gspca_dev->capt_file = 0; 994 gspca_dev->capt_file = NULL;
995 gspca_dev->memory = GSPCA_MEMORY_NO; 995 gspca_dev->memory = GSPCA_MEMORY_NO;
996 } 996 }
997 file->private_data = NULL; 997 file->private_data = NULL;
@@ -1165,7 +1165,7 @@ static int vidioc_reqbufs(struct file *file, void *priv,
1165 } 1165 }
1166 1166
1167 /* only one file may do capture */ 1167 /* only one file may do capture */
1168 if ((gspca_dev->capt_file != 0 && gspca_dev->capt_file != file) 1168 if ((gspca_dev->capt_file != NULL && gspca_dev->capt_file != file)
1169 || gspca_dev->streaming) { 1169 || gspca_dev->streaming) {
1170 ret = -EBUSY; 1170 ret = -EBUSY;
1171 goto out; 1171 goto out;
@@ -1173,7 +1173,7 @@ static int vidioc_reqbufs(struct file *file, void *priv,
1173 1173
1174 if (rb->count == 0) { /* unrequest? */ 1174 if (rb->count == 0) { /* unrequest? */
1175 frame_free(gspca_dev); 1175 frame_free(gspca_dev);
1176 gspca_dev->capt_file = 0; 1176 gspca_dev->capt_file = NULL;
1177 } else { 1177 } else {
1178 gspca_dev->memory = rb->memory; 1178 gspca_dev->memory = rb->memory;
1179 ret = frame_alloc(gspca_dev, rb->count); 1179 ret = frame_alloc(gspca_dev, rb->count);
@@ -1382,7 +1382,7 @@ static int vidiocgmbuf(struct file *file, void *priv,
1382static int dev_mmap(struct file *file, struct vm_area_struct *vma) 1382static int dev_mmap(struct file *file, struct vm_area_struct *vma)
1383{ 1383{
1384 struct gspca_dev *gspca_dev = file->private_data; 1384 struct gspca_dev *gspca_dev = file->private_data;
1385 struct gspca_frame *frame = 0; 1385 struct gspca_frame *frame;
1386 struct page *page; 1386 struct page *page;
1387 unsigned long addr, start, size; 1387 unsigned long addr, start, size;
1388 int i, ret; 1388 int i, ret;
@@ -1405,6 +1405,7 @@ static int dev_mmap(struct file *file, struct vm_area_struct *vma)
1405 goto out; 1405 goto out;
1406 } 1406 }
1407 1407
1408 frame = NULL;
1408 for (i = 0; i < gspca_dev->nframes; ++i) { 1409 for (i = 0; i < gspca_dev->nframes; ++i) {
1409 if (gspca_dev->frame[i].v4l2_buf.memory != V4L2_MEMORY_MMAP) { 1410 if (gspca_dev->frame[i].v4l2_buf.memory != V4L2_MEMORY_MMAP) {
1410 PDEBUG(D_STREAM, "mmap bad memory type"); 1411 PDEBUG(D_STREAM, "mmap bad memory type");
@@ -1416,7 +1417,7 @@ static int dev_mmap(struct file *file, struct vm_area_struct *vma)
1416 break; 1417 break;
1417 } 1418 }
1418 } 1419 }
1419 if (frame == 0) { 1420 if (frame == NULL) {
1420 PDEBUG(D_STREAM, "mmap no frame buffer found"); 1421 PDEBUG(D_STREAM, "mmap no frame buffer found");
1421 ret = -EINVAL; 1422 ret = -EINVAL;
1422 goto out; 1423 goto out;
diff --git a/drivers/media/video/gspca/t613.c b/drivers/media/video/gspca/t613.c
index 4e69a8e16357..96f01d267475 100644
--- a/drivers/media/video/gspca/t613.c
+++ b/drivers/media/video/gspca/t613.c
@@ -504,31 +504,31 @@ static int init_default_parameters(struct gspca_dev *gspca_dev)
504 t16RegWrite(dev, 0x01, 0x0000, n3, 0x06); 504 t16RegWrite(dev, 0x01, 0x0000, n3, 0x06);
505 t16RegWrite(dev, 0x01, 0x0000, n4, 0x46); 505 t16RegWrite(dev, 0x01, 0x0000, n4, 0x46);
506 t16RegRead(dev, 0x0080, &test_byte, 1); 506 t16RegRead(dev, 0x0080, &test_byte, 1);
507 t16RegWrite(dev, 0x00, 0x2c80, NULL, 0x0); 507 t16RegWrite(dev, 0x00, 0x2c80, NULL, 0);
508 t16RegWrite(dev, 0x01, 0x0000, nset2, 0x14); 508 t16RegWrite(dev, 0x01, 0x0000, nset2, 0x14);
509 t16RegWrite(dev, 0x01, 0x0000, nset3, 0x12); 509 t16RegWrite(dev, 0x01, 0x0000, nset3, 0x12);
510 t16RegWrite(dev, 0x01, 0x0000, nset4, 0x12); 510 t16RegWrite(dev, 0x01, 0x0000, nset4, 0x12);
511 t16RegWrite(dev, 0x00, 0x3880, NULL, 0x0); 511 t16RegWrite(dev, 0x00, 0x3880, NULL, 0);
512 t16RegWrite(dev, 0x00, 0x3880, NULL, 0x0); 512 t16RegWrite(dev, 0x00, 0x3880, NULL, 0);
513 t16RegWrite(dev, 0x00, 0x338e, NULL, 0x0); 513 t16RegWrite(dev, 0x00, 0x338e, NULL, 0);
514 t16RegWrite(dev, 0x01, 0x0000, nset5, 0x04); 514 t16RegWrite(dev, 0x01, 0x0000, nset5, 0x04);
515 t16RegWrite(dev, 0x00, 0x00a9, NULL, 0x0); 515 t16RegWrite(dev, 0x00, 0x00a9, NULL, 0);
516 t16RegWrite(dev, 0x01, 0x0000, nset6, 0x22); 516 t16RegWrite(dev, 0x01, 0x0000, nset6, 0x22);
517 t16RegWrite(dev, 0x00, 0x86bb, NULL, 0x0); 517 t16RegWrite(dev, 0x00, 0x86bb, NULL, 0);
518 t16RegWrite(dev, 0x00, 0x4aa6, NULL, 0x0); 518 t16RegWrite(dev, 0x00, 0x4aa6, NULL, 0);
519 519
520 t16RegWrite(dev, 0x01, 0x0000, missing, 0x08); 520 t16RegWrite(dev, 0x01, 0x0000, missing, 0x08);
521 521
522 t16RegWrite(dev, 0x00, 0x2087, NULL, 0x0); 522 t16RegWrite(dev, 0x00, 0x2087, NULL, 0);
523 t16RegWrite(dev, 0x00, 0x2088, NULL, 0x0); 523 t16RegWrite(dev, 0x00, 0x2088, NULL, 0);
524 t16RegWrite(dev, 0x00, 0x2089, NULL, 0x0); 524 t16RegWrite(dev, 0x00, 0x2089, NULL, 0);
525 525
526 t16RegWrite(dev, 0x01, 0x0000, nset7, 0x04); 526 t16RegWrite(dev, 0x01, 0x0000, nset7, 0x04);
527 t16RegWrite(dev, 0x01, 0x0000, nset10, 0x06); 527 t16RegWrite(dev, 0x01, 0x0000, nset10, 0x06);
528 t16RegWrite(dev, 0x01, 0x0000, nset8, 0x06); 528 t16RegWrite(dev, 0x01, 0x0000, nset8, 0x06);
529 t16RegWrite(dev, 0x01, 0x0000, nset9, 0x04); 529 t16RegWrite(dev, 0x01, 0x0000, nset9, 0x04);
530 530
531 t16RegWrite(dev, 0x00, 0x2880, NULL, 0x00); 531 t16RegWrite(dev, 0x00, 0x2880, NULL, 0);
532 t16RegWrite(dev, 0x01, 0x0000, nset2, 0x14); 532 t16RegWrite(dev, 0x01, 0x0000, nset2, 0x14);
533 t16RegWrite(dev, 0x01, 0x0000, nset3, 0x12); 533 t16RegWrite(dev, 0x01, 0x0000, nset3, 0x12);
534 t16RegWrite(dev, 0x01, 0x0000, nset4, 0x12); 534 t16RegWrite(dev, 0x01, 0x0000, nset4, 0x12);
@@ -581,9 +581,9 @@ static void seteffect(struct gspca_dev *gspca_dev)
581 } 581 }
582 582
583 if (sd->effect == 1 || sd->effect == 4) 583 if (sd->effect == 1 || sd->effect == 4)
584 t16RegWrite(dev, 0x00, 0x4aa6, NULL, 0x00); 584 t16RegWrite(dev, 0x00, 0x4aa6, NULL, 0);
585 else 585 else
586 t16RegWrite(dev, 0x00, 0xfaa6, NULL, 0x00); 586 t16RegWrite(dev, 0x00, 0xfaa6, NULL, 0);
587} 587}
588 588
589static void setwhitebalance(struct gspca_dev *gspca_dev) 589static void setwhitebalance(struct gspca_dev *gspca_dev)
@@ -649,7 +649,7 @@ static void setsharpness(struct gspca_dev *gspca_dev)
649 649
650 reg_to_write = 0x0aa6 + 0x1000 * sd->sharpness; 650 reg_to_write = 0x0aa6 + 0x1000 * sd->sharpness;
651 651
652 t16RegWrite(dev, 0x00, reg_to_write, NULL, 0x00); 652 t16RegWrite(dev, 0x00, reg_to_write, NULL, 0);
653} 653}
654 654
655static int sd_setbrightness(struct gspca_dev *gspca_dev, __s32 val) 655static int sd_setbrightness(struct gspca_dev *gspca_dev, __s32 val)
@@ -870,16 +870,16 @@ static void sd_start(struct gspca_dev *gspca_dev)
870 t16RegWrite(dev, 0x01, 0x0000, tas5130a_sensor_init[1], 0x8); 870 t16RegWrite(dev, 0x01, 0x0000, tas5130a_sensor_init[1], 0x8);
871 t16RegWrite(dev, 0x01, 0x0000, tas5130a_sensor_init[2], 0x8); 871 t16RegWrite(dev, 0x01, 0x0000, tas5130a_sensor_init[2], 0x8);
872 t16RegWrite(dev, 0x01, 0x0000, tas5130a_sensor_init[3], 0x8); 872 t16RegWrite(dev, 0x01, 0x0000, tas5130a_sensor_init[3], 0x8);
873 t16RegWrite(dev, 0x00, 0x3c80, NULL, 0x00); 873 t16RegWrite(dev, 0x00, 0x3c80, NULL, 0);
874 /* just in case and to keep sync with logs (for mine) */ 874 /* just in case and to keep sync with logs (for mine) */
875 t16RegWrite(dev, 0x01, 0x0000, tas5130a_sensor_init[3], 0x8); 875 t16RegWrite(dev, 0x01, 0x0000, tas5130a_sensor_init[3], 0x8);
876 t16RegWrite(dev, 0x00, 0x3c80, NULL, 0x00); 876 t16RegWrite(dev, 0x00, 0x3c80, NULL, 0);
877 /* just in case and to keep sync with logs (for mine) */ 877 /* just in case and to keep sync with logs (for mine) */
878 t16RegWrite(dev, 0x01, 0x0000, t1, 4); 878 t16RegWrite(dev, 0x01, 0x0000, t1, 4);
879 t16RegWrite(dev, 0x01, 0x0000, t2, 6); 879 t16RegWrite(dev, 0x01, 0x0000, t2, 6);
880 t16RegRead(dev, 0x0012, &test_byte, 0x1); 880 t16RegRead(dev, 0x0012, &test_byte, 0x01);
881 t16RegWrite(dev, 0x01, 0x0000, t3, 0x10); 881 t16RegWrite(dev, 0x01, 0x0000, t3, 0x10);
882 t16RegWrite(dev, 0x00, 0x0013, NULL, 0x00); 882 t16RegWrite(dev, 0x00, 0x0013, NULL, 0);
883 t16RegWrite(dev, 0x01, 0x0000, t4, 0x4); 883 t16RegWrite(dev, 0x01, 0x0000, t4, 0x4);
884 /* restart on each start, just in case, sometimes regs goes wrong 884 /* restart on each start, just in case, sometimes regs goes wrong
885 * when using controls from app */ 885 * when using controls from app */
diff --git a/drivers/media/video/gspca/zc3xx.c b/drivers/media/video/gspca/zc3xx.c
index 878344e4d2ec..63dd8916d6b6 100644
--- a/drivers/media/video/gspca/zc3xx.c
+++ b/drivers/media/video/gspca/zc3xx.c
@@ -6425,11 +6425,11 @@ static void setcontrast(struct gspca_dev *gspca_dev)
6425 {0x18, 0x20, 0x20, 0x1c, 0x16, 0x13, 0x10, 0x0e, 6425 {0x18, 0x20, 0x20, 0x1c, 0x16, 0x13, 0x10, 0x0e,
6426 0x0b, 0x09, 0x07, 0x00, 0x00, 0x00, 0x00, 0x01}; 6426 0x0b, 0x09, 0x07, 0x00, 0x00, 0x00, 0x00, 0x01};
6427 static const __u8 *gamma_tb[] = { 6427 static const __u8 *gamma_tb[] = {
6428 0, Tgamma_1, Tgamma_2, 6428 NULL, Tgamma_1, Tgamma_2,
6429 Tgamma_3, Tgamma_4, Tgamma_5, Tgamma_6 6429 Tgamma_3, Tgamma_4, Tgamma_5, Tgamma_6
6430 }; 6430 };
6431 static const __u8 *gradient_tb[] = { 6431 static const __u8 *gradient_tb[] = {
6432 0, Tgradient_1, Tgradient_2, 6432 NULL, Tgradient_1, Tgradient_2,
6433 Tgradient_3, Tgradient_4, Tgradient_5, Tgradient_6 6433 Tgradient_3, Tgradient_4, Tgradient_5, Tgradient_6
6434 }; 6434 };
6435#ifdef CONFIG_VIDEO_ADV_DEBUG 6435#ifdef CONFIG_VIDEO_ADV_DEBUG
@@ -6544,21 +6544,21 @@ static int setlightfreq(struct gspca_dev *gspca_dev)
6544 gc0305_50HZ, gc0305_50HZ, 6544 gc0305_50HZ, gc0305_50HZ,
6545 gc0305_60HZ, gc0305_60HZ}, 6545 gc0305_60HZ, gc0305_60HZ},
6546/* SENSOR_HDCS2020 3 */ 6546/* SENSOR_HDCS2020 3 */
6547 {0, 0, 6547 {NULL, NULL,
6548 0, 0, 6548 NULL, NULL,
6549 0, 0}, 6549 NULL, NULL},
6550/* SENSOR_HDCS2020b 4 */ 6550/* SENSOR_HDCS2020b 4 */
6551 {hdcs2020b_NoFliker, hdcs2020b_NoFliker, 6551 {hdcs2020b_NoFliker, hdcs2020b_NoFliker,
6552 hdcs2020b_50HZ, hdcs2020b_50HZ, 6552 hdcs2020b_50HZ, hdcs2020b_50HZ,
6553 hdcs2020b_60HZ, hdcs2020b_60HZ}, 6553 hdcs2020b_60HZ, hdcs2020b_60HZ},
6554/* SENSOR_HV7131B 5 */ 6554/* SENSOR_HV7131B 5 */
6555 {0, 0, 6555 {NULL, NULL,
6556 0, 0, 6556 NULL, NULL,
6557 0, 0}, 6557 NULL, NULL},
6558/* SENSOR_HV7131C 6 */ 6558/* SENSOR_HV7131C 6 */
6559 {0, 0, 6559 {NULL, NULL,
6560 0, 0, 6560 NULL, NULL,
6561 0, 0}, 6561 NULL, NULL},
6562/* SENSOR_ICM105A 7 */ 6562/* SENSOR_ICM105A 7 */
6563 {icm105a_NoFliker, icm105a_NoFlikerScale, 6563 {icm105a_NoFliker, icm105a_NoFlikerScale,
6564 icm105a_50HZ, icm105a_50HZScale, 6564 icm105a_50HZ, icm105a_50HZScale,
@@ -6572,9 +6572,9 @@ static int setlightfreq(struct gspca_dev *gspca_dev)
6572 OV7620_50HZ, OV7620_50HZ, 6572 OV7620_50HZ, OV7620_50HZ,
6573 OV7620_60HZ, OV7620_60HZ}, 6573 OV7620_60HZ, OV7620_60HZ},
6574/* SENSOR_OV7630C 10 */ 6574/* SENSOR_OV7630C 10 */
6575 {0, 0, 6575 {NULL, NULL,
6576 0, 0, 6576 NULL, NULL,
6577 0, 0}, 6577 NULL, NULL},
6578/* SENSOR_PAS106 11 */ 6578/* SENSOR_PAS106 11 */
6579 {pas106b_NoFliker, pas106b_NoFliker, 6579 {pas106b_NoFliker, pas106b_NoFliker,
6580 pas106b_50HZ, pas106b_50HZ, 6580 pas106b_50HZ, pas106b_50HZ,
@@ -6606,7 +6606,7 @@ static int setlightfreq(struct gspca_dev *gspca_dev)
6606 if (!mode) 6606 if (!mode)
6607 i++; /* 640x480 */ 6607 i++; /* 640x480 */
6608 zc3_freq = freq_tb[(int) sd->sensor][i]; 6608 zc3_freq = freq_tb[(int) sd->sensor][i];
6609 if (zc3_freq != 0) { 6609 if (zc3_freq != NULL) {
6610 usb_exchange(gspca_dev->dev, zc3_freq); 6610 usb_exchange(gspca_dev->dev, zc3_freq);
6611 switch (sd->sensor) { 6611 switch (sd->sensor) {
6612 case SENSOR_GC0305: 6612 case SENSOR_GC0305: