summaryrefslogtreecommitdiff
path: root/linux/drivers/media/video/gspca
diff options
context:
space:
mode:
authorJean-Francois Moine <moinejf@free.fr>2008-07-05 08:12:47 +0200
committerJean-Francois Moine <moinejf@free.fr>2008-07-05 08:12:47 +0200
commit1c5843c93764a8fed88587b07e419db1554cb4aa (patch)
tree4272afbc9306d36ae8f667ba8cd464a4bbe63816 /linux/drivers/media/video/gspca
parentb400c13b300245d494a2b427cd4d7153b84a76ce (diff)
downloadmediapointer-dvb-s2-1c5843c93764a8fed88587b07e419db1554cb4aa.tar.gz
mediapointer-dvb-s2-1c5843c93764a8fed88587b07e419db1554cb4aa.tar.bz2
gspca: Compile warnings about NULL ptr.
From: Harvey Harrison <harvey.harrison@gmail.com> Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com> Signed-off-by: Jean-Francois Moine <moinejf@free.fr>
Diffstat (limited to 'linux/drivers/media/video/gspca')
-rw-r--r--linux/drivers/media/video/gspca/gspca.c17
-rw-r--r--linux/drivers/media/video/gspca/t613.c36
-rw-r--r--linux/drivers/media/video/gspca/zc3xx.c30
3 files changed, 42 insertions, 41 deletions
diff --git a/linux/drivers/media/video/gspca/gspca.c b/linux/drivers/media/video/gspca/gspca.c
index 22161dde4..a12d5b377 100644
--- a/linux/drivers/media/video/gspca/gspca.c
+++ b/linux/drivers/media/video/gspca/gspca.c
@@ -340,7 +340,7 @@ static void *rvmalloc(unsigned long size)
/* size = PAGE_ALIGN(size); (already done) */
mem = vmalloc_32(size);
- if (mem != 0) {
+ if (mem != NULL) {
memset(mem, 0, size);
adr = (unsigned long) mem;
while ((long) size > 0) {
@@ -470,7 +470,7 @@ static void frame_free(struct gspca_dev *gspca_dev)
int i;
PDEBUG(D_STREAM, "frame free");
- if (gspca_dev->frbuf != 0) {
+ if (gspca_dev->frbuf != NULL) {
rvfree(gspca_dev->frbuf,
gspca_dev->nframes * gspca_dev->frsz);
gspca_dev->frbuf = NULL;
@@ -493,7 +493,7 @@ static void destroy_urbs(struct gspca_dev *gspca_dev)
gspca_dev->urb[i] = NULL;
usb_kill_urb(urb);
- if (urb->transfer_buffer != 0)
+ if (urb->transfer_buffer != NULL)
usb_buffer_free(gspca_dev->dev,
urb->transfer_buffer_length,
urb->transfer_buffer,
@@ -997,7 +997,7 @@ static int dev_close(struct inode *inode, struct file *file)
gspca_dev->sd_desc->close(gspca_dev);
mutex_unlock(&gspca_dev->usb_lock);
frame_free(gspca_dev);
- gspca_dev->capt_file = 0;
+ gspca_dev->capt_file = NULL;
gspca_dev->memory = GSPCA_MEMORY_NO;
}
file->private_data = NULL;
@@ -1171,7 +1171,7 @@ static int vidioc_reqbufs(struct file *file, void *priv,
}
/* only one file may do capture */
- if ((gspca_dev->capt_file != 0 && gspca_dev->capt_file != file)
+ if ((gspca_dev->capt_file != NULL && gspca_dev->capt_file != file)
|| gspca_dev->streaming) {
ret = -EBUSY;
goto out;
@@ -1179,7 +1179,7 @@ static int vidioc_reqbufs(struct file *file, void *priv,
if (rb->count == 0) { /* unrequest? */
frame_free(gspca_dev);
- gspca_dev->capt_file = 0;
+ gspca_dev->capt_file = NULL;
} else {
gspca_dev->memory = rb->memory;
ret = frame_alloc(gspca_dev, rb->count);
@@ -1388,7 +1388,7 @@ static int vidiocgmbuf(struct file *file, void *priv,
static int dev_mmap(struct file *file, struct vm_area_struct *vma)
{
struct gspca_dev *gspca_dev = file->private_data;
- struct gspca_frame *frame = 0;
+ struct gspca_frame *frame;
struct page *page;
unsigned long addr, start, size;
int i, ret;
@@ -1411,6 +1411,7 @@ static int dev_mmap(struct file *file, struct vm_area_struct *vma)
goto out;
}
+ frame = NULL;
for (i = 0; i < gspca_dev->nframes; ++i) {
if (gspca_dev->frame[i].v4l2_buf.memory != V4L2_MEMORY_MMAP) {
PDEBUG(D_STREAM, "mmap bad memory type");
@@ -1422,7 +1423,7 @@ static int dev_mmap(struct file *file, struct vm_area_struct *vma)
break;
}
}
- if (frame == 0) {
+ if (frame == NULL) {
PDEBUG(D_STREAM, "mmap no frame buffer found");
ret = -EINVAL;
goto out;
diff --git a/linux/drivers/media/video/gspca/t613.c b/linux/drivers/media/video/gspca/t613.c
index 40b3f67b4..b19b07af3 100644
--- a/linux/drivers/media/video/gspca/t613.c
+++ b/linux/drivers/media/video/gspca/t613.c
@@ -528,31 +528,31 @@ static int init_default_parameters(struct gspca_dev *gspca_dev)
t16RegWrite(dev, 0x01, 0x0000, n3, 0x06);
t16RegWrite(dev, 0x01, 0x0000, n4, 0x46);
t16RegRead(dev, 0x0080, &test_byte, 1);
- t16RegWrite(dev, 0x00, 0x2c80, NULL, 0x0);
+ t16RegWrite(dev, 0x00, 0x2c80, NULL, 0);
t16RegWrite(dev, 0x01, 0x0000, nset2, 0x14);
t16RegWrite(dev, 0x01, 0x0000, nset3, 0x12);
t16RegWrite(dev, 0x01, 0x0000, nset4, 0x12);
- t16RegWrite(dev, 0x00, 0x3880, NULL, 0x0);
- t16RegWrite(dev, 0x00, 0x3880, NULL, 0x0);
- t16RegWrite(dev, 0x00, 0x338e, NULL, 0x0);
+ t16RegWrite(dev, 0x00, 0x3880, NULL, 0);
+ t16RegWrite(dev, 0x00, 0x3880, NULL, 0);
+ t16RegWrite(dev, 0x00, 0x338e, NULL, 0);
t16RegWrite(dev, 0x01, 0x0000, nset5, 0x04);
- t16RegWrite(dev, 0x00, 0x00a9, NULL, 0x0);
+ t16RegWrite(dev, 0x00, 0x00a9, NULL, 0);
t16RegWrite(dev, 0x01, 0x0000, nset6, 0x22);
- t16RegWrite(dev, 0x00, 0x86bb, NULL, 0x0);
- t16RegWrite(dev, 0x00, 0x4aa6, NULL, 0x0);
+ t16RegWrite(dev, 0x00, 0x86bb, NULL, 0);
+ t16RegWrite(dev, 0x00, 0x4aa6, NULL, 0);
t16RegWrite(dev, 0x01, 0x0000, missing, 0x08);
- t16RegWrite(dev, 0x00, 0x2087, NULL, 0x0);
- t16RegWrite(dev, 0x00, 0x2088, NULL, 0x0);
- t16RegWrite(dev, 0x00, 0x2089, NULL, 0x0);
+ t16RegWrite(dev, 0x00, 0x2087, NULL, 0);
+ t16RegWrite(dev, 0x00, 0x2088, NULL, 0);
+ t16RegWrite(dev, 0x00, 0x2089, NULL, 0);
t16RegWrite(dev, 0x01, 0x0000, nset7, 0x04);
t16RegWrite(dev, 0x01, 0x0000, nset10, 0x06);
t16RegWrite(dev, 0x01, 0x0000, nset8, 0x06);
t16RegWrite(dev, 0x01, 0x0000, nset9, 0x04);
- t16RegWrite(dev, 0x00, 0x2880, NULL, 0x00);
+ t16RegWrite(dev, 0x00, 0x2880, NULL, 0);
t16RegWrite(dev, 0x01, 0x0000, nset2, 0x14);
t16RegWrite(dev, 0x01, 0x0000, nset3, 0x12);
t16RegWrite(dev, 0x01, 0x0000, nset4, 0x12);
@@ -605,9 +605,9 @@ static void seteffect(struct gspca_dev *gspca_dev)
}
if (sd->effect == 1 || sd->effect == 4)
- t16RegWrite(dev, 0x00, 0x4aa6, NULL, 0x00);
+ t16RegWrite(dev, 0x00, 0x4aa6, NULL, 0);
else
- t16RegWrite(dev, 0x00, 0xfaa6, NULL, 0x00);
+ t16RegWrite(dev, 0x00, 0xfaa6, NULL, 0);
}
static void setwhitebalance(struct gspca_dev *gspca_dev)
@@ -681,7 +681,7 @@ static void setsharpness(struct gspca_dev *gspca_dev)
reg_to_write = 0x0aa6 + 0x1000 * sd->sharpness;
- t16RegWrite(dev, 0x00, reg_to_write, NULL, 0x00);
+ t16RegWrite(dev, 0x00, reg_to_write, NULL, 0);
}
static int sd_setbrightness(struct gspca_dev *gspca_dev, __s32 val)
@@ -902,16 +902,16 @@ static void sd_start(struct gspca_dev *gspca_dev)
t16RegWrite(dev, 0x01, 0x0000, tas5130a_sensor_init[1], 0x8);
t16RegWrite(dev, 0x01, 0x0000, tas5130a_sensor_init[2], 0x8);
t16RegWrite(dev, 0x01, 0x0000, tas5130a_sensor_init[3], 0x8);
- t16RegWrite(dev, 0x00, 0x3c80, NULL, 0x00);
+ t16RegWrite(dev, 0x00, 0x3c80, NULL, 0);
/* just in case and to keep sync with logs (for mine) */
t16RegWrite(dev, 0x01, 0x0000, tas5130a_sensor_init[3], 0x8);
- t16RegWrite(dev, 0x00, 0x3c80, NULL, 0x00);
+ t16RegWrite(dev, 0x00, 0x3c80, NULL, 0);
/* just in case and to keep sync with logs (for mine) */
t16RegWrite(dev, 0x01, 0x0000, t1, 4);
t16RegWrite(dev, 0x01, 0x0000, t2, 6);
- t16RegRead(dev, 0x0012, &test_byte, 0x1);
+ t16RegRead(dev, 0x0012, &test_byte, 0x01);
t16RegWrite(dev, 0x01, 0x0000, t3, 0x10);
- t16RegWrite(dev, 0x00, 0x0013, NULL, 0x00);
+ t16RegWrite(dev, 0x00, 0x0013, NULL, 0);
t16RegWrite(dev, 0x01, 0x0000, t4, 0x4);
/* restart on each start, just in case, sometimes regs goes wrong
* when using controls from app */
diff --git a/linux/drivers/media/video/gspca/zc3xx.c b/linux/drivers/media/video/gspca/zc3xx.c
index 39358a3f6..6c1a0af9f 100644
--- a/linux/drivers/media/video/gspca/zc3xx.c
+++ b/linux/drivers/media/video/gspca/zc3xx.c
@@ -6429,11 +6429,11 @@ static void setcontrast(struct gspca_dev *gspca_dev)
{0x18, 0x20, 0x20, 0x1c, 0x16, 0x13, 0x10, 0x0e,
0x0b, 0x09, 0x07, 0x00, 0x00, 0x00, 0x00, 0x01};
static const __u8 *gamma_tb[] = {
- 0, Tgamma_1, Tgamma_2,
+ NULL, Tgamma_1, Tgamma_2,
Tgamma_3, Tgamma_4, Tgamma_5, Tgamma_6
};
static const __u8 *gradient_tb[] = {
- 0, Tgradient_1, Tgradient_2,
+ NULL, Tgradient_1, Tgradient_2,
Tgradient_3, Tgradient_4, Tgradient_5, Tgradient_6
};
#ifdef CONFIG_VIDEO_ADV_DEBUG
@@ -6548,21 +6548,21 @@ static int setlightfreq(struct gspca_dev *gspca_dev)
gc0305_50HZ, gc0305_50HZ,
gc0305_60HZ, gc0305_60HZ},
/* SENSOR_HDCS2020 3 */
- {0, 0,
- 0, 0,
- 0, 0},
+ {NULL, NULL,
+ NULL, NULL,
+ NULL, NULL},
/* SENSOR_HDCS2020b 4 */
{hdcs2020b_NoFliker, hdcs2020b_NoFliker,
hdcs2020b_50HZ, hdcs2020b_50HZ,
hdcs2020b_60HZ, hdcs2020b_60HZ},
/* SENSOR_HV7131B 5 */
- {0, 0,
- 0, 0,
- 0, 0},
+ {NULL, NULL,
+ NULL, NULL,
+ NULL, NULL},
/* SENSOR_HV7131C 6 */
- {0, 0,
- 0, 0,
- 0, 0},
+ {NULL, NULL,
+ NULL, NULL,
+ NULL, NULL},
/* SENSOR_ICM105A 7 */
{icm105a_NoFliker, icm105a_NoFlikerScale,
icm105a_50HZ, icm105a_50HZScale,
@@ -6576,9 +6576,9 @@ static int setlightfreq(struct gspca_dev *gspca_dev)
OV7620_50HZ, OV7620_50HZ,
OV7620_60HZ, OV7620_60HZ},
/* SENSOR_OV7630C 10 */
- {0, 0,
- 0, 0,
- 0, 0},
+ {NULL, NULL,
+ NULL, NULL,
+ NULL, NULL},
/* SENSOR_PAS106 11 */
{pas106b_NoFliker, pas106b_NoFliker,
pas106b_50HZ, pas106b_50HZ,
@@ -6610,7 +6610,7 @@ static int setlightfreq(struct gspca_dev *gspca_dev)
if (!mode)
i++; /* 640x480 */
zc3_freq = freq_tb[(int) sd->sensor][i];
- if (zc3_freq != 0) {
+ if (zc3_freq != NULL) {
usb_exchange(gspca_dev->dev, zc3_freq);
switch (sd->sensor) {
case SENSOR_GC0305: