diff options
author | Jean-Francois Moine <moinejf@free.fr> | 2008-07-05 08:12:47 +0200 |
---|---|---|
committer | Jean-Francois Moine <moinejf@free.fr> | 2008-07-05 08:12:47 +0200 |
commit | 1c5843c93764a8fed88587b07e419db1554cb4aa (patch) | |
tree | 4272afbc9306d36ae8f667ba8cd464a4bbe63816 /linux/drivers/media/video/gspca/gspca.c | |
parent | b400c13b300245d494a2b427cd4d7153b84a76ce (diff) | |
download | mediapointer-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/gspca.c')
-rw-r--r-- | linux/drivers/media/video/gspca/gspca.c | 17 |
1 files changed, 9 insertions, 8 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; |