diff options
author | Tomas Winkler <tomas.winkler@intel.com> | 2011-03-02 17:10:51 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2011-03-07 16:24:04 -0500 |
commit | 6888393c43c95a40d551989e89cbf572423619e6 (patch) | |
tree | 552fd21ec3c653ff4ca0a86be70cd5e5fe4155f7 /drivers/staging/easycap/easycap_sound.c | |
parent | febd32bcfd09aeb543b229fd2896814a26d74d20 (diff) |
staging/easycap: convert comparison to NULL into boolean
convert if (NULL != ptr) to if (ptr)
convert if (NULL == ptr) to if (!ptr)
Cc: Mike Thomas <rmthomas@sciolus.org>
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/staging/easycap/easycap_sound.c')
-rw-r--r-- | drivers/staging/easycap/easycap_sound.c | 80 |
1 files changed, 40 insertions, 40 deletions
diff --git a/drivers/staging/easycap/easycap_sound.c b/drivers/staging/easycap/easycap_sound.c index d0ef7af8151..5829e26969d 100644 --- a/drivers/staging/easycap/easycap_sound.c +++ b/drivers/staging/easycap/easycap_sound.c | |||
@@ -83,12 +83,12 @@ easycap_alsa_complete(struct urb *purb) | |||
83 | 83 | ||
84 | JOT(16, "\n"); | 84 | JOT(16, "\n"); |
85 | 85 | ||
86 | if (NULL == purb) { | 86 | if (!purb) { |
87 | SAY("ERROR: purb is NULL\n"); | 87 | SAY("ERROR: purb is NULL\n"); |
88 | return; | 88 | return; |
89 | } | 89 | } |
90 | peasycap = purb->context; | 90 | peasycap = purb->context; |
91 | if (NULL == peasycap) { | 91 | if (!peasycap) { |
92 | SAY("ERROR: peasycap is NULL\n"); | 92 | SAY("ERROR: peasycap is NULL\n"); |
93 | return; | 93 | return; |
94 | } | 94 | } |
@@ -105,10 +105,10 @@ easycap_alsa_complete(struct urb *purb) | |||
105 | } | 105 | } |
106 | /*---------------------------------------------------------------------------*/ | 106 | /*---------------------------------------------------------------------------*/ |
107 | pss = peasycap->psubstream; | 107 | pss = peasycap->psubstream; |
108 | if (NULL == pss) | 108 | if (!pss) |
109 | goto resubmit; | 109 | goto resubmit; |
110 | prt = pss->runtime; | 110 | prt = pss->runtime; |
111 | if (NULL == prt) | 111 | if (!prt) |
112 | goto resubmit; | 112 | goto resubmit; |
113 | dma_bytes = (int)prt->dma_bytes; | 113 | dma_bytes = (int)prt->dma_bytes; |
114 | if (0 == dma_bytes) | 114 | if (0 == dma_bytes) |
@@ -294,23 +294,23 @@ static int easycap_alsa_open(struct snd_pcm_substream *pss) | |||
294 | struct easycap *peasycap; | 294 | struct easycap *peasycap; |
295 | 295 | ||
296 | JOT(4, "\n"); | 296 | JOT(4, "\n"); |
297 | if (NULL == pss) { | 297 | if (!pss) { |
298 | SAY("ERROR: pss is NULL\n"); | 298 | SAY("ERROR: pss is NULL\n"); |
299 | return -EFAULT; | 299 | return -EFAULT; |
300 | } | 300 | } |
301 | psnd_pcm = pss->pcm; | 301 | psnd_pcm = pss->pcm; |
302 | if (NULL == psnd_pcm) { | 302 | if (!psnd_pcm) { |
303 | SAY("ERROR: psnd_pcm is NULL\n"); | 303 | SAY("ERROR: psnd_pcm is NULL\n"); |
304 | return -EFAULT; | 304 | return -EFAULT; |
305 | } | 305 | } |
306 | psnd_card = psnd_pcm->card; | 306 | psnd_card = psnd_pcm->card; |
307 | if (NULL == psnd_card) { | 307 | if (!psnd_card) { |
308 | SAY("ERROR: psnd_card is NULL\n"); | 308 | SAY("ERROR: psnd_card is NULL\n"); |
309 | return -EFAULT; | 309 | return -EFAULT; |
310 | } | 310 | } |
311 | 311 | ||
312 | peasycap = psnd_card->private_data; | 312 | peasycap = psnd_card->private_data; |
313 | if (NULL == peasycap) { | 313 | if (!peasycap) { |
314 | SAY("ERROR: peasycap is NULL\n"); | 314 | SAY("ERROR: peasycap is NULL\n"); |
315 | return -EFAULT; | 315 | return -EFAULT; |
316 | } | 316 | } |
@@ -322,7 +322,7 @@ static int easycap_alsa_open(struct snd_pcm_substream *pss) | |||
322 | SAM("ERROR: bad peasycap->psnd_card\n"); | 322 | SAM("ERROR: bad peasycap->psnd_card\n"); |
323 | return -EFAULT; | 323 | return -EFAULT; |
324 | } | 324 | } |
325 | if (NULL != peasycap->psubstream) { | 325 | if (peasycap->psubstream) { |
326 | SAM("ERROR: bad peasycap->psubstream\n"); | 326 | SAM("ERROR: bad peasycap->psubstream\n"); |
327 | return -EFAULT; | 327 | return -EFAULT; |
328 | } | 328 | } |
@@ -345,12 +345,12 @@ static int easycap_alsa_close(struct snd_pcm_substream *pss) | |||
345 | struct easycap *peasycap; | 345 | struct easycap *peasycap; |
346 | 346 | ||
347 | JOT(4, "\n"); | 347 | JOT(4, "\n"); |
348 | if (NULL == pss) { | 348 | if (!pss) { |
349 | SAY("ERROR: pss is NULL\n"); | 349 | SAY("ERROR: pss is NULL\n"); |
350 | return -EFAULT; | 350 | return -EFAULT; |
351 | } | 351 | } |
352 | peasycap = snd_pcm_substream_chip(pss); | 352 | peasycap = snd_pcm_substream_chip(pss); |
353 | if (NULL == peasycap) { | 353 | if (!peasycap) { |
354 | SAY("ERROR: peasycap is NULL\n"); | 354 | SAY("ERROR: peasycap is NULL\n"); |
355 | return -EFAULT; | 355 | return -EFAULT; |
356 | } | 356 | } |
@@ -369,12 +369,12 @@ static int easycap_alsa_vmalloc(struct snd_pcm_substream *pss, size_t sz) | |||
369 | struct snd_pcm_runtime *prt; | 369 | struct snd_pcm_runtime *prt; |
370 | JOT(4, "\n"); | 370 | JOT(4, "\n"); |
371 | 371 | ||
372 | if (NULL == pss) { | 372 | if (!pss) { |
373 | SAY("ERROR: pss is NULL\n"); | 373 | SAY("ERROR: pss is NULL\n"); |
374 | return -EFAULT; | 374 | return -EFAULT; |
375 | } | 375 | } |
376 | prt = pss->runtime; | 376 | prt = pss->runtime; |
377 | if (NULL == prt) { | 377 | if (!prt) { |
378 | SAY("ERROR: substream.runtime is NULL\n"); | 378 | SAY("ERROR: substream.runtime is NULL\n"); |
379 | return -EFAULT; | 379 | return -EFAULT; |
380 | } | 380 | } |
@@ -384,7 +384,7 @@ static int easycap_alsa_vmalloc(struct snd_pcm_substream *pss, size_t sz) | |||
384 | vfree(prt->dma_area); | 384 | vfree(prt->dma_area); |
385 | } | 385 | } |
386 | prt->dma_area = vmalloc(sz); | 386 | prt->dma_area = vmalloc(sz); |
387 | if (NULL == prt->dma_area) | 387 | if (!prt->dma_area) |
388 | return -ENOMEM; | 388 | return -ENOMEM; |
389 | prt->dma_bytes = sz; | 389 | prt->dma_bytes = sz; |
390 | return 0; | 390 | return 0; |
@@ -396,7 +396,7 @@ static int easycap_alsa_hw_params(struct snd_pcm_substream *pss, | |||
396 | int rc; | 396 | int rc; |
397 | 397 | ||
398 | JOT(4, "%i\n", (params_buffer_bytes(phw))); | 398 | JOT(4, "%i\n", (params_buffer_bytes(phw))); |
399 | if (NULL == pss) { | 399 | if (!pss) { |
400 | SAY("ERROR: pss is NULL\n"); | 400 | SAY("ERROR: pss is NULL\n"); |
401 | return -EFAULT; | 401 | return -EFAULT; |
402 | } | 402 | } |
@@ -411,16 +411,16 @@ static int easycap_alsa_hw_free(struct snd_pcm_substream *pss) | |||
411 | struct snd_pcm_runtime *prt; | 411 | struct snd_pcm_runtime *prt; |
412 | JOT(4, "\n"); | 412 | JOT(4, "\n"); |
413 | 413 | ||
414 | if (NULL == pss) { | 414 | if (!pss) { |
415 | SAY("ERROR: pss is NULL\n"); | 415 | SAY("ERROR: pss is NULL\n"); |
416 | return -EFAULT; | 416 | return -EFAULT; |
417 | } | 417 | } |
418 | prt = pss->runtime; | 418 | prt = pss->runtime; |
419 | if (NULL == prt) { | 419 | if (!prt) { |
420 | SAY("ERROR: substream.runtime is NULL\n"); | 420 | SAY("ERROR: substream.runtime is NULL\n"); |
421 | return -EFAULT; | 421 | return -EFAULT; |
422 | } | 422 | } |
423 | if (NULL != prt->dma_area) { | 423 | if (prt->dma_area) { |
424 | JOT(8, "prt->dma_area = %p\n", prt->dma_area); | 424 | JOT(8, "prt->dma_area = %p\n", prt->dma_area); |
425 | vfree(prt->dma_area); | 425 | vfree(prt->dma_area); |
426 | prt->dma_area = NULL; | 426 | prt->dma_area = NULL; |
@@ -435,13 +435,13 @@ static int easycap_alsa_prepare(struct snd_pcm_substream *pss) | |||
435 | struct snd_pcm_runtime *prt; | 435 | struct snd_pcm_runtime *prt; |
436 | 436 | ||
437 | JOT(4, "\n"); | 437 | JOT(4, "\n"); |
438 | if (NULL == pss) { | 438 | if (!pss) { |
439 | SAY("ERROR: pss is NULL\n"); | 439 | SAY("ERROR: pss is NULL\n"); |
440 | return -EFAULT; | 440 | return -EFAULT; |
441 | } | 441 | } |
442 | prt = pss->runtime; | 442 | prt = pss->runtime; |
443 | peasycap = snd_pcm_substream_chip(pss); | 443 | peasycap = snd_pcm_substream_chip(pss); |
444 | if (NULL == peasycap) { | 444 | if (!peasycap) { |
445 | SAY("ERROR: peasycap is NULL\n"); | 445 | SAY("ERROR: peasycap is NULL\n"); |
446 | return -EFAULT; | 446 | return -EFAULT; |
447 | } | 447 | } |
@@ -483,12 +483,12 @@ static int easycap_alsa_trigger(struct snd_pcm_substream *pss, int cmd) | |||
483 | 483 | ||
484 | JOT(4, "%i=cmd cf %i=START %i=STOP\n", cmd, SNDRV_PCM_TRIGGER_START, | 484 | JOT(4, "%i=cmd cf %i=START %i=STOP\n", cmd, SNDRV_PCM_TRIGGER_START, |
485 | SNDRV_PCM_TRIGGER_STOP); | 485 | SNDRV_PCM_TRIGGER_STOP); |
486 | if (NULL == pss) { | 486 | if (!pss) { |
487 | SAY("ERROR: pss is NULL\n"); | 487 | SAY("ERROR: pss is NULL\n"); |
488 | return -EFAULT; | 488 | return -EFAULT; |
489 | } | 489 | } |
490 | peasycap = snd_pcm_substream_chip(pss); | 490 | peasycap = snd_pcm_substream_chip(pss); |
491 | if (NULL == peasycap) { | 491 | if (!peasycap) { |
492 | SAY("ERROR: peasycap is NULL\n"); | 492 | SAY("ERROR: peasycap is NULL\n"); |
493 | return -EFAULT; | 493 | return -EFAULT; |
494 | } | 494 | } |
@@ -518,12 +518,12 @@ static snd_pcm_uframes_t easycap_alsa_pointer(struct snd_pcm_substream *pss) | |||
518 | snd_pcm_uframes_t offset; | 518 | snd_pcm_uframes_t offset; |
519 | 519 | ||
520 | JOT(16, "\n"); | 520 | JOT(16, "\n"); |
521 | if (NULL == pss) { | 521 | if (!pss) { |
522 | SAY("ERROR: pss is NULL\n"); | 522 | SAY("ERROR: pss is NULL\n"); |
523 | return -EFAULT; | 523 | return -EFAULT; |
524 | } | 524 | } |
525 | peasycap = snd_pcm_substream_chip(pss); | 525 | peasycap = snd_pcm_substream_chip(pss); |
526 | if (NULL == peasycap) { | 526 | if (!peasycap) { |
527 | SAY("ERROR: peasycap is NULL\n"); | 527 | SAY("ERROR: peasycap is NULL\n"); |
528 | return -EFAULT; | 528 | return -EFAULT; |
529 | } | 529 | } |
@@ -584,7 +584,7 @@ int easycap_alsa_probe(struct easycap *peasycap) | |||
584 | struct snd_card *psnd_card; | 584 | struct snd_card *psnd_card; |
585 | struct snd_pcm *psnd_pcm; | 585 | struct snd_pcm *psnd_pcm; |
586 | 586 | ||
587 | if (NULL == peasycap) { | 587 | if (!peasycap) { |
588 | SAY("ERROR: peasycap is NULL\n"); | 588 | SAY("ERROR: peasycap is NULL\n"); |
589 | return -ENODEV; | 589 | return -ENODEV; |
590 | } | 590 | } |
@@ -669,11 +669,11 @@ easycap_sound_setup(struct easycap *peasycap) | |||
669 | 669 | ||
670 | JOM(4, "starting initialization\n"); | 670 | JOM(4, "starting initialization\n"); |
671 | 671 | ||
672 | if (NULL == peasycap) { | 672 | if (!peasycap) { |
673 | SAY("ERROR: peasycap is NULL.\n"); | 673 | SAY("ERROR: peasycap is NULL.\n"); |
674 | return -EFAULT; | 674 | return -EFAULT; |
675 | } | 675 | } |
676 | if (NULL == peasycap->pusb_device) { | 676 | if (!peasycap->pusb_device) { |
677 | SAM("ERROR: peasycap->pusb_device is NULL\n"); | 677 | SAM("ERROR: peasycap->pusb_device is NULL\n"); |
678 | return -ENODEV; | 678 | return -ENODEV; |
679 | } | 679 | } |
@@ -682,12 +682,12 @@ easycap_sound_setup(struct easycap *peasycap) | |||
682 | rc = audio_setup(peasycap); | 682 | rc = audio_setup(peasycap); |
683 | JOM(8, "audio_setup() returned %i\n", rc); | 683 | JOM(8, "audio_setup() returned %i\n", rc); |
684 | 684 | ||
685 | if (NULL == peasycap->pusb_device) { | 685 | if (!peasycap->pusb_device) { |
686 | SAM("ERROR: peasycap->pusb_device has become NULL\n"); | 686 | SAM("ERROR: peasycap->pusb_device has become NULL\n"); |
687 | return -ENODEV; | 687 | return -ENODEV; |
688 | } | 688 | } |
689 | /*---------------------------------------------------------------------------*/ | 689 | /*---------------------------------------------------------------------------*/ |
690 | if (NULL == peasycap->pusb_device) { | 690 | if (!peasycap->pusb_device) { |
691 | SAM("ERROR: peasycap->pusb_device has become NULL\n"); | 691 | SAM("ERROR: peasycap->pusb_device has become NULL\n"); |
692 | return -ENODEV; | 692 | return -ENODEV; |
693 | } | 693 | } |
@@ -725,15 +725,15 @@ submit_audio_urbs(struct easycap *peasycap) | |||
725 | int j, isbad, nospc, m, rc; | 725 | int j, isbad, nospc, m, rc; |
726 | int isbuf; | 726 | int isbuf; |
727 | 727 | ||
728 | if (NULL == peasycap) { | 728 | if (!peasycap) { |
729 | SAY("ERROR: peasycap is NULL\n"); | 729 | SAY("ERROR: peasycap is NULL\n"); |
730 | return -EFAULT; | 730 | return -EFAULT; |
731 | } | 731 | } |
732 | if (NULL == peasycap->purb_audio_head) { | 732 | if (!peasycap->purb_audio_head) { |
733 | SAM("ERROR: peasycap->urb_audio_head uninitialized\n"); | 733 | SAM("ERROR: peasycap->urb_audio_head uninitialized\n"); |
734 | return -EFAULT; | 734 | return -EFAULT; |
735 | } | 735 | } |
736 | if (NULL == peasycap->pusb_device) { | 736 | if (!peasycap->pusb_device) { |
737 | SAM("ERROR: peasycap->pusb_device is NULL\n"); | 737 | SAM("ERROR: peasycap->pusb_device is NULL\n"); |
738 | return -EFAULT; | 738 | return -EFAULT; |
739 | } | 739 | } |
@@ -751,9 +751,9 @@ submit_audio_urbs(struct easycap *peasycap) | |||
751 | m = 0; | 751 | m = 0; |
752 | list_for_each(plist_head, (peasycap->purb_audio_head)) { | 752 | list_for_each(plist_head, (peasycap->purb_audio_head)) { |
753 | pdata_urb = list_entry(plist_head, struct data_urb, list_head); | 753 | pdata_urb = list_entry(plist_head, struct data_urb, list_head); |
754 | if (NULL != pdata_urb) { | 754 | if (pdata_urb) { |
755 | purb = pdata_urb->purb; | 755 | purb = pdata_urb->purb; |
756 | if (NULL != purb) { | 756 | if (purb) { |
757 | isbuf = pdata_urb->isbuf; | 757 | isbuf = pdata_urb->isbuf; |
758 | 758 | ||
759 | purb->interval = 1; | 759 | purb->interval = 1; |
@@ -801,9 +801,9 @@ submit_audio_urbs(struct easycap *peasycap) | |||
801 | JOM(4, "attempting cleanup instead of submitting\n"); | 801 | JOM(4, "attempting cleanup instead of submitting\n"); |
802 | list_for_each(plist_head, (peasycap->purb_audio_head)) { | 802 | list_for_each(plist_head, (peasycap->purb_audio_head)) { |
803 | pdata_urb = list_entry(plist_head, struct data_urb, list_head); | 803 | pdata_urb = list_entry(plist_head, struct data_urb, list_head); |
804 | if (NULL != pdata_urb) { | 804 | if (pdata_urb) { |
805 | purb = pdata_urb->purb; | 805 | purb = pdata_urb->purb; |
806 | if (NULL != purb) | 806 | if (purb) |
807 | usb_kill_urb(purb); | 807 | usb_kill_urb(purb); |
808 | } | 808 | } |
809 | } | 809 | } |
@@ -830,19 +830,19 @@ kill_audio_urbs(struct easycap *peasycap) | |||
830 | struct list_head *plist_head; | 830 | struct list_head *plist_head; |
831 | struct data_urb *pdata_urb; | 831 | struct data_urb *pdata_urb; |
832 | 832 | ||
833 | if (NULL == peasycap) { | 833 | if (!peasycap) { |
834 | SAY("ERROR: peasycap is NULL\n"); | 834 | SAY("ERROR: peasycap is NULL\n"); |
835 | return -EFAULT; | 835 | return -EFAULT; |
836 | } | 836 | } |
837 | if (peasycap->audio_isoc_streaming) { | 837 | if (peasycap->audio_isoc_streaming) { |
838 | if (NULL != peasycap->purb_audio_head) { | 838 | if (peasycap->purb_audio_head) { |
839 | peasycap->audio_isoc_streaming = 0; | 839 | peasycap->audio_isoc_streaming = 0; |
840 | JOM(4, "killing audio urbs\n"); | 840 | JOM(4, "killing audio urbs\n"); |
841 | m = 0; | 841 | m = 0; |
842 | list_for_each(plist_head, (peasycap->purb_audio_head)) { | 842 | list_for_each(plist_head, (peasycap->purb_audio_head)) { |
843 | pdata_urb = list_entry(plist_head, struct data_urb, list_head); | 843 | pdata_urb = list_entry(plist_head, struct data_urb, list_head); |
844 | if (NULL != pdata_urb) { | 844 | if (pdata_urb) { |
845 | if (NULL != pdata_urb->purb) { | 845 | if (pdata_urb->purb) { |
846 | usb_kill_urb(pdata_urb->purb); | 846 | usb_kill_urb(pdata_urb->purb); |
847 | m++; | 847 | m++; |
848 | } | 848 | } |