Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

NULL noise: drivers/media

Acked-by: Harvey Harrison <harvey.harrison@gmail.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Al Viro and committed by
Linus Torvalds
5fa1247a 8481664d

+37 -42
+5 -8
drivers/media/common/saa7146_core.c
··· 306 306 return IRQ_NONE; 307 307 } 308 308 309 - if( 0 != (dev->ext)) { 310 - if( 0 != (dev->ext->irq_mask & isr )) { 311 - if( 0 != dev->ext->irq_func ) { 309 + if (dev->ext) { 310 + if (dev->ext->irq_mask & isr) { 311 + if (dev->ext->irq_func) 312 312 dev->ext->irq_func(dev, &isr); 313 - } 314 313 isr &= ~dev->ext->irq_mask; 315 314 } 316 315 } 317 316 if (0 != (isr & (MASK_27))) { 318 317 DEB_INT(("irq: RPS0 (0x%08x).\n",isr)); 319 - if( 0 != dev->vv_data && 0 != dev->vv_callback) { 318 + if (dev->vv_data && dev->vv_callback) 320 319 dev->vv_callback(dev,isr); 321 - } 322 320 isr &= ~MASK_27; 323 321 } 324 322 if (0 != (isr & (MASK_28))) { 325 - if( 0 != dev->vv_data && 0 != dev->vv_callback) { 323 + if (dev->vv_data && dev->vv_callback) 326 324 dev->vv_callback(dev,isr); 327 - } 328 325 isr &= ~MASK_28; 329 326 } 330 327 if (0 != (isr & (MASK_16|MASK_17))) {
+1 -1
drivers/media/common/saa7146_fops.c
··· 272 272 273 273 result = 0; 274 274 out: 275 - if( fh != 0 && result != 0 ) { 275 + if (fh && result != 0) { 276 276 kfree(fh); 277 277 file->private_data = NULL; 278 278 }
+2 -2
drivers/media/dvb/dvb-core/dvb_net.c
··· 784 784 { 785 785 struct net_device *dev = feed->priv; 786 786 787 - if (buffer2 != 0) 788 - printk(KERN_WARNING "buffer2 not 0: %p.\n", buffer2); 787 + if (buffer2) 788 + printk(KERN_WARNING "buffer2 not NULL: %p.\n", buffer2); 789 789 if (buffer1_len > 32768) 790 790 printk(KERN_WARNING "length > 32k: %zu.\n", buffer1_len); 791 791 /* printk("TS callback: %u bytes, %u TS cells @ %p.\n",
+1 -1
drivers/media/video/adv7170.c
··· 408 408 return 0; 409 409 410 410 client = kzalloc(sizeof(struct i2c_client), GFP_KERNEL); 411 - if (client == 0) 411 + if (!client) 412 412 return -ENOMEM; 413 413 client->addr = address; 414 414 client->adapter = adapter;
+1 -1
drivers/media/video/adv7175.c
··· 426 426 return 0; 427 427 428 428 client = kzalloc(sizeof(struct i2c_client), GFP_KERNEL); 429 - if (client == 0) 429 + if (!client) 430 430 return -ENOMEM; 431 431 client->addr = address; 432 432 client->adapter = adapter;
+1 -1
drivers/media/video/bt819.c
··· 524 524 return 0; 525 525 526 526 client = kzalloc(sizeof(struct i2c_client), GFP_KERNEL); 527 - if (client == 0) 527 + if (!client) 528 528 return -ENOMEM; 529 529 client->addr = address; 530 530 client->adapter = adapter;
+1 -1
drivers/media/video/bt856.c
··· 311 311 return 0; 312 312 313 313 client = kzalloc(sizeof(struct i2c_client), GFP_KERNEL); 314 - if (client == 0) 314 + if (!client) 315 315 return -ENOMEM; 316 316 client->addr = address; 317 317 client->adapter = adapter;
+1 -1
drivers/media/video/dpc7146.c
··· 131 131 device_for_each_child(&dpc->i2c_adapter.dev, dpc, dpc_check_clients); 132 132 133 133 /* check if all devices are present */ 134 - if( 0 == dpc->saa7111a ) { 134 + if (!dpc->saa7111a) { 135 135 DEB_D(("dpc_v4l2.o: dpc_attach failed for this device.\n")); 136 136 i2c_del_adapter(&dpc->i2c_adapter); 137 137 kfree(dpc);
+1 -1
drivers/media/video/mt20xx.c
··· 647 647 default: 648 648 tuner_info("microtune %s found, not (yet?) supported, sorry :-/\n", 649 649 name); 650 - return 0; 650 + return NULL; 651 651 } 652 652 653 653 strlcpy(fe->ops.tuner_ops.info.name, name,
+2 -3
drivers/media/video/mxb.c
··· 221 221 device_for_each_child(&mxb->i2c_adapter.dev, mxb, mxb_check_clients); 222 222 223 223 /* check if all devices are present */ 224 - if( 0 == mxb->tea6420_1 || 0 == mxb->tea6420_2 || 0 == mxb->tea6415c 225 - || 0 == mxb->tda9840 || 0 == mxb->saa7111a || 0 == mxb->tuner ) { 226 - 224 + if (!mxb->tea6420_1 || !mxb->tea6420_2 || !mxb->tea6415c || 225 + !mxb->tda9840 || !mxb->saa7111a || !mxb->tuner) { 227 226 printk("mxb: did not find all i2c devices. aborting\n"); 228 227 i2c_del_adapter(&mxb->i2c_adapter); 229 228 kfree(mxb);
+2 -2
drivers/media/video/pvrusb2/pvrusb2-ctrl.c
··· 60 60 int ret = 0; 61 61 if (!cptr) return -EINVAL; 62 62 LOCK_TAKE(cptr->hdw->big_lock); do { 63 - if (cptr->info->set_value != 0) { 63 + if (cptr->info->set_value) { 64 64 if (cptr->info->type == pvr2_ctl_bitmask) { 65 65 mask &= cptr->info->def.type_bitmask.valid_bits; 66 66 } else if (cptr->info->type == pvr2_ctl_int) { ··· 265 265 int pvr2_ctrl_is_writable(struct pvr2_ctrl *cptr) 266 266 { 267 267 if (!cptr) return 0; 268 - return cptr->info->set_value != 0; 268 + return cptr->info->set_value != NULL; 269 269 } 270 270 271 271
+3 -3
drivers/media/video/pvrusb2/pvrusb2-hdw.c
··· 2291 2291 2292 2292 for (idx = 0; idx < hdw->control_cnt; idx++) { 2293 2293 cptr = hdw->controls + idx; 2294 - if (cptr->info->is_dirty == 0) continue; 2294 + if (!cptr->info->is_dirty) continue; 2295 2295 if (!cptr->info->is_dirty(cptr)) continue; 2296 2296 commit_flag = !0; 2297 2297 ··· 2646 2646 u16 address; 2647 2647 unsigned int pipe; 2648 2648 LOCK_TAKE(hdw->big_lock); do { 2649 - if ((hdw->fw_buffer == 0) == !enable_flag) break; 2649 + if ((hdw->fw_buffer == NULL) == !enable_flag) break; 2650 2650 2651 2651 if (!enable_flag) { 2652 2652 pvr2_trace(PVR2_TRACE_FIRMWARE, ··· 2715 2715 /* Return true if we're in a mode for retrieval CPU firmware */ 2716 2716 int pvr2_hdw_cpufw_get_enabled(struct pvr2_hdw *hdw) 2717 2717 { 2718 - return hdw->fw_buffer != 0; 2718 + return hdw->fw_buffer != NULL; 2719 2719 } 2720 2720 2721 2721
+1 -1
drivers/media/video/pvrusb2/pvrusb2-io.c
··· 563 563 struct pvr2_buffer *bp; 564 564 mutex_lock(&sp->mutex); do { 565 565 pvr2_stream_internal_flush(sp); 566 - while ((bp = pvr2_stream_get_ready_buffer(sp)) != 0) { 566 + while ((bp = pvr2_stream_get_ready_buffer(sp)) != NULL) { 567 567 pvr2_buffer_set_idle(bp); 568 568 } 569 569 if (sp->buffer_total_count != sp->buffer_target_count) {
+1 -1
drivers/media/video/pvrusb2/pvrusb2-ioread.c
··· 165 165 if (!(cp->stream)) return 0; 166 166 pvr2_trace(PVR2_TRACE_START_STOP, 167 167 "/*---TRACE_READ---*/ pvr2_ioread_start id=%p",cp); 168 - while ((bp = pvr2_stream_get_idle_buffer(cp->stream)) != 0) { 168 + while ((bp = pvr2_stream_get_idle_buffer(cp->stream)) != NULL) { 169 169 stat = pvr2_buffer_queue(bp); 170 170 if (stat < 0) { 171 171 pvr2_trace(PVR2_TRACE_DATA_FLOW,
+3 -4
drivers/media/video/pwc/pwc-if.c
··· 915 915 struct urb *urb; 916 916 917 917 urb = pdev->sbuf[i].urb; 918 - if (urb != 0) { 918 + if (urb) { 919 919 PWC_DEBUG_MEMORY("Unlinking URB %p\n", urb); 920 920 usb_kill_urb(urb); 921 921 } ··· 931 931 struct urb *urb; 932 932 933 933 urb = pdev->sbuf[i].urb; 934 - if (urb != 0) { 934 + if (urb) { 935 935 PWC_DEBUG_MEMORY("Freeing URB\n"); 936 936 usb_free_urb(urb); 937 937 pdev->sbuf[i].urb = NULL; ··· 1759 1759 1760 1760 /* Allocate video_device structure */ 1761 1761 pdev->vdev = video_device_alloc(); 1762 - if (pdev->vdev == 0) 1763 - { 1762 + if (!pdev->vdev) { 1764 1763 PWC_ERROR("Err, cannot allocate video_device struture. Failing probe."); 1765 1764 kfree(pdev); 1766 1765 return -ENOMEM;
+2 -2
drivers/media/video/saa7110.c
··· 488 488 return 0; 489 489 490 490 client = kzalloc(sizeof(struct i2c_client), GFP_KERNEL); 491 - if (client == 0) 491 + if (!client) 492 492 return -ENOMEM; 493 493 client->addr = address; 494 494 client->adapter = adapter; ··· 496 496 strlcpy(I2C_NAME(client), "saa7110", sizeof(I2C_NAME(client))); 497 497 498 498 decoder = kzalloc(sizeof(struct saa7110), GFP_KERNEL); 499 - if (decoder == 0) { 499 + if (!decoder) { 500 500 kfree(client); 501 501 return -ENOMEM; 502 502 }
+1 -1
drivers/media/video/saa7111.c
··· 502 502 return 0; 503 503 504 504 client = kzalloc(sizeof(struct i2c_client), GFP_KERNEL); 505 - if (client == 0) 505 + if (!client) 506 506 return -ENOMEM; 507 507 client->addr = address; 508 508 client->adapter = adapter;
+1 -1
drivers/media/video/saa7114.c
··· 841 841 return 0; 842 842 843 843 client = kzalloc(sizeof(struct i2c_client), GFP_KERNEL); 844 - if (client == 0) 844 + if (!client) 845 845 return -ENOMEM; 846 846 client->addr = address; 847 847 client->adapter = adapter;
+1 -1
drivers/media/video/saa7185.c
··· 403 403 return 0; 404 404 405 405 client = kzalloc(sizeof(struct i2c_client), GFP_KERNEL); 406 - if (client == 0) 406 + if (!client) 407 407 return -ENOMEM; 408 408 client->addr = address; 409 409 client->adapter = adapter;
+1 -1
drivers/media/video/tda9840.c
··· 172 172 173 173 /* allocate memory for client structure */ 174 174 client = kmalloc(sizeof(struct i2c_client), GFP_KERNEL); 175 - if (0 == client) { 175 + if (!client) { 176 176 printk("not enough kernel memory\n"); 177 177 return -ENOMEM; 178 178 }
+1 -1
drivers/media/video/tea6415c.c
··· 64 64 65 65 /* allocate memory for client structure */ 66 66 client = kmalloc(sizeof(struct i2c_client), GFP_KERNEL); 67 - if (0 == client) { 67 + if (!client) { 68 68 return -ENOMEM; 69 69 } 70 70
+1 -1
drivers/media/video/tea6420.c
··· 101 101 102 102 /* allocate memory for client structure */ 103 103 client = kzalloc(sizeof(struct i2c_client), GFP_KERNEL); 104 - if (0 == client) { 104 + if (!client) { 105 105 return -ENOMEM; 106 106 } 107 107
+2 -2
drivers/media/video/tvp5150.c
··· 1072 1072 return 0; 1073 1073 1074 1074 c = kmalloc(sizeof(struct i2c_client), GFP_KERNEL); 1075 - if (c == 0) 1075 + if (!c) 1076 1076 return -ENOMEM; 1077 1077 memcpy(c, &client_template, sizeof(struct i2c_client)); 1078 1078 1079 1079 core = kzalloc(sizeof(struct tvp5150), GFP_KERNEL); 1080 - if (core == 0) { 1080 + if (!core) { 1081 1081 kfree(c); 1082 1082 return -ENOMEM; 1083 1083 }
+1 -1
drivers/media/video/zoran_driver.c
··· 339 339 /* Use kmalloc */ 340 340 341 341 mem = kmalloc(fh->v4l_buffers.buffer_size, GFP_KERNEL); 342 - if (mem == 0) { 342 + if (!mem) { 343 343 dprintk(1, 344 344 KERN_ERR 345 345 "%s: v4l_fbuffer_alloc() - kmalloc for V4L buf %d failed\n",