media: fix integer as NULL pointer warnings
authorHarvey Harrison <harvey.harrison@gmail.com>
Mon, 28 Apr 2008 23:50:03 +0000 (16:50 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Tue, 29 Apr 2008 00:31:13 +0000 (17:31 -0700)
drivers/media/video/v4l2-common.c:719:16: warning: Using plain integer as NULL pointer
drivers/media/video/au0828/au0828-dvb.c:122:19: warning: Using plain integer as NULL pointer
drivers/media/video/ivtv/ivtv-yuv.c:1101:22: warning: Using plain integer as NULL pointer
drivers/media/video/ivtv/ivtv-yuv.c:1102:23: warning: Using plain integer as NULL pointer
drivers/media/video/pvrusb2/pvrusb2-audio.c:78:39: warning: Using plain integer as NULL pointer
drivers/media/video/pvrusb2/pvrusb2-video-v4l.c:84:39: warning: Using plain integer as NULL pointer
drivers/media/video/pvrusb2/pvrusb2-v4l2.c:1264:9: warning: Using plain integer as NULL pointer
drivers/media/video/pvrusb2/pvrusb2-context.c:197:28: warning: Using plain integer as NULL pointer
drivers/media/video/pvrusb2/pvrusb2-cx2584x-v4l.c:126:39: warning: Using plain integer as NULL pointer
drivers/media/video/pvrusb2/pvrusb2-dvb.c:133:32: warning: Using plain integer as NULL pointer
drivers/media/video/pvrusb2/pvrusb2-dvb.c:145:31: warning: Using plain integer as NULL pointer
drivers/media/video/pvrusb2/pvrusb2-dvb.c:177:55: warning: Using plain integer as NULL pointer
drivers/media/video/videobuf-core.c:100:9: warning: Using plain integer as NULL pointer

Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
drivers/media/video/au0828/au0828-dvb.c
drivers/media/video/ivtv/ivtv-yuv.c
drivers/media/video/pvrusb2/pvrusb2-audio.c
drivers/media/video/pvrusb2/pvrusb2-context.c
drivers/media/video/pvrusb2/pvrusb2-cx2584x-v4l.c
drivers/media/video/pvrusb2/pvrusb2-dvb.c
drivers/media/video/pvrusb2/pvrusb2-v4l2.c
drivers/media/video/pvrusb2/pvrusb2-video-v4l.c
drivers/media/video/v4l2-common.c
drivers/media/video/videobuf-core.c

index 5040d7fc4af56ea14f4307488915a6cac3764498..1371b4e4b5f15230fd8025fb01db690c53e0dccd 100644 (file)
@@ -119,7 +119,7 @@ static int start_urb_transfer(struct au0828_dev *dev)
                purb->transfer_buffer = kzalloc(URB_BUFSIZE, GFP_KERNEL);
                if (!purb->transfer_buffer) {
                        usb_free_urb(purb);
-                       dev->urbs[i] = 0;
+                       dev->urbs[i] = NULL;
                        goto err;
                }
 
index 393d917cd67265367aa0280395bf521b4a57902e..62f70bd5e3cb149f47ec1199ba3381d9574735a9 100644 (file)
@@ -1098,8 +1098,8 @@ void ivtv_yuv_setup_stream_frame(struct ivtv *itv)
        ivtv_yuv_next_free(itv);
 
        /* Copy V4L2 parameters to an ivtv_dma_frame struct... */
-       dma_args.y_source = 0L;
-       dma_args.uv_source = 0L;
+       dma_args.y_source = NULL;
+       dma_args.uv_source = NULL;
        dma_args.src.left = 0;
        dma_args.src.top = 0;
        dma_args.src.width = yi->v4l2_src_w;
index 9a7c8e9c3e8ba3ef33ab19b4f449e64791c43a79..8d859ccd48ecc0b0da9a59d030a988f37528e629 100644 (file)
@@ -75,7 +75,7 @@ static void set_stereo(struct pvr2_msp3400_handler *ctxt)
        pvr2_trace(PVR2_TRACE_CHIPS,"i2c msp3400 v4l2 set_stereo");
 
        if ((sid < ARRAY_SIZE(routing_schemes)) &&
-           ((sp = routing_schemes + sid) != 0) &&
+           ((sp = routing_schemes + sid) != NULL) &&
            (hdw->input_val >= 0) &&
            (hdw->input_val < sp->cnt)) {
                route.input = sp->def[hdw->input_val];
index b5db6a5bab31e94b5338feb1b788ee14b129eb6e..73dcb1c57ae66c8b520558cfc0fb3efe60ded5e0 100644 (file)
@@ -195,7 +195,7 @@ static int pvr2_context_thread_func(void *foo)
 int pvr2_context_global_init(void)
 {
        pvr2_context_thread_ptr = kthread_run(pvr2_context_thread_func,
-                                             0,
+                                             NULL,
                                              "pvrusb2-context");
        return (pvr2_context_thread_ptr ? 0 : -ENOMEM);
 }
index 97350b048b8deeb394fba59265467215f3930b45..29d50597c88a5aeb2cd9ce14daac7fa5c238afa1 100644 (file)
@@ -123,7 +123,7 @@ static void set_input(struct pvr2_v4l_cx2584x *ctxt)
        memset(&route,0,sizeof(route));
 
        if ((sid < ARRAY_SIZE(routing_schemes)) &&
-           ((sp = routing_schemes + sid) != 0) &&
+           ((sp = routing_schemes + sid) != NULL) &&
            (hdw->input_val >= 0) &&
            (hdw->input_val < sp->cnt)) {
                vid_input = sp->def[hdw->input_val].vid;
index 2e64f98d124149404ba76d6f5ab3131e14910662..6504c97e0bbcc299e7a16380144eeb92be5da6d3 100644 (file)
@@ -130,7 +130,7 @@ static void pvr2_dvb_stream_end(struct pvr2_dvb_adapter *adap)
                for (idx = 0; idx < PVR2_DVB_BUFFER_COUNT; idx++) {
                        if (!(adap->buffer_storage[idx])) continue;
                        kfree(adap->buffer_storage[idx]);
-                       adap->buffer_storage[idx] = 0;
+                       adap->buffer_storage[idx] = NULL;
                }
                adap->stream_run = 0;
        }
@@ -142,7 +142,7 @@ static int pvr2_dvb_stream_do_start(struct pvr2_dvb_adapter *adap)
        unsigned int idx;
        int ret;
        struct pvr2_buffer *bp;
-       struct pvr2_stream *stream = 0;
+       struct pvr2_stream *stream = NULL;
 
        if (adap->stream_run) return -EIO;
 
@@ -174,7 +174,7 @@ static int pvr2_dvb_stream_do_start(struct pvr2_dvb_adapter *adap)
        ret = pvr2_hdw_set_streaming(adap->channel.hdw, 1);
        if (ret < 0) return ret;
 
-       while ((bp = pvr2_stream_get_idle_buffer(stream)) != 0) {
+       while ((bp = pvr2_stream_get_idle_buffer(stream)) != NULL) {
                ret = pvr2_buffer_queue(bp);
                if (ret < 0) return ret;
        }
index 087a18245560f467fb059590a91531c4840a4d0d..e9b5d4e913277ebc25348c8f2c71edd231df5fb3 100644 (file)
@@ -1261,7 +1261,7 @@ struct pvr2_v4l2 *pvr2_v4l2_create(struct pvr2_context *mnp)
  fail:
        pvr2_trace(PVR2_TRACE_STRUCT,"Failure creating pvr2_v4l2 id=%p",vp);
        pvr2_v4l2_destroy_no_lock(vp);
-       return 0;
+       return NULL;
 }
 
 /*
index 7c47345501b610ea988f349f935de29666415193..2433a31600413cbf40f6276acd5d83dd50b8094b 100644 (file)
@@ -81,7 +81,7 @@ static void set_input(struct pvr2_v4l_decoder *ctxt)
        pvr2_trace(PVR2_TRACE_CHIPS,"i2c v4l2 set_input(%d)",hdw->input_val);
 
        if ((sid < ARRAY_SIZE(routing_schemes)) &&
-           ((sp = routing_schemes + sid) != 0) &&
+           ((sp = routing_schemes + sid) != NULL) &&
            (hdw->input_val >= 0) &&
            (hdw->input_val < sp->cnt)) {
                route.input = sp->def[hdw->input_val];
index 34deb68ae568fdb910f2d833b1e146a08cad9fdd..7cc42c1da457174eb862e671c16b692df1814444 100644 (file)
@@ -716,7 +716,7 @@ int v4l2_i2c_attach(struct i2c_adapter *adapter, int address, struct i2c_driver
        int err;
 
        client = kzalloc(sizeof(struct i2c_client), GFP_KERNEL);
-       if (client == 0)
+       if (!client)
                return -ENOMEM;
 
        client->addr = address;
index fc51e4918bbf790d05ee8d93160a31ddd994aefb..982f4463896c68ed74361dacc3c57918a9fb1212 100644 (file)
@@ -97,7 +97,10 @@ int videobuf_iolock(struct videobuf_queue *q, struct videobuf_buffer *vb,
 void *videobuf_queue_to_vmalloc (struct videobuf_queue *q,
                           struct videobuf_buffer *buf)
 {
-       return CALL(q, vmalloc, buf);
+       if (q->int_ops->vmalloc)
+               return q->int_ops->vmalloc(buf);
+       else
+               return NULL;
 }
 EXPORT_SYMBOL_GPL(videobuf_queue_to_vmalloc);