diff options
author | Mauro Carvalho Chehab <mchehab@infradead.org> | 2006-06-30 11:35:28 -0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@infradead.org> | 2006-06-30 11:35:28 -0300 |
commit | 7b01d379fd7d69e9bba228dd42bc9d0c75bb7681 (patch) | |
tree | 862dfd68553f1cd4410320f8d0affd96be4f2f4e | |
parent | 7c9fb6798a34120f38474485b91f47e8b99b3307 (diff) | |
download | mediapointer-dvb-s2-7b01d379fd7d69e9bba228dd42bc9d0c75bb7681.tar.gz mediapointer-dvb-s2-7b01d379fd7d69e9bba228dd42bc9d0c75bb7681.tar.bz2 |
Clean out a zillion sparse warnings in pvrusb2
From: Mike Isely <isely@pobox.com>
Signed-off-by: Mike Isely <isely@pobox.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
19 files changed, 108 insertions, 108 deletions
diff --git a/linux/drivers/media/video/pvrusb2/pvrusb2-audio.c b/linux/drivers/media/video/pvrusb2/pvrusb2-audio.c index 30e3a38f6..9d1a126be 100644 --- a/linux/drivers/media/video/pvrusb2/pvrusb2-audio.c +++ b/linux/drivers/media/video/pvrusb2/pvrusb2-audio.c @@ -146,8 +146,8 @@ static int get_audio_status(struct pvr2_msp3400_handler *ctxt) static void pvr2_msp3400_detach(struct pvr2_msp3400_handler *ctxt) { - ctxt->client->handler = 0; - ctxt->hdw->audio_stat = 0; + ctxt->client->handler = NULL; + ctxt->hdw->audio_stat = NULL; kfree(ctxt); } diff --git a/linux/drivers/media/video/pvrusb2/pvrusb2-context.c b/linux/drivers/media/video/pvrusb2/pvrusb2-context.c index 40dc59871..f129f316d 100644 --- a/linux/drivers/media/video/pvrusb2/pvrusb2-context.c +++ b/linux/drivers/media/video/pvrusb2/pvrusb2-context.c @@ -77,7 +77,7 @@ struct pvr2_context *pvr2_context_create( const struct usb_device_id *devid, void (*setup_func)(struct pvr2_context *)) { - struct pvr2_context *mp = 0; + struct pvr2_context *mp = NULL; mp = kmalloc(sizeof(*mp),GFP_KERNEL); if (!mp) goto done; memset(mp,0,sizeof(*mp)); @@ -87,7 +87,7 @@ struct pvr2_context *pvr2_context_create( mp->hdw = pvr2_hdw_create(intf,devid); if (!mp->hdw) { pvr2_context_destroy(mp); - mp = 0; + mp = NULL; goto done; } @@ -145,7 +145,7 @@ void pvr2_channel_init(struct pvr2_channel *cp,struct pvr2_context *mp) { cp->hdw = mp->hdw; cp->mc_head = mp; - cp->mc_next = 0; + cp->mc_next = NULL; cp->mc_prev = mp->mc_last; if (mp->mc_last) { mp->mc_last->mc_next = cp; @@ -160,8 +160,8 @@ static void pvr2_channel_disclaim_stream(struct pvr2_channel *cp) { if (!cp->stream) return; pvr2_stream_kill(cp->stream->stream); - cp->stream->user = 0; - cp->stream = 0; + cp->stream->user = NULL; + cp->stream = NULL; } @@ -179,7 +179,7 @@ void pvr2_channel_done(struct pvr2_channel *cp) } else { mp->mc_first = cp->mc_next; } - cp->hdw = 0; + cp->hdw = NULL; } @@ -212,7 +212,7 @@ struct pvr2_ioread *pvr2_channel_create_mpeg_stream( { struct pvr2_ioread *cp; cp = pvr2_ioread_create(); - if (!cp) return 0; + if (!cp) return NULL; pvr2_ioread_setup(cp,sp->stream); pvr2_ioread_set_sync_key(cp,stream_sync_key,sizeof(stream_sync_key)); return cp; diff --git a/linux/drivers/media/video/pvrusb2/pvrusb2-ctrl.c b/linux/drivers/media/video/pvrusb2/pvrusb2-ctrl.c index 20a1c7af7..999c5e223 100644 --- a/linux/drivers/media/video/pvrusb2/pvrusb2-ctrl.c +++ b/linux/drivers/media/video/pvrusb2/pvrusb2-ctrl.c @@ -163,7 +163,7 @@ int pvr2_ctrl_get_mask(struct pvr2_ctrl *cptr) /* Retrieve the control's name */ const char *pvr2_ctrl_get_name(struct pvr2_ctrl *cptr) { - if (!cptr) return 0; + if (!cptr) return NULL; return cptr->info->name; } @@ -171,7 +171,7 @@ const char *pvr2_ctrl_get_name(struct pvr2_ctrl *cptr) /* Retrieve the control's desc */ const char *pvr2_ctrl_get_desc(struct pvr2_ctrl *cptr) { - if (!cptr) return 0; + if (!cptr) return NULL; return cptr->info->desc; } @@ -493,7 +493,7 @@ int pvr2_ctrl_sym_to_value(struct pvr2_ctrl *cptr, LOCK_TAKE(cptr->hdw->big_lock); do { if (cptr->info->type == pvr2_ctl_int) { - ret = parse_token(ptr,len,valptr,0,0); + ret = parse_token(ptr,len,valptr,NULL,0); if ((ret >= 0) && ((*valptr < cptr->info->def.type_int.min_value) || (*valptr > cptr->info->def.type_int.max_value))) { diff --git a/linux/drivers/media/video/pvrusb2/pvrusb2-cx2584x-v4l.c b/linux/drivers/media/video/pvrusb2/pvrusb2-cx2584x-v4l.c index 27eadaff7..c80c26be6 100644 --- a/linux/drivers/media/video/pvrusb2/pvrusb2-cx2584x-v4l.c +++ b/linux/drivers/media/video/pvrusb2/pvrusb2-cx2584x-v4l.c @@ -139,8 +139,8 @@ static const struct pvr2_v4l_cx2584x_ops decoder_ops[] = { static void decoder_detach(struct pvr2_v4l_cx2584x *ctxt) { - ctxt->client->handler = 0; - ctxt->hdw->decoder_ctrl = 0; + ctxt->client->handler = NULL; + ctxt->hdw->decoder_ctrl = NULL; kfree(ctxt); } @@ -221,7 +221,7 @@ static unsigned int decoder_describe(struct pvr2_v4l_cx2584x *ctxt, static void decoder_reset(struct pvr2_v4l_cx2584x *ctxt) { int ret; - ret = pvr2_i2c_client_cmd(ctxt->client,VIDIOC_INT_RESET,0); + ret = pvr2_i2c_client_cmd(ctxt->client,VIDIOC_INT_RESET,NULL); pvr2_trace(PVR2_TRACE_CHIPS,"i2c cx25840 decoder_reset (ret=%d)",ret); } diff --git a/linux/drivers/media/video/pvrusb2/pvrusb2-debugifc.c b/linux/drivers/media/video/pvrusb2/pvrusb2-debugifc.c index 8092b239c..f985f00d8 100644 --- a/linux/drivers/media/video/pvrusb2/pvrusb2-debugifc.c +++ b/linux/drivers/media/video/pvrusb2/pvrusb2-debugifc.c @@ -82,7 +82,7 @@ static unsigned int debugifc_isolate_word(const char *buf,unsigned int count, unsigned int wlen; unsigned int scnt; - wptr = 0; + wptr = NULL; wlen = 0; scnt = debugifc_count_whitespace(buf,count); consume_cnt += scnt; count -= scnt; buf += scnt; diff --git a/linux/drivers/media/video/pvrusb2/pvrusb2-eeprom.c b/linux/drivers/media/video/pvrusb2/pvrusb2-eeprom.c index 4003149a1..e0e248b83 100644 --- a/linux/drivers/media/video/pvrusb2/pvrusb2-eeprom.c +++ b/linux/drivers/media/video/pvrusb2/pvrusb2-eeprom.c @@ -59,7 +59,7 @@ static u8 *pvr2_eeprom_fetch(struct pvr2_hdw *hdw) pvr2_trace(PVR2_TRACE_ERROR_LEGS, "Failed to allocate memory" " required to read eeprom"); - return 0; + return NULL; } trace_eeprom("Value for eeprom addr from controller was 0x%x", @@ -109,7 +109,7 @@ static u8 *pvr2_eeprom_fetch(struct pvr2_hdw *hdw) pvr2_trace(PVR2_TRACE_ERROR_LEGS, "eeprom fetch set offs err=%d",ret); kfree(eeprom); - return 0; + return NULL; } } return eeprom; diff --git a/linux/drivers/media/video/pvrusb2/pvrusb2-encoder.c b/linux/drivers/media/video/pvrusb2/pvrusb2-encoder.c index b6ee5b112..657993fa8 100644 --- a/linux/drivers/media/video/pvrusb2/pvrusb2-encoder.c +++ b/linux/drivers/media/video/pvrusb2/pvrusb2-encoder.c @@ -66,7 +66,7 @@ static int pvr2_encoder_write_words(struct pvr2_hdw *hdw, } ret = pvr2_send_request(hdw, hdw->cmd_buffer,1+(chunkCnt*7), - 0,0); + NULL,0); if (ret) return ret; data += chunkCnt; dlen -= chunkCnt; @@ -355,7 +355,7 @@ int pvr2_encoder_configure(struct pvr2_hdw *hdw) } ret = cx2341x_update(hdw,pvr2_encoder_cmd, - (hdw->enc_cur_valid ? &hdw->enc_cur_state : 0), + (hdw->enc_cur_valid ? &hdw->enc_cur_state : NULL), &hdw->enc_ctl_state); if (ret) { pvr2_trace(PVR2_TRACE_ERROR_LEGS, diff --git a/linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c b/linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c index aedcfbb0b..5ad657e89 100644 --- a/linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c +++ b/linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c @@ -88,7 +88,7 @@ static struct pvr2_string_table pvr2_client_lists[] = { #endif }; -static struct pvr2_hdw *unit_pointers[PVR_NUM] = {[ 0 ... PVR_NUM-1 ] = 0}; +static struct pvr2_hdw *unit_pointers[PVR_NUM] = {[ 0 ... PVR_NUM-1 ] = NULL}; static DECLARE_MUTEX(pvr2_unit_sem); static int ctlchg = 0; @@ -423,7 +423,7 @@ static unsigned int ctrl_cx2341x_getv4lflags(struct pvr2_ctrl *cptr) info = (struct pvr2_ctl_info *)(cptr->info); if (qctrl.flags & V4L2_CTRL_FLAG_READ_ONLY) { if (info->set_value) { - info->set_value = 0; + info->set_value = NULL; } } else { if (!(info->set_value)) { @@ -856,8 +856,8 @@ unsigned long pvr2_hdw_get_sn(struct pvr2_hdw *hdw) #if 0 struct pvr2_hdw *pvr2_hdw_find(int unit_number) { - if (unit_number < 0) return 0; - if (unit_number >= PVR_NUM) return 0; + if (unit_number < 0) return NULL; + if (unit_number >= PVR_NUM) return NULL; return unit_pointers[unit_number]; } #endif /* 0 */ @@ -937,7 +937,7 @@ static int pvr2_locate_firmware(struct pvr2_hdw *hdw, */ static int pvr2_upload_firmware1(struct pvr2_hdw *hdw) { - const struct firmware *fw_entry = 0; + const struct firmware *fw_entry = NULL; void *fw_ptr; unsigned int pipe; int ret; @@ -1033,7 +1033,7 @@ static int pvr2_upload_firmware1(struct pvr2_hdw *hdw) int pvr2_upload_firmware2(struct pvr2_hdw *hdw) { - const struct firmware *fw_entry = 0; + const struct firmware *fw_entry = NULL; void *fw_ptr; unsigned int pipe, fw_len, fw_done; int actual_length; @@ -1762,7 +1762,7 @@ struct pvr2_hdw *pvr2_hdw_create(struct usb_interface *intf, sizeof(pvr2_device_names)/sizeof(pvr2_device_names[0])) { pvr2_trace(PVR2_TRACE_ERROR_LEGS, "Bogus device type of %u reported",hdw_type); - return 0; + return NULL; } hdw = kmalloc(sizeof(*hdw),GFP_KERNEL); @@ -1943,7 +1943,7 @@ struct pvr2_hdw *pvr2_hdw_create(struct usb_interface *intf, if (hdw->mpeg_ctrl_info) kfree(hdw->mpeg_ctrl_info); kfree(hdw); } - return 0; + return NULL; } @@ -1956,25 +1956,25 @@ static void pvr2_hdw_remove_usb_stuff(struct pvr2_hdw *hdw) if (hdw->ctl_read_urb) { usb_kill_urb(hdw->ctl_read_urb); usb_free_urb(hdw->ctl_read_urb); - hdw->ctl_read_urb = 0; + hdw->ctl_read_urb = NULL; } if (hdw->ctl_write_urb) { usb_kill_urb(hdw->ctl_write_urb); usb_free_urb(hdw->ctl_write_urb); - hdw->ctl_write_urb = 0; + hdw->ctl_write_urb = NULL; } if (hdw->ctl_read_buffer) { kfree(hdw->ctl_read_buffer); - hdw->ctl_read_buffer = 0; + hdw->ctl_read_buffer = NULL; } if (hdw->ctl_write_buffer) { kfree(hdw->ctl_write_buffer); - hdw->ctl_write_buffer = 0; + hdw->ctl_write_buffer = NULL; } pvr2_hdw_render_useless_unlocked(hdw); hdw->flag_disconnected = !0; - hdw->usb_dev = 0; - hdw->usb_intf = 0; + hdw->usb_dev = NULL; + hdw->usb_intf = NULL; } @@ -1984,11 +1984,11 @@ void pvr2_hdw_destroy(struct pvr2_hdw *hdw) pvr2_trace(PVR2_TRACE_INIT,"pvr2_hdw_destroy: hdw=%p",hdw); if (hdw->fw_buffer) { kfree(hdw->fw_buffer); - hdw->fw_buffer = 0; + hdw->fw_buffer = NULL; } if (hdw->vid_stream) { pvr2_stream_destroy(hdw->vid_stream); - hdw->vid_stream = 0; + hdw->vid_stream = NULL; } if (hdw->audio_stat) { hdw->audio_stat->detach(hdw->audio_stat->ctxt); @@ -2002,7 +2002,7 @@ void pvr2_hdw_destroy(struct pvr2_hdw *hdw) if ((hdw->unit_number >= 0) && (hdw->unit_number < PVR_NUM) && (unit_pointers[hdw->unit_number] == hdw)) { - unit_pointers[hdw->unit_number] = 0; + unit_pointers[hdw->unit_number] = NULL; } } while (0); up(&pvr2_unit_sem); if (hdw->controls) kfree(hdw->controls); @@ -2064,12 +2064,12 @@ static void pvr2_hdw_internal_set_std_avail(struct pvr2_hdw *hdw) if (hdw->std_defs) { kfree(hdw->std_defs); - hdw->std_defs = 0; + hdw->std_defs = NULL; } hdw->std_enum_cnt = 0; if (hdw->std_enum_names) { kfree(hdw->std_enum_names); - hdw->std_enum_names = 0; + hdw->std_enum_names = NULL; } if (!std_cnt) { @@ -2120,7 +2120,7 @@ unsigned int pvr2_hdw_get_ctrl_count(struct pvr2_hdw *hdw) struct pvr2_ctrl *pvr2_hdw_get_ctrl_by_index(struct pvr2_hdw *hdw, unsigned int idx) { - if (idx >= hdw->control_cnt) return 0; + if (idx >= hdw->control_cnt) return NULL; return hdw->controls + idx; } @@ -2139,7 +2139,7 @@ struct pvr2_ctrl *pvr2_hdw_get_ctrl_by_id(struct pvr2_hdw *hdw, i = cptr->info->internal_id; if (i && (i == ctl_id)) return cptr; } - return 0; + return NULL; } @@ -2156,7 +2156,7 @@ struct pvr2_ctrl *pvr2_hdw_get_ctrl_v4l(struct pvr2_hdw *hdw,unsigned int ctl_id i = cptr->info->v4l_id; if (i && (i == ctl_id)) return cptr; } - return 0; + return NULL; } @@ -2170,7 +2170,7 @@ struct pvr2_ctrl *pvr2_hdw_get_ctrl_nextv4l(struct pvr2_hdw *hdw, int i; /* This could be made a lot more efficient, but for now... */ - cp2 = 0; + cp2 = NULL; for (idx = 0; idx < hdw->control_cnt; idx++) { cptr = hdw->controls + idx; i = cptr->info->v4l_id; @@ -2180,7 +2180,7 @@ struct pvr2_ctrl *pvr2_hdw_get_ctrl_nextv4l(struct pvr2_hdw *hdw, cp2 = cptr; } return cp2; - return 0; + return NULL; } @@ -2451,7 +2451,7 @@ void pvr2_hdw_cpufw_set_enabled(struct pvr2_hdw *hdw, int enable_flag) pvr2_trace(PVR2_TRACE_FIRMWARE, "Cleaning up after CPU firmware fetch"); kfree(hdw->fw_buffer); - hdw->fw_buffer = 0; + hdw->fw_buffer = NULL; hdw->fw_size = 0; /* Now release the CPU. It will disconnect and reconnect later. */ @@ -2962,7 +2962,7 @@ static void pvr2_hdw_render_useless_unlocked(struct pvr2_hdw *hdw) pvr2_trace(PVR2_TRACE_INIT,"render_useless"); hdw->flag_ok = 0; if (hdw->vid_stream) { - pvr2_stream_setup(hdw->vid_stream,0,0,0); + pvr2_stream_setup(hdw->vid_stream,NULL,0,0); } hdw->flag_streaming_enabled = 0; hdw->subsys_enabled_mask = 0; @@ -2981,7 +2981,7 @@ void pvr2_hdw_device_reset(struct pvr2_hdw *hdw) { int ret; pvr2_trace(PVR2_TRACE_INIT,"Performing a device reset..."); - ret = usb_lock_device_for_reset(hdw->usb_dev,0); + ret = usb_lock_device_for_reset(hdw->usb_dev,NULL); if (ret == 1) { ret = usb_reset_device(hdw->usb_dev); usb_unlock_device(hdw->usb_dev); @@ -3030,7 +3030,7 @@ int pvr2_hdw_cmd_deep_reset(struct pvr2_hdw *hdw) pvr2_trace(PVR2_TRACE_INIT,"Requesting uproc hard reset"); hdw->flag_ok = !0; hdw->cmd_buffer[0] = 0xdd; - status = pvr2_send_request(hdw,hdw->cmd_buffer,1,0,0); + status = pvr2_send_request(hdw,hdw->cmd_buffer,1,NULL,0); } while (0); LOCK_GIVE(hdw->ctl_lock); return status; } @@ -3042,7 +3042,7 @@ int pvr2_hdw_cmd_powerup(struct pvr2_hdw *hdw) LOCK_TAKE(hdw->ctl_lock); do { pvr2_trace(PVR2_TRACE_INIT,"Requesting powerup"); hdw->cmd_buffer[0] = 0xde; - status = pvr2_send_request(hdw,hdw->cmd_buffer,1,0,0); + status = pvr2_send_request(hdw,hdw->cmd_buffer,1,NULL,0); } while (0); LOCK_GIVE(hdw->ctl_lock); return status; } @@ -3074,7 +3074,7 @@ static int pvr2_hdw_cmd_usbstream(struct pvr2_hdw *hdw,int runFl) int status; LOCK_TAKE(hdw->ctl_lock); do { hdw->cmd_buffer[0] = (runFl ? 0x36 : 0x37); - status = pvr2_send_request(hdw,hdw->cmd_buffer,1,0,0); + status = pvr2_send_request(hdw,hdw->cmd_buffer,1,NULL,0); } while (0); LOCK_GIVE(hdw->ctl_lock); if (!status) { hdw->subsys_enabled_mask = diff --git a/linux/drivers/media/video/pvrusb2/pvrusb2-i2c-cmd-v4l2.c b/linux/drivers/media/video/pvrusb2/pvrusb2-i2c-cmd-v4l2.c index 9f81aff2b..8a9933dec 100644 --- a/linux/drivers/media/video/pvrusb2/pvrusb2-i2c-cmd-v4l2.c +++ b/linux/drivers/media/video/pvrusb2/pvrusb2-i2c-cmd-v4l2.c @@ -196,7 +196,7 @@ const struct pvr2_i2c_op pvr2_i2c_op_v4l2_size = { static void do_log(struct pvr2_hdw *hdw) { pvr2_trace(PVR2_TRACE_CHIPS,"i2c v4l2 do_log()"); - pvr2_i2c_core_cmd(hdw,VIDIOC_LOG_STATUS,0); + pvr2_i2c_core_cmd(hdw,VIDIOC_LOG_STATUS,NULL); } @@ -217,7 +217,7 @@ const struct pvr2_i2c_op pvr2_i2c_op_v4l2_log = { void pvr2_v4l2_cmd_stream(struct pvr2_i2c_client *cp,int fl) { pvr2_i2c_client_cmd(cp, - (fl ? VIDIOC_STREAMON : VIDIOC_STREAMOFF),0); + (fl ? VIDIOC_STREAMON : VIDIOC_STREAMOFF),NULL); } diff --git a/linux/drivers/media/video/pvrusb2/pvrusb2-i2c-core.c b/linux/drivers/media/video/pvrusb2/pvrusb2-i2c-core.c index 19ffb38f7..95c2f071a 100644 --- a/linux/drivers/media/video/pvrusb2/pvrusb2-i2c-core.c +++ b/linux/drivers/media/video/pvrusb2/pvrusb2-i2c-core.c @@ -286,7 +286,7 @@ static int i2c_hack_cx25840(struct pvr2_hdw *hdw, "WARNING: Disabling further access to the device" " to prevent other foul-ups."); // This blocks all further communication with the part. - hdw->i2c_func[0x44] = 0; + hdw->i2c_func[0x44] = NULL; pvr2_hdw_render_useless(hdw); goto fail; } @@ -313,7 +313,7 @@ static int pvr2_i2c_xfer(struct i2c_adapter *i2c_adap, int num) { int ret = -ENOTSUPP; - pvr2_i2c_func funcp = 0; + pvr2_i2c_func funcp = NULL; struct pvr2_hdw *hdw = (struct pvr2_hdw *)(i2c_adap->algo_data); if (!num) { @@ -338,7 +338,7 @@ static int pvr2_i2c_xfer(struct i2c_adapter *i2c_adap, u16 tcnt,bcnt,offs; if (!msgs[0].len) { /* Length == 0 read. This is a probe. */ - if (funcp(hdw,msgs[0].addr,0,0,0,0)) { + if (funcp(hdw,msgs[0].addr,NULL,0,NULL,0)) { ret = -EIO; goto done; } @@ -355,7 +355,7 @@ static int pvr2_i2c_xfer(struct i2c_adapter *i2c_adap, if (bcnt > sizeof(hdw->cmd_buffer)-1) { bcnt = sizeof(hdw->cmd_buffer)-1; } - if (funcp(hdw,msgs[0].addr,0,0, + if (funcp(hdw,msgs[0].addr,NULL,0, msgs[0].buf+offs,bcnt)) { ret = -EIO; goto done; @@ -369,7 +369,7 @@ static int pvr2_i2c_xfer(struct i2c_adapter *i2c_adap, /* Simple write */ ret = 1; if (funcp(hdw,msgs[0].addr, - msgs[0].buf,msgs[0].len,0,0)) { + msgs[0].buf,msgs[0].len,NULL,0)) { ret = -EIO; } goto done; @@ -901,7 +901,7 @@ static void do_i2c_scan(struct pvr2_hdw *hdw) msg[0].addr = 0; msg[0].flags = I2C_M_RD; msg[0].len = 0; - msg[0].buf = 0; + msg[0].buf = NULL; printk("%s: i2c scan beginning\n",hdw->name); for (i = 0; i < 128; i++) { msg[0].addr = i; diff --git a/linux/drivers/media/video/pvrusb2/pvrusb2-io.c b/linux/drivers/media/video/pvrusb2/pvrusb2-io.c index b2ace5403..1c1cf9024 100644 --- a/linux/drivers/media/video/pvrusb2/pvrusb2-io.c +++ b/linux/drivers/media/video/pvrusb2/pvrusb2-io.c @@ -136,8 +136,8 @@ static void pvr2_buffer_describe(struct pvr2_buffer *bp,const char *msg) (bp ? pvr2_buffer_state_decode(bp->state) : "(invalid)"), (bp ? bp->id : 0), (bp ? bp->status : 0), - (bp ? bp->stream : 0), - (bp ? bp->purb : 0), + (bp ? bp->stream : NULL), + (bp ? bp->purb : NULL), (bp ? bp->signature : 0)); } #endif /* SANITY_CHECK_BUFFERS */ @@ -306,7 +306,7 @@ static void pvr2_buffer_done(struct pvr2_buffer *bp) pvr2_buffer_wipe(bp); pvr2_buffer_set_none(bp); bp->signature = 0; - bp->stream = 0; + bp->stream = NULL; if (bp->purb) usb_free_urb(bp->purb); pvr2_trace(PVR2_TRACE_BUF_POOL,"/*---TRACE_FLOW---*/" " bufferDone %p",bp); @@ -361,13 +361,13 @@ static int pvr2_stream_buffer_count(struct pvr2_stream *sp,unsigned int cnt) struct pvr2_buffer *bp; bp = sp->buffers[sp->buffer_total_count - 1]; /* Paranoia */ - sp->buffers[sp->buffer_total_count - 1] = 0; + sp->buffers[sp->buffer_total_count - 1] = NULL; (sp->buffer_total_count)--; pvr2_buffer_done(bp); kfree(bp); } if (scnt < sp->buffer_slot_count) { - struct pvr2_buffer **nb = 0; + struct pvr2_buffer **nb = NULL; if (scnt) { nb = kmalloc(scnt * sizeof(*nb),GFP_KERNEL); if (!nb) return -ENOMEM; @@ -556,21 +556,21 @@ int pvr2_stream_set_buffer_count(struct pvr2_stream *sp,unsigned int cnt) struct pvr2_buffer *pvr2_stream_get_idle_buffer(struct pvr2_stream *sp) { struct list_head *lp = sp->idle_list.next; - if (lp == &sp->idle_list) return 0; + if (lp == &sp->idle_list) return NULL; return list_entry(lp,struct pvr2_buffer,list_overhead); } struct pvr2_buffer *pvr2_stream_get_ready_buffer(struct pvr2_stream *sp) { struct list_head *lp = sp->ready_list.next; - if (lp == &sp->ready_list) return 0; + if (lp == &sp->ready_list) return NULL; return list_entry(lp,struct pvr2_buffer,list_overhead); } struct pvr2_buffer *pvr2_stream_get_buffer(struct pvr2_stream *sp,int id) { - if (id < 0) return 0; - if (id >= sp->buffer_total_count) return 0; + if (id < 0) return NULL; + if (id >= sp->buffer_total_count) return NULL; return sp->buffers[id]; } diff --git a/linux/drivers/media/video/pvrusb2/pvrusb2-ioread.c b/linux/drivers/media/video/pvrusb2/pvrusb2-ioread.c index f23ca9b5d..06d3d9a38 100644 --- a/linux/drivers/media/video/pvrusb2/pvrusb2-ioread.c +++ b/linux/drivers/media/video/pvrusb2/pvrusb2-ioread.c @@ -63,7 +63,7 @@ static int pvr2_ioread_init(struct pvr2_ioread *cp) { unsigned int idx; - cp->stream = 0; + cp->stream = NULL; mutex_init(&cp->mutex); for (idx = 0; idx < BUFFER_COUNT; idx++) { @@ -86,7 +86,7 @@ static void pvr2_ioread_done(struct pvr2_ioread *cp) { unsigned int idx; - pvr2_ioread_setup(cp,0); + pvr2_ioread_setup(cp,NULL); for (idx = 0; idx < BUFFER_COUNT; idx++) { if (!(cp->buffer_storage[idx])) continue; kfree(cp->buffer_storage[idx]); @@ -97,12 +97,12 @@ struct pvr2_ioread *pvr2_ioread_create(void) { struct pvr2_ioread *cp; cp = kmalloc(sizeof(*cp),GFP_KERNEL); - if (!cp) return 0; + if (!cp) return NULL; pvr2_trace(PVR2_TRACE_STRUCT,"pvr2_ioread_create id=%p",cp); memset(cp,0,sizeof(*cp)); if (pvr2_ioread_init(cp) < 0) { kfree(cp); - return 0; + return NULL; } return cp; } @@ -114,7 +114,7 @@ void pvr2_ioread_destroy(struct pvr2_ioread *cp) pvr2_trace(PVR2_TRACE_STRUCT,"pvr2_ioread_destroy id=%p",cp); if (cp->sync_key_ptr) { kfree(cp->sync_key_ptr); - cp->sync_key_ptr = 0; + cp->sync_key_ptr = NULL; } kfree(cp); } @@ -133,7 +133,7 @@ void pvr2_ioread_set_sync_key(struct pvr2_ioread *cp, if (sync_key_len != cp->sync_key_len) { if (cp->sync_key_ptr) { kfree(cp->sync_key_ptr); - cp->sync_key_ptr = 0; + cp->sync_key_ptr = NULL; } cp->sync_key_len = 0; if (sync_key_len) { @@ -153,8 +153,8 @@ static void pvr2_ioread_stop(struct pvr2_ioread *cp) pvr2_trace(PVR2_TRACE_START_STOP, "/*---TRACE_READ---*/ pvr2_ioread_stop id=%p",cp); pvr2_stream_kill(cp->stream); - cp->c_buf = 0; - cp->c_data_ptr = 0; + cp->c_buf = NULL; + cp->c_data_ptr = NULL; cp->c_data_len = 0; cp->c_data_offs = 0; cp->enabled = 0; @@ -188,8 +188,8 @@ static int pvr2_ioread_start(struct pvr2_ioread *cp) } } cp->enabled = !0; - cp->c_buf = 0; - cp->c_data_ptr = 0; + cp->c_buf = NULL; + cp->c_data_ptr = NULL; cp->c_data_len = 0; cp->c_data_offs = 0; cp->stream_running = 0; @@ -223,7 +223,7 @@ int pvr2_ioread_setup(struct pvr2_ioread *cp,struct pvr2_stream *sp) pvr2_ioread_stop(cp); pvr2_stream_kill(cp->stream); pvr2_stream_set_buffer_count(cp->stream,0); - cp->stream = 0; + cp->stream = NULL; } if (sp) { pvr2_trace(PVR2_TRACE_START_STOP, @@ -285,8 +285,8 @@ static int pvr2_ioread_get_buffer(struct pvr2_ioread *cp) pvr2_ioread_stop(cp); return 0; } - cp->c_buf = 0; - cp->c_data_ptr = 0; + cp->c_buf = NULL; + cp->c_data_ptr = NULL; cp->c_data_len = 0; cp->c_data_offs = 0; } diff --git a/linux/drivers/media/video/pvrusb2/pvrusb2-main.c b/linux/drivers/media/video/pvrusb2/pvrusb2-main.c index b81b5a62e..494eb85cb 100644 --- a/linux/drivers/media/video/pvrusb2/pvrusb2-main.c +++ b/linux/drivers/media/video/pvrusb2/pvrusb2-main.c @@ -55,7 +55,7 @@ module_param_named(debug,pvrusb2_debug,int,S_IRUGO|S_IWUSR); MODULE_PARM_DESC(debug, "Debug trace mask"); #ifdef CONFIG_VIDEO_PVRUSB2_SYSFS -static struct pvr2_sysfs_class *class_ptr = 0; +static struct pvr2_sysfs_class *class_ptr = NULL; #endif /* CONFIG_VIDEO_PVRUSB2_SYSFS */ static void pvr_setup_attach(struct pvr2_context *pvr) @@ -106,12 +106,12 @@ static void pvr_disconnect(struct usb_interface *intf) static struct usb_driver pvr_driver = { #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,16) - owner: THIS_MODULE, + .owner = THIS_MODULE, #endif - name: "pvrusb2", - id_table: pvr2_device_table, - probe: pvr_probe, - disconnect: pvr_disconnect + .name = "pvrusb2", + .id_table = pvr2_device_table, + .probe = pvr_probe, + .disconnect = pvr_disconnect }; /* diff --git a/linux/drivers/media/video/pvrusb2/pvrusb2-std.c b/linux/drivers/media/video/pvrusb2/pvrusb2-std.c index 134063693..f95c598ff 100644 --- a/linux/drivers/media/video/pvrusb2/pvrusb2-std.c +++ b/linux/drivers/media/video/pvrusb2/pvrusb2-std.c @@ -121,7 +121,7 @@ static const struct std_name *find_std_name(const struct std_name *arrPtr, if (strlen(p->name) != bufSize) continue; if (!memcmp(bufPtr,p->name,bufSize)) return p; } - return 0; + return NULL; } @@ -289,7 +289,7 @@ static struct v4l2_standard *match_std(v4l2_std_id id) return generic_standards + idx; } } - return 0; + return NULL; } static int pvr2_std_fill(struct v4l2_standard *std,v4l2_std_id id) @@ -364,7 +364,7 @@ struct v4l2_standard *pvr2_std_create_enum(unsigned int *countptr, pvr2_trace(PVR2_TRACE_INIT,"Setting up %u unique standard(s)", std_cnt); - if (!std_cnt) return 0; // paranoia + if (!std_cnt) return NULL; // paranoia stddefs = kmalloc(sizeof(struct v4l2_standard) * std_cnt, GFP_KERNEL); diff --git a/linux/drivers/media/video/pvrusb2/pvrusb2-sysfs.c b/linux/drivers/media/video/pvrusb2/pvrusb2-sysfs.c index 812a779c8..4770bc3be 100644 --- a/linux/drivers/media/video/pvrusb2/pvrusb2-sysfs.c +++ b/linux/drivers/media/video/pvrusb2/pvrusb2-sysfs.c @@ -505,7 +505,7 @@ static void pvr2_sysfs_add_control(struct pvr2_sysfs *sfp,int ctl_id) cip->cptr = cptr; cip->chptr = sfp; - cip->item_next = 0; + cip->item_next = NULL; if (sfp->item_last) { sfp->item_last->item_next = cip; } else { @@ -626,7 +626,7 @@ static void pvr2_sysfs_tear_down_debugifc(struct pvr2_sysfs *sfp) &sfp->debugifc->attr_debuginfo); class_device_remove_file(sfp->class_dev,&sfp->debugifc->attr_debugcmd); kfree(sfp->debugifc); - sfp->debugifc = 0; + sfp->debugifc = NULL; } #endif /* CONFIG_VIDEO_PVRUSB2_DEBUGIFC */ @@ -679,9 +679,9 @@ static void class_dev_destroy(struct pvr2_sysfs *sfp) class_device_remove_file(sfp->class_dev,&sfp->attr_v4l_minor_number); class_device_remove_file(sfp->class_dev,&sfp->attr_unit_number); pvr2_sysfs_trace("Destroying class_dev id=%p",sfp->class_dev); - sfp->class_dev->class_data = 0; + sfp->class_dev->class_data = NULL; class_device_unregister(sfp->class_dev); - sfp->class_dev = 0; + sfp->class_dev = NULL; } @@ -740,13 +740,13 @@ static void class_dev_create(struct pvr2_sysfs *sfp, sfp->attr_v4l_minor_number.attr.name = "v4l_minor_number"; sfp->attr_v4l_minor_number.attr.mode = S_IRUGO; sfp->attr_v4l_minor_number.show = v4l_minor_number_show; - sfp->attr_v4l_minor_number.store = 0; + sfp->attr_v4l_minor_number.store = NULL; class_device_create_file(sfp->class_dev,&sfp->attr_v4l_minor_number); sfp->attr_unit_number.attr.owner = THIS_MODULE; sfp->attr_unit_number.attr.name = "unit_number"; sfp->attr_unit_number.attr.mode = S_IRUGO; sfp->attr_unit_number.show = unit_number_show; - sfp->attr_unit_number.store = 0; + sfp->attr_unit_number.store = NULL; class_device_create_file(sfp->class_dev,&sfp->attr_unit_number); pvr2_sysfs_add_controls(sfp); @@ -811,7 +811,7 @@ struct pvr2_sysfs_class *pvr2_sysfs_class_create(void) pvr2_sysfs_trace( "Registration failed for pvr2_sysfs_class id=%p",clp); kfree(clp); - clp = 0; + clp = NULL; } return clp; } diff --git a/linux/drivers/media/video/pvrusb2/pvrusb2-tuner.c b/linux/drivers/media/video/pvrusb2/pvrusb2-tuner.c index 8bf7cc142..e196d92a6 100644 --- a/linux/drivers/media/video/pvrusb2/pvrusb2-tuner.c +++ b/linux/drivers/media/video/pvrusb2/pvrusb2-tuner.c @@ -70,7 +70,7 @@ static void tuner_update(struct pvr2_tuner_handler *ctxt) static void pvr2_tuner_detach(struct pvr2_tuner_handler *ctxt) { - ctxt->client->handler = 0; + ctxt->client->handler = NULL; kfree(ctxt); } diff --git a/linux/drivers/media/video/pvrusb2/pvrusb2-v4l2.c b/linux/drivers/media/video/pvrusb2/pvrusb2-v4l2.c index 110429a62..2ca67413d 100644 --- a/linux/drivers/media/video/pvrusb2/pvrusb2-v4l2.c +++ b/linux/drivers/media/video/pvrusb2/pvrusb2-v4l2.c @@ -776,9 +776,9 @@ static int pvr2_v4l2_release(struct inode *inode, struct file *file) hdw = fhp->channel.mc_head->hdw; pvr2_hdw_set_streaming(hdw,0); sp = pvr2_ioread_get_stream(fhp->rhp); - if (sp) pvr2_stream_set_callback(sp,0,0); + if (sp) pvr2_stream_set_callback(sp,NULL,NULL); pvr2_ioread_destroy(fhp->rhp); - fhp->rhp = 0; + fhp->rhp = NULL; } v4l2_prio_close(&vp->prio, &fhp->prio); file->private_data = NULL; @@ -794,9 +794,9 @@ static int pvr2_v4l2_release(struct inode *inode, struct file *file) } else { vp->vfirst = fhp->vnext; } - fhp->vnext = 0; - fhp->vprev = 0; - fhp->vhead = 0; + fhp->vnext = NULL; + fhp->vprev = NULL; + fhp->vhead = NULL; pvr2_channel_done(&fhp->channel); pvr2_trace(PVR2_TRACE_STRUCT, "Destroying pvr_v4l2_fh id=%p",fhp); @@ -811,7 +811,7 @@ static int pvr2_v4l2_release(struct inode *inode, struct file *file) static int pvr2_v4l2_open(struct inode *inode, struct file *file) { - struct pvr2_v4l2_dev *dip = 0; /* Our own context pointer */ + struct pvr2_v4l2_dev *dip = NULL; /* Our own context pointer */ struct pvr2_v4l2_fh *fhp; struct pvr2_v4l2 *vp; struct pvr2_hdw *hdw; @@ -869,7 +869,7 @@ static int pvr2_v4l2_open(struct inode *inode, struct file *file) pvr2_context_enter(vp->channel.mc_head); do { pvr2_trace(PVR2_TRACE_STRUCT,"Creating pvr_v4l2_fh id=%p",fhp); pvr2_channel_init(&fhp->channel,vp->channel.mc_head); - fhp->vnext = 0; + fhp->vnext = NULL; fhp->vprev = vp->vlast; if (vp->vlast) { vp->vlast->vnext = fhp; @@ -912,7 +912,7 @@ static int pvr2_v4l2_iosetup(struct pvr2_v4l2_fh *fh) fh->rhp = pvr2_channel_create_mpeg_stream(fh->dev_info->stream); if (!fh->rhp) { - pvr2_channel_claim_stream(&fh->channel,0); + pvr2_channel_claim_stream(&fh->channel,NULL); return -ENOMEM; } diff --git a/linux/drivers/media/video/pvrusb2/pvrusb2-video-v4l.c b/linux/drivers/media/video/pvrusb2/pvrusb2-video-v4l.c index e4ec7f251..05f2cddeb 100644 --- a/linux/drivers/media/video/pvrusb2/pvrusb2-video-v4l.c +++ b/linux/drivers/media/video/pvrusb2/pvrusb2-video-v4l.c @@ -126,8 +126,8 @@ static const struct pvr2_v4l_decoder_ops decoder_ops[] = { static void decoder_detach(struct pvr2_v4l_decoder *ctxt) { - ctxt->client->handler = 0; - ctxt->hdw->decoder_ctrl = 0; + ctxt->client->handler = NULL; + ctxt->hdw->decoder_ctrl = NULL; kfree(ctxt); } diff --git a/linux/drivers/media/video/pvrusb2/pvrusb2-wm8775.c b/linux/drivers/media/video/pvrusb2/pvrusb2-wm8775.c index fcad346e3..2413e5198 100644 --- a/linux/drivers/media/video/pvrusb2/pvrusb2-wm8775.c +++ b/linux/drivers/media/video/pvrusb2/pvrusb2-wm8775.c @@ -89,7 +89,7 @@ static unsigned int wm8775_describe(struct pvr2_v4l_wm8775 *ctxt, static void wm8775_detach(struct pvr2_v4l_wm8775 *ctxt) { - ctxt->client->handler = 0; + ctxt->client->handler = NULL; kfree(ctxt); } |