]> Pileus Git - ~andy/linux/commitdiff
staging/easycap: convert comparison to NULL into boolean
authorTomas Winkler <tomas.winkler@intel.com>
Wed, 2 Mar 2011 22:10:51 +0000 (00:10 +0200)
committerGreg Kroah-Hartman <gregkh@suse.de>
Mon, 7 Mar 2011 21:24:04 +0000 (13:24 -0800)
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>
drivers/staging/easycap/easycap_ioctl.c
drivers/staging/easycap/easycap_low.c
drivers/staging/easycap/easycap_main.c
drivers/staging/easycap/easycap_sound.c
drivers/staging/easycap/easycap_sound_oss.c
drivers/staging/easycap/easycap_testcard.c

index c2f5a78f6db498e1d7d7dbeb64a53f5bb74bcf65..64e7ecd4169f0743b425ae8034641205e05c3540 100644 (file)
@@ -48,11 +48,11 @@ int adjust_standard(struct easycap *peasycap, v4l2_std_id std_id)
        unsigned int itwas, isnow;
        bool resubmit;
 
-       if (NULL == peasycap) {
+       if (!peasycap) {
                SAY("ERROR: peasycap is NULL\n");
                return -EFAULT;
        }
-       if (NULL == peasycap->pusb_device) {
+       if (!peasycap->pusb_device) {
                SAM("ERROR: peasycap->pusb_device is NULL\n");
                return -EFAULT;
        }
@@ -370,7 +370,7 @@ int adjust_format(struct easycap *peasycap,
        u32 uc;
        bool resubmit;
 
-       if (NULL == peasycap) {
+       if (!peasycap) {
                SAY("ERROR: peasycap is NULL\n");
                return -EFAULT;
        }
@@ -379,7 +379,7 @@ int adjust_format(struct easycap *peasycap,
                return -EBUSY;
        }
        p = peasycap->pusb_device;
-       if (NULL == p) {
+       if (!p) {
                SAM("ERROR: peaycap->pusb_device is NULL\n");
                return -EFAULT;
        }
@@ -491,7 +491,7 @@ int adjust_format(struct easycap *peasycap,
                        return peasycap->format_offset;
                }
        }
-       if (NULL == peasycap_best_format) {
+       if (!peasycap_best_format) {
                SAM("MISTAKE: peasycap_best_format is NULL");
                return -EINVAL;
        }
@@ -632,11 +632,11 @@ int adjust_brightness(struct easycap *peasycap, int value)
        unsigned int mood;
        int i1, k;
 
-       if (NULL == peasycap) {
+       if (!peasycap) {
                SAY("ERROR: peasycap is NULL\n");
                return -EFAULT;
        }
-       if (NULL == peasycap->pusb_device) {
+       if (!peasycap->pusb_device) {
                SAM("ERROR: peasycap->pusb_device is NULL\n");
                return -EFAULT;
        }
@@ -689,11 +689,11 @@ int adjust_contrast(struct easycap *peasycap, int value)
        unsigned int mood;
        int i1, k;
 
-       if (NULL == peasycap) {
+       if (!peasycap) {
                SAY("ERROR: peasycap is NULL\n");
                return -EFAULT;
        }
-       if (NULL == peasycap->pusb_device) {
+       if (!peasycap->pusb_device) {
                SAM("ERROR: peasycap->pusb_device is NULL\n");
                return -EFAULT;
        }
@@ -747,11 +747,11 @@ int adjust_saturation(struct easycap *peasycap, int value)
        unsigned int mood;
        int i1, k;
 
-       if (NULL == peasycap) {
+       if (!peasycap) {
                SAY("ERROR: peasycap is NULL\n");
                return -EFAULT;
        }
-       if (NULL == peasycap->pusb_device) {
+       if (!peasycap->pusb_device) {
                SAM("ERROR: peasycap->pusb_device is NULL\n");
                return -EFAULT;
        }
@@ -805,11 +805,11 @@ int adjust_hue(struct easycap *peasycap, int value)
        unsigned int mood;
        int i1, i2, k;
 
-       if (NULL == peasycap) {
+       if (!peasycap) {
                SAY("ERROR: peasycap is NULL\n");
                return -EFAULT;
        }
-       if (NULL == peasycap->pusb_device) {
+       if (!peasycap->pusb_device) {
                SAM("ERROR: peasycap->pusb_device is NULL\n");
                return -EFAULT;
        }
@@ -859,11 +859,11 @@ int adjust_volume(struct easycap *peasycap, int value)
        s8 mood;
        int i1;
 
-       if (NULL == peasycap) {
+       if (!peasycap) {
                SAY("ERROR: peasycap is NULL\n");
                return -EFAULT;
        }
-       if (NULL == peasycap->pusb_device) {
+       if (!peasycap->pusb_device) {
                SAM("ERROR: peasycap->pusb_device is NULL\n");
                return -EFAULT;
        }
@@ -916,11 +916,11 @@ static int adjust_mute(struct easycap *peasycap, int value)
 {
        int i1;
 
-       if (NULL == peasycap) {
+       if (!peasycap) {
                SAY("ERROR: peasycap is NULL\n");
                return -EFAULT;
        }
-       if (NULL == peasycap->pusb_device) {
+       if (!peasycap->pusb_device) {
                SAM("ERROR: peasycap->pusb_device is NULL\n");
                return -EFAULT;
        }
@@ -958,12 +958,12 @@ long easycap_unlocked_ioctl(struct file *file,
        struct usb_device *p;
        int kd;
 
-       if (NULL == file) {
+       if (!file) {
                SAY("ERROR:  file is NULL\n");
                return -ERESTARTSYS;
        }
        peasycap = file->private_data;
-       if (NULL == peasycap) {
+       if (!peasycap) {
                SAY("ERROR:  peasycap is NULL\n");
                return -1;
        }
@@ -972,7 +972,7 @@ long easycap_unlocked_ioctl(struct file *file,
                return -EFAULT;
        }
        p = peasycap->pusb_device;
-       if (NULL == p) {
+       if (!p) {
                SAM("ERROR: peasycap->pusb_device is NULL\n");
                return -EFAULT;
        }
@@ -993,13 +993,13 @@ long easycap_unlocked_ioctl(struct file *file,
 /*---------------------------------------------------------------------------*/
                if (kd != isdongle(peasycap))
                        return -ERESTARTSYS;
-               if (NULL == file) {
+               if (!file) {
                        SAY("ERROR:  file is NULL\n");
                        mutex_unlock(&easycapdc60_dongle[kd].mutex_video);
                        return -ERESTARTSYS;
                }
                peasycap = file->private_data;
-               if (NULL == peasycap) {
+               if (!peasycap) {
                        SAY("ERROR:  peasycap is NULL\n");
                        mutex_unlock(&easycapdc60_dongle[kd].mutex_video);
                        return -ERESTARTSYS;
@@ -1010,7 +1010,7 @@ long easycap_unlocked_ioctl(struct file *file,
                        return -EFAULT;
                }
                p = peasycap->pusb_device;
-               if (NULL == peasycap->pusb_device) {
+               if (!peasycap->pusb_device) {
                        SAM("ERROR: peasycap->pusb_device is NULL\n");
                        mutex_unlock(&easycapdc60_dongle[kd].mutex_video);
                        return -ERESTARTSYS;
@@ -2325,7 +2325,7 @@ long easycap_unlocked_ioctl(struct file *file,
                peasycap->isequence = 0;
                for (i = 0; i < 180; i++)
                        peasycap->merit[i] = 0;
-               if (NULL == peasycap->pusb_device) {
+               if (!peasycap->pusb_device) {
                        SAM("ERROR: peasycap->pusb_device is NULL\n");
                        mutex_unlock(&easycapdc60_dongle[kd].mutex_video);
                        return -EFAULT;
@@ -2341,7 +2341,7 @@ long easycap_unlocked_ioctl(struct file *file,
        case VIDIOC_STREAMOFF: {
                JOM(8, "VIDIOC_STREAMOFF\n");
 
-               if (NULL == peasycap->pusb_device) {
+               if (!peasycap->pusb_device) {
                        SAM("ERROR: peasycap->pusb_device is NULL\n");
                        mutex_unlock(&easycapdc60_dongle[kd].mutex_video);
                        return -EFAULT;
@@ -2362,7 +2362,7 @@ long easycap_unlocked_ioctl(struct file *file,
                wake_up_interruptible(&(peasycap->wq_audio));
 
 #else
-               if (NULL != peasycap->psubstream)
+               if (peasycap->psubstream)
                        snd_pcm_period_elapsed(peasycap->psubstream);
 #endif /* CONFIG_EASYCAP_OSS */
 /*---------------------------------------------------------------------------*/
index 96270e052f36481538a46946b411e2e824ef1cff..403415ee191d8f6f4d880519af66d9dd35964011 100644 (file)
@@ -330,7 +330,7 @@ int confirm_resolution(struct usb_device *p)
 {
        u8 get0, get1, get2, get3, get4, get5, get6, get7;
 
-       if (NULL == p)
+       if (!p)
                return -ENODEV;
        GET(p, 0x0110, &get0);
        GET(p, 0x0111, &get1);
@@ -371,7 +371,7 @@ int confirm_stream(struct usb_device *p)
        u16 get2;
        u8 igot;
 
-       if (NULL == p)
+       if (!p)
                return -ENODEV;
        GET(p, 0x0100, &igot);  get2 = 0x80 & igot;
        if (0x80 == get2)
@@ -385,7 +385,7 @@ int setup_stk(struct usb_device *p, bool ntsc)
 {
        int i0;
 
-       if (NULL == p)
+       if (!p)
                return -ENODEV;
        i0 = 0;
        if (ntsc) {
@@ -411,7 +411,7 @@ int setup_saa(struct usb_device *p, bool ntsc)
 {
        int i0, ir;
 
-       if (NULL == p)
+       if (!p)
                return -ENODEV;
        i0 = 0;
        if (ntsc) {
@@ -434,7 +434,7 @@ int write_000(struct usb_device *p, u16 set2, u16 set0)
 {
        u8 igot0, igot2;
 
-       if (NULL == p)
+       if (!p)
                return -ENODEV;
        GET(p, 0x0002, &igot2);
        GET(p, 0x0000, &igot0);
@@ -445,7 +445,7 @@ int write_000(struct usb_device *p, u16 set2, u16 set0)
 /****************************************************************************/
 int write_saa(struct usb_device *p, u16 reg0, u16 set0)
 {
-       if (NULL == p)
+       if (!p)
                return -ENODEV;
        SET(p, 0x200, 0x00);
        SET(p, 0x204, reg0);
@@ -470,7 +470,7 @@ write_vt(struct usb_device *p, u16 reg0, u16 set0)
        u16 got502, got503;
        u16 set502, set503;
 
-       if (NULL == p)
+       if (!p)
                return -ENODEV;
        SET(p, 0x0504, reg0);
        SET(p, 0x0500, 0x008B);
@@ -506,7 +506,7 @@ int read_vt(struct usb_device *p, u16 reg0)
        u8 igot;
        u16 got502, got503;
 
-       if (NULL == p)
+       if (!p)
                return -ENODEV;
        SET(p, 0x0504, reg0);
        SET(p, 0x0500, 0x008B);
@@ -527,7 +527,7 @@ int read_vt(struct usb_device *p, u16 reg0)
 /*--------------------------------------------------------------------------*/
 int write_300(struct usb_device *p)
 {
-       if (NULL == p)
+       if (!p)
                return -ENODEV;
        SET(p, 0x300, 0x0012);
        SET(p, 0x350, 0x002D);
@@ -548,7 +548,7 @@ int check_saa(struct usb_device *p, bool ntsc)
 {
        int i0, ir, rc;
 
-       if (NULL == p)
+       if (!p)
                return -ENODEV;
        i0 = 0;
        rc = 0;
@@ -597,7 +597,7 @@ int merit_saa(struct usb_device *p)
 {
        int rc;
 
-       if (NULL == p)
+       if (!p)
                return -ENODEV;
        rc = read_saa(p, 0x1F);
        return ((0 > rc) || (0x02 & rc)) ? 1 : 0;
@@ -615,7 +615,7 @@ int ready_saa(struct usb_device *p)
  *              3     FOR NON-INTERLACED   60 Hz
 */
 /*--------------------------------------------------------------------------*/
-       if (NULL == p)
+       if (!p)
                return -ENODEV;
        j = 0;
        while (max > j) {
@@ -660,7 +660,7 @@ int check_stk(struct usb_device *p, bool ntsc)
 {
        int i0, ir;
 
-       if (NULL == p)
+       if (!p)
                return -ENODEV;
        i0 = 0;
        if (ntsc) {
@@ -731,7 +731,7 @@ int read_saa(struct usb_device *p, u16 reg0)
 {
        u8 igot;
 
-       if (NULL == p)
+       if (!p)
                return -ENODEV;
        SET(p, 0x208, reg0);
        SET(p, 0x200, 0x20);
@@ -746,7 +746,7 @@ int read_stk(struct usb_device *p, u32 reg0)
 {
        u8 igot;
 
-       if (NULL == p)
+       if (!p)
                return -ENODEV;
        igot = 0;
        GET(p, reg0, &igot);
@@ -776,7 +776,7 @@ select_input(struct usb_device *p, int input, int mode)
 {
        int ir;
 
-       if (NULL == p)
+       if (!p)
                return -ENODEV;
        stop_100(p);
        switch (input) {
@@ -879,7 +879,7 @@ int set_resolution(struct usb_device *p,
 {
        u16 u0x0111, u0x0113, u0x0115, u0x0117;
 
-       if (NULL == p)
+       if (!p)
                return -ENODEV;
        u0x0111 = ((0xFF00 & set0) >> 8);
        u0x0113 = ((0xFF00 & set1) >> 8);
@@ -903,7 +903,7 @@ int start_100(struct usb_device *p)
        u16 get116, get117, get0;
        u8 igot116, igot117, igot;
 
-       if (NULL == p)
+       if (!p)
                return -ENODEV;
        GET(p, 0x0116, &igot116);
        get116 = igot116;
@@ -927,7 +927,7 @@ int stop_100(struct usb_device *p)
        u16 get0;
        u8 igot;
 
-       if (NULL == p)
+       if (!p)
                return -ENODEV;
        GET(p, 0x0100, &igot);
        get0 = igot;
@@ -947,7 +947,7 @@ int wait_i2c(struct usb_device *p)
        const int max = 2;
        int k;
 
-       if (NULL == p)
+       if (!p)
                return -ENODEV;
 
        for (k = 0;  k < max;  k++) {
@@ -1000,11 +1000,11 @@ audio_setup(struct easycap *peasycap)
        const u16 index = 0x0301;
        const u16 length = 1;
 
-       if (NULL == peasycap)
+       if (!peasycap)
                return -EFAULT;
 
        pusb_device = peasycap->pusb_device;
-       if (NULL == pusb_device)
+       if (!pusb_device)
                return -ENODEV;
 
        JOM(8, "%02X %02X %02X %02X %02X %02X %02X %02X\n",
@@ -1143,7 +1143,7 @@ int audio_gainset(struct usb_device *pusb_device, s8 loud)
        u8 tmp;
        u16 mute;
 
-       if (NULL == pusb_device)
+       if (!pusb_device)
                return -ENODEV;
        if (0 > loud)
                loud = 0;
@@ -1209,7 +1209,7 @@ int audio_gainget(struct usb_device *pusb_device)
 {
        int igot;
 
-       if (NULL == pusb_device)
+       if (!pusb_device)
                return -ENODEV;
        igot = read_vt(pusb_device, 0x001C);
        if (0 > igot)
index 5c092503f39bc8790af327df316b3adcc0828ec6..d4d58e4bfe78ce8c71e58a44298b8597fcffec1c 100644 (file)
@@ -128,7 +128,7 @@ const char *strerror(int err)
 int isdongle(struct easycap *peasycap)
 {
        int k;
-       if (NULL == peasycap)
+       if (!peasycap)
                return -2;
        for (k = 0; k < DONGLE_MANY; k++) {
                if (easycapdc60_dongle[k].peasycap == peasycap) {
@@ -154,7 +154,7 @@ static int easycap_open(struct inode *inode, struct file *file)
 
 /*---------------------------------------------------------------------------*/
 #ifndef EASYCAP_IS_VIDEODEV_CLIENT
-       if (NULL == inode) {
+       if (!inode) {
                SAY("ERROR: inode is NULL.\n");
                return -EFAULT;
        }
@@ -167,13 +167,13 @@ static int easycap_open(struct inode *inode, struct file *file)
 /*vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv*/
 #else
        pvideo_device = video_devdata(file);
-       if (NULL == pvideo_device) {
+       if (!pvideo_device) {
                SAY("ERROR: pvideo_device is NULL.\n");
                return -EFAULT;
        }
        peasycap = (struct easycap *)video_get_drvdata(pvideo_device);
 #endif /*EASYCAP_IS_VIDEODEV_CLIENT*/
-       if (NULL == peasycap) {
+       if (!peasycap) {
                SAY("ERROR: peasycap is NULL\n");
                return -EFAULT;
        }
@@ -181,7 +181,7 @@ static int easycap_open(struct inode *inode, struct file *file)
                SAY("ERROR: bad peasycap: %p\n", peasycap);
                return -EFAULT;
        }
-       if (NULL == peasycap->pusb_device) {
+       if (!peasycap->pusb_device) {
                SAM("ERROR: peasycap->pusb_device is NULL\n");
                return -EFAULT;
        } else {
@@ -224,7 +224,7 @@ static int reset(struct easycap *peasycap)
        bool ntsc, other;
        int fmtidx;
 
-       if (NULL == peasycap) {
+       if (!peasycap) {
                SAY("ERROR: peasycap is NULL\n");
                return -EFAULT;
        }
@@ -406,7 +406,7 @@ newinput(struct easycap *peasycap, int input)
        int inputnow, video_idlenow, audio_idlenow;
        bool resubmit;
 
-       if (NULL == peasycap) {
+       if (!peasycap) {
                SAY("ERROR: peasycap is NULL\n");
                return -EFAULT;
        }
@@ -437,7 +437,7 @@ newinput(struct easycap *peasycap, int input)
                resubmit = false;
        }
 /*---------------------------------------------------------------------------*/
-       if (NULL == peasycap->pusb_device) {
+       if (!peasycap->pusb_device) {
                SAM("ERROR: peasycap->pusb_device is NULL\n");
                return -ENODEV;
        }
@@ -550,7 +550,7 @@ newinput(struct easycap *peasycap, int input)
                return -ENOENT;
        }
 /*---------------------------------------------------------------------------*/
-       if (NULL == peasycap->pusb_device) {
+       if (!peasycap->pusb_device) {
                SAM("ERROR: peasycap->pusb_device is NULL\n");
                return -ENODEV;
        }
@@ -585,16 +585,16 @@ int submit_video_urbs(struct easycap *peasycap)
        int j, isbad, nospc, m, rc;
        int isbuf;
 
-       if (NULL == peasycap) {
+       if (!peasycap) {
                SAY("ERROR: peasycap is NULL\n");
                return -EFAULT;
        }
 
-       if (NULL == peasycap->purb_video_head) {
+       if (!peasycap->purb_video_head) {
                SAY("ERROR: peasycap->urb_video_head uninitialized\n");
                return -EFAULT;
        }
-       if (NULL == peasycap->pusb_device) {
+       if (!peasycap->pusb_device) {
                SAY("ERROR: peasycap->pusb_device is NULL\n");
                return -ENODEV;
        }
@@ -656,9 +656,9 @@ int submit_video_urbs(struct easycap *peasycap)
                        list_for_each(plist_head, (peasycap->purb_video_head)) {
                                pdata_urb = list_entry(plist_head,
                                                struct data_urb, list_head);
-                               if (NULL != pdata_urb) {
+                               if (pdata_urb) {
                                        purb = pdata_urb->purb;
-                                       if (NULL != purb)
+                                       if (purb)
                                                usb_kill_urb(purb);
                                }
                        }
@@ -679,7 +679,7 @@ int kill_video_urbs(struct easycap *peasycap)
        struct list_head *plist_head;
        struct data_urb *pdata_urb;
 
-       if (NULL == peasycap) {
+       if (!peasycap) {
                SAY("ERROR: peasycap is NULL\n");
                return -EFAULT;
        }
@@ -717,7 +717,7 @@ static int easycap_release(struct inode *inode, struct file *file)
 
 
        peasycap = file->private_data;
-       if (NULL == peasycap) {
+       if (!peasycap) {
                SAY("ERROR:  peasycap is NULL.\n");
                SAY("ending unsuccessfully\n");
                return -EFAULT;
@@ -750,7 +750,7 @@ static int videodev_release(struct video_device *pvideo_device)
        struct easycap *peasycap;
 
        peasycap = video_get_drvdata(pvideo_device);
-       if (NULL == peasycap) {
+       if (!peasycap) {
                SAY("ERROR:  peasycap is NULL\n");
                SAY("ending unsuccessfully\n");
                return -EFAULT;
@@ -793,7 +793,7 @@ static void easycap_delete(struct kref *pkref)
        int registered_video, registered_audio;
 
        peasycap = container_of(pkref, struct easycap, kref);
-       if (NULL == peasycap) {
+       if (!peasycap) {
                SAM("ERROR: peasycap is NULL: cannot perform deletions\n");
                return;
        }
@@ -807,16 +807,16 @@ static void easycap_delete(struct kref *pkref)
  *  FREE VIDEO.
  */
 /*---------------------------------------------------------------------------*/
-       if (NULL != peasycap->purb_video_head) {
+       if (peasycap->purb_video_head) {
                JOM(4, "freeing video urbs\n");
                m = 0;
                list_for_each(plist_head, (peasycap->purb_video_head)) {
                        pdata_urb = list_entry(plist_head,
                                                struct data_urb, list_head);
-                       if (NULL == pdata_urb) {
+                       if (!pdata_urb) {
                                JOM(4, "ERROR: pdata_urb is NULL\n");
                        } else {
-                               if (NULL != pdata_urb->purb) {
+                               if (pdata_urb->purb) {
                                        usb_free_urb(pdata_urb->purb);
                                        pdata_urb->purb = NULL;
                                        peasycap->allocation_video_urb -= 1;
@@ -866,7 +866,7 @@ static void easycap_delete(struct kref *pkref)
        gone = 0;
        for (k = 0;  k < FIELD_BUFFER_MANY;  k++) {
                for (m = 0;  m < FIELD_BUFFER_SIZE/PAGE_SIZE;  m++) {
-                       if (NULL != peasycap->field_buffer[k][m].pgo) {
+                       if (peasycap->field_buffer[k][m].pgo) {
                                free_page((unsigned long)
                                          peasycap->field_buffer[k][m].pgo);
                                peasycap->field_buffer[k][m].pgo = NULL;
@@ -881,7 +881,7 @@ static void easycap_delete(struct kref *pkref)
        gone = 0;
        for (k = 0;  k < FRAME_BUFFER_MANY;  k++) {
                for (m = 0;  m < FRAME_BUFFER_SIZE/PAGE_SIZE;  m++) {
-                       if (NULL != peasycap->frame_buffer[k][m].pgo) {
+                       if (peasycap->frame_buffer[k][m].pgo) {
                                free_page((unsigned long)
                                          peasycap->frame_buffer[k][m].pgo);
                                peasycap->frame_buffer[k][m].pgo = NULL;
@@ -896,16 +896,16 @@ static void easycap_delete(struct kref *pkref)
  *  FREE AUDIO.
  */
 /*---------------------------------------------------------------------------*/
-       if (NULL != peasycap->purb_audio_head) {
+       if (peasycap->purb_audio_head) {
                JOM(4, "freeing audio urbs\n");
                m = 0;
                list_for_each(plist_head, (peasycap->purb_audio_head)) {
                        pdata_urb = list_entry(plist_head,
                                        struct data_urb, list_head);
-                       if (NULL == pdata_urb)
+                       if (!pdata_urb)
                                JOM(4, "ERROR: pdata_urb is NULL\n");
                        else {
-                               if (NULL != pdata_urb->purb) {
+                               if (pdata_urb->purb) {
                                        usb_free_urb(pdata_urb->purb);
                                        pdata_urb->purb = NULL;
                                        peasycap->allocation_audio_urb -= 1;
@@ -937,7 +937,7 @@ static void easycap_delete(struct kref *pkref)
        JOM(4, "freeing audio isoc buffers.\n");
        m = 0;
        for (k = 0;  k < AUDIO_ISOC_BUFFER_MANY;  k++) {
-               if (NULL != peasycap->audio_isoc_buffer[k].pgo) {
+               if (peasycap->audio_isoc_buffer[k].pgo) {
                        free_pages((unsigned long)
                                        (peasycap->audio_isoc_buffer[k].pgo),
                                        AUDIO_ISOC_ORDER);
@@ -954,7 +954,7 @@ static void easycap_delete(struct kref *pkref)
        JOM(4, "freeing audio buffers.\n");
        gone = 0;
        for (k = 0;  k < peasycap->audio_buffer_page_many;  k++) {
-               if (NULL != peasycap->audio_buffer[k].pgo) {
+               if (peasycap->audio_buffer[k].pgo) {
                        free_page((unsigned long)peasycap->audio_buffer[k].pgo);
                        peasycap->audio_buffer[k].pgo = NULL;
                        peasycap->allocation_audio_page -= 1;
@@ -1013,12 +1013,12 @@ static unsigned int easycap_poll(struct file *file, poll_table *wait)
 
        if (NULL == ((poll_table *)wait))
                JOT(8, "WARNING:  poll table pointer is NULL ... continuing\n");
-       if (NULL == file) {
+       if (!file) {
                SAY("ERROR:  file pointer is NULL\n");
                return -ERESTARTSYS;
        }
        peasycap = file->private_data;
-       if (NULL == peasycap) {
+       if (!peasycap) {
                SAY("ERROR:  peasycap is NULL\n");
                return -EFAULT;
        }
@@ -1026,7 +1026,7 @@ static unsigned int easycap_poll(struct file *file, poll_table *wait)
                SAY("ERROR: bad peasycap: %p\n", peasycap);
                return -EFAULT;
        }
-       if (NULL == peasycap->pusb_device) {
+       if (!peasycap->pusb_device) {
                SAY("ERROR:  peasycap->pusb_device is NULL\n");
                return -EFAULT;
        }
@@ -1045,13 +1045,13 @@ static unsigned int easycap_poll(struct file *file, poll_table *wait)
         */
                if (kd != isdongle(peasycap))
                        return -ERESTARTSYS;
-               if (NULL == file) {
+               if (!file) {
                        SAY("ERROR:  file is NULL\n");
                        mutex_unlock(&easycapdc60_dongle[kd].mutex_video);
                        return -ERESTARTSYS;
                }
                peasycap = file->private_data;
-               if (NULL == peasycap) {
+               if (!peasycap) {
                        SAY("ERROR:  peasycap is NULL\n");
                        mutex_unlock(&easycapdc60_dongle[kd].mutex_video);
                        return -ERESTARTSYS;
@@ -1061,7 +1061,7 @@ static unsigned int easycap_poll(struct file *file, poll_table *wait)
                        mutex_unlock(&easycapdc60_dongle[kd].mutex_video);
                        return -ERESTARTSYS;
                }
-               if (NULL == peasycap->pusb_device) {
+               if (!peasycap->pusb_device) {
                        SAM("ERROR: peasycap->pusb_device is NULL\n");
                        mutex_unlock(&easycapdc60_dongle[kd].mutex_video);
                        return -ERESTARTSYS;
@@ -1093,11 +1093,11 @@ int easycap_dqbuf(struct easycap *peasycap, int mode)
        int input, ifield, miss, rc;
 
 
-       if (NULL == peasycap) {
+       if (!peasycap) {
                SAY("ERROR:  peasycap is NULL\n");
                return -EFAULT;
        }
-       if (NULL == peasycap->pusb_device) {
+       if (!peasycap->pusb_device) {
                SAY("ERROR:  peasycap->pusb_device is NULL\n");
                return -EFAULT;
        }
@@ -1321,7 +1321,7 @@ field2frame(struct easycap *peasycap)
        u8 mask, margin;
        bool odd, isuy, decimatepixel, offerfields, badinput;
 
-       if (NULL == peasycap) {
+       if (!peasycap) {
                SAY("ERROR: peasycap is NULL\n");
                return -EFAULT;
        }
@@ -1789,7 +1789,7 @@ redaub(struct easycap *peasycap, void *pad, void *pex, int much, int more,
                JOM(8, "lookup tables are prepared\n");
        }
        pcache = peasycap->pcache;
-       if (NULL == pcache)
+       if (!pcache)
                pcache = &peasycap->cache[0];
 /*---------------------------------------------------------------------------*/
 /*
@@ -2511,7 +2511,7 @@ static void easycap_vma_open(struct vm_area_struct *pvma)
        struct easycap *peasycap;
 
        peasycap = pvma->vm_private_data;
-       if (NULL == peasycap) {
+       if (!peasycap) {
                SAY("ERROR: peasycap is NULL\n");
                return;
        }
@@ -2529,7 +2529,7 @@ static void easycap_vma_close(struct vm_area_struct *pvma)
        struct easycap *peasycap;
 
        peasycap = pvma->vm_private_data;
-       if (NULL == peasycap) {
+       if (!peasycap) {
                SAY("ERROR: peasycap is NULL\n");
                return;
        }
@@ -2551,11 +2551,11 @@ static int easycap_vma_fault(struct vm_area_struct *pvma, struct vm_fault *pvmf)
 
        retcode = VM_FAULT_NOPAGE;
 
-       if (NULL == pvma) {
+       if (!pvma) {
                SAY("pvma is NULL\n");
                return retcode;
        }
-       if (NULL == pvmf) {
+       if (!pvmf) {
                SAY("pvmf is NULL\n");
                return retcode;
        }
@@ -2577,24 +2577,24 @@ static int easycap_vma_fault(struct vm_area_struct *pvma, struct vm_fault *pvmf)
                return retcode;
        }
        peasycap = pvma->vm_private_data;
-       if (NULL == peasycap) {
+       if (!peasycap) {
                SAY("ERROR: peasycap is NULL\n");
                return retcode;
        }
 /*---------------------------------------------------------------------------*/
        pbuf = peasycap->frame_buffer[k][m].pgo;
-       if (NULL == pbuf) {
+       if (!pbuf) {
                SAM("ERROR:  pbuf is NULL\n");
                return retcode;
        }
        page = virt_to_page(pbuf);
-       if (NULL == page) {
+       if (!page) {
                SAM("ERROR:  page is NULL\n");
                return retcode;
        }
        get_page(page);
 /*---------------------------------------------------------------------------*/
-       if (NULL == page) {
+       if (!page) {
                SAM("ERROR:  page is NULL after get_page(page)\n");
        } else {
                pvmf->page = page;
@@ -2615,7 +2615,7 @@ static int easycap_mmap(struct file *file, struct vm_area_struct *pvma)
 
        pvma->vm_ops = &easycap_vm_ops;
        pvma->vm_flags |= VM_RESERVED;
-       if (NULL != file)
+       if (file)
                pvma->vm_private_data = file->private_data;
        easycap_vma_open(pvma);
        return 0;
@@ -2658,12 +2658,12 @@ static void easycap_complete(struct urb *purb)
        int framestatus, framelength, frameactual, frameoffset;
        u8 *pu;
 
-       if (NULL == purb) {
+       if (!purb) {
                SAY("ERROR: easycap_complete(): purb is NULL\n");
                return;
        }
        peasycap = purb->context;
-       if (NULL == peasycap) {
+       if (!peasycap) {
                SAY("ERROR: easycap_complete(): peasycap is NULL\n");
                return;
        }
@@ -3089,12 +3089,12 @@ static int easycap_usb_probe(struct usb_interface *pusb_interface,
        JOT(4, "bNumConfigurations=%i\n", pusb_device->descriptor.bNumConfigurations);
 /*---------------------------------------------------------------------------*/
        pusb_host_interface = pusb_interface->cur_altsetting;
-       if (NULL == pusb_host_interface) {
+       if (!pusb_host_interface) {
                SAY("ERROR: pusb_host_interface is NULL\n");
                return -EFAULT;
        }
        pusb_interface_descriptor = &(pusb_host_interface->desc);
-       if (NULL == pusb_interface_descriptor) {
+       if (!pusb_interface_descriptor) {
                SAY("ERROR: pusb_interface_descriptor is NULL\n");
                return -EFAULT;
        }
@@ -3128,7 +3128,7 @@ static int easycap_usb_probe(struct usb_interface *pusb_interface,
 /*---------------------------------------------------------------------------*/
        if (0 == bInterfaceNumber) {
                peasycap = kzalloc(sizeof(struct easycap), GFP_KERNEL);
-               if (NULL == peasycap) {
+               if (!peasycap) {
                        SAY("ERROR: Could not allocate peasycap\n");
                        return -ENOMEM;
                }
@@ -3166,7 +3166,7 @@ static int easycap_usb_probe(struct usb_interface *pusb_interface,
                */
 /*---------------------------------------------------------------------------*/
                        for (ndong = 0; ndong < DONGLE_MANY; ndong++) {
-                               if ((NULL == easycapdc60_dongle[ndong].peasycap) &&
+                               if ((!easycapdc60_dongle[ndong].peasycap) &&
                                                (!mutex_is_locked(&easycapdc60_dongle
                                                        [ndong].mutex_video)) &&
                                                (!mutex_is_locked(&easycapdc60_dongle
@@ -3346,7 +3346,7 @@ static int easycap_usb_probe(struct usb_interface *pusb_interface,
                                                                bInterfaceNumber);
                        return -ENODEV;
                }
-               if (NULL == peasycap) {
+               if (!peasycap) {
                        SAY("ERROR: peasycap is NULL when probing interface %i\n",
                                                                bInterfaceNumber);
                        return -ENODEV;
@@ -3362,7 +3362,7 @@ static int easycap_usb_probe(struct usb_interface *pusb_interface,
 /*---------------------------------------------------------------------------*/
                if (memcmp(&peasycap->telltale[0], TELLTALE, strlen(TELLTALE))) {
                        pv4l2_device = usb_get_intfdata(pusb_interface);
-                       if (NULL == pv4l2_device) {
+                       if (!pv4l2_device) {
                                SAY("ERROR: pv4l2_device is NULL\n");
                                return -ENODEV;
                        }
@@ -3413,12 +3413,12 @@ static int easycap_usb_probe(struct usb_interface *pusb_interface,
 
        for (i = 0; i < pusb_interface->num_altsetting; i++) {
                pusb_host_interface = &(pusb_interface->altsetting[i]);
-               if (NULL == pusb_host_interface) {
+               if (!pusb_host_interface) {
                        SAM("ERROR: pusb_host_interface is NULL\n");
                        return -EFAULT;
                }
                pusb_interface_descriptor = &(pusb_host_interface->desc);
-               if (NULL == pusb_interface_descriptor) {
+               if (!pusb_interface_descriptor) {
                        SAM("ERROR: pusb_interface_descriptor is NULL\n");
                        return -EFAULT;
                }
@@ -3453,7 +3453,7 @@ static int easycap_usb_probe(struct usb_interface *pusb_interface,
 /*---------------------------------------------------------------------------*/
                for (j = 0; j < pusb_interface_descriptor->bNumEndpoints; j++) {
                        pepd = &(pusb_host_interface->endpoint[j].desc);
-                       if (NULL == pepd) {
+                       if (!pepd) {
                                SAM("ERROR:  pepd is NULL.\n");
                                SAM("...... skipping\n");
                                continue;
@@ -3733,12 +3733,12 @@ static int easycap_usb_probe(struct usb_interface *pusb_interface,
 
                for (k = 0;  k < FRAME_BUFFER_MANY;  k++) {
                        for (m = 0;  m < FRAME_BUFFER_SIZE/PAGE_SIZE;  m++) {
-                               if (NULL != peasycap->frame_buffer[k][m].pgo)
+                               if (peasycap->frame_buffer[k][m].pgo)
                                        SAM("attempting to reallocate frame "
                                                                        " buffers\n");
                                else {
                                        pbuf = (void *)__get_free_page(GFP_KERNEL);
-                                       if (NULL == pbuf) {
+                                       if (!pbuf) {
                                                SAM("ERROR: Could not allocate frame "
                                                        "buffer %i page %i\n", k, m);
                                                return -ENOMEM;
@@ -3763,12 +3763,12 @@ static int easycap_usb_probe(struct usb_interface *pusb_interface,
 
                for (k = 0;  k < FIELD_BUFFER_MANY;  k++) {
                        for (m = 0;  m < FIELD_BUFFER_SIZE/PAGE_SIZE;  m++) {
-                               if (NULL != peasycap->field_buffer[k][m].pgo) {
+                               if (peasycap->field_buffer[k][m].pgo) {
                                        SAM("ERROR: attempting to reallocate "
                                                                "field buffers\n");
                                } else {
                                        pbuf = (void *) __get_free_page(GFP_KERNEL);
-                                       if (NULL == pbuf) {
+                                       if (!pbuf) {
                                                SAM("ERROR: Could not allocate field"
                                                        " buffer %i page %i\n", k, m);
                                                return -ENOMEM;
@@ -3796,7 +3796,7 @@ static int easycap_usb_probe(struct usb_interface *pusb_interface,
                for (k = 0;  k < VIDEO_ISOC_BUFFER_MANY; k++) {
                        pbuf = (void *)__get_free_pages(GFP_KERNEL,
                                                        VIDEO_ISOC_ORDER);
-                       if (NULL == pbuf) {
+                       if (!pbuf) {
                                SAM("ERROR: Could not allocate isoc video buffer "
                                                                        "%i\n", k);
                                return -ENOMEM;
@@ -3827,7 +3827,7 @@ static int easycap_usb_probe(struct usb_interface *pusb_interface,
                for (k = 0;  k < VIDEO_ISOC_BUFFER_MANY; k++) {
                        purb = usb_alloc_urb(peasycap->video_isoc_framesperdesc,
                                                                        GFP_KERNEL);
-                       if (NULL == purb) {
+                       if (!purb) {
                                SAM("ERROR: usb_alloc_urb returned NULL for buffer "
                                                                        "%i\n", k);
                                return -ENOMEM;
@@ -3835,7 +3835,7 @@ static int easycap_usb_probe(struct usb_interface *pusb_interface,
                                peasycap->allocation_video_urb += 1;
 /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
                        pdata_urb = kzalloc(sizeof(struct data_urb), GFP_KERNEL);
-                       if (NULL == pdata_urb) {
+                       if (!pdata_urb) {
                                SAM("ERROR: Could not allocate struct data_urb.\n");
                                return -ENOMEM;
                        } else
@@ -4118,11 +4118,11 @@ static int easycap_usb_probe(struct usb_interface *pusb_interface,
                                                peasycap->audio_buffer_page_many);
 
                for (k = 0;  k < peasycap->audio_buffer_page_many;  k++) {
-                       if (NULL != peasycap->audio_buffer[k].pgo) {
+                       if (peasycap->audio_buffer[k].pgo) {
                                SAM("ERROR: attempting to reallocate audio buffers\n");
                        } else {
                                pbuf = (void *) __get_free_page(GFP_KERNEL);
-                               if (NULL == pbuf) {
+                               if (!pbuf) {
                                        SAM("ERROR: Could not allocate audio "
                                                                "buffer page %i\n", k);
                                        return -ENOMEM;
@@ -4147,7 +4147,7 @@ static int easycap_usb_probe(struct usb_interface *pusb_interface,
                for (k = 0;  k < AUDIO_ISOC_BUFFER_MANY;  k++) {
                        pbuf = (void *)__get_free_pages(GFP_KERNEL,
                                                        AUDIO_ISOC_ORDER);
-                       if (NULL == pbuf) {
+                       if (!pbuf) {
                                SAM("ERROR: Could not allocate isoc audio buffer "
                                                                "%i\n", k);
                                return -ENOMEM;
@@ -4177,7 +4177,7 @@ static int easycap_usb_probe(struct usb_interface *pusb_interface,
                for (k = 0;  k < AUDIO_ISOC_BUFFER_MANY; k++) {
                        purb = usb_alloc_urb(peasycap->audio_isoc_framesperdesc,
                                                                GFP_KERNEL);
-                       if (NULL == purb) {
+                       if (!purb) {
                                SAM("ERROR: usb_alloc_urb returned NULL for buffer "
                                                                "%i\n", k);
                                return -ENOMEM;
@@ -4185,7 +4185,7 @@ static int easycap_usb_probe(struct usb_interface *pusb_interface,
                        peasycap->allocation_audio_urb += 1 ;
 /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
                        pdata_urb = kzalloc(sizeof(struct data_urb), GFP_KERNEL);
-                       if (NULL == pdata_urb) {
+                       if (!pdata_urb) {
                                SAM("ERROR: Could not allocate struct data_urb.\n");
                                return -ENOMEM;
                        }
@@ -4339,12 +4339,12 @@ static void easycap_usb_disconnect(struct usb_interface *pusb_interface)
        JOT(4, "\n");
 
        pusb_host_interface = pusb_interface->cur_altsetting;
-       if (NULL == pusb_host_interface) {
+       if (!pusb_host_interface) {
                JOT(4, "ERROR: pusb_host_interface is NULL\n");
                return;
        }
        pusb_interface_descriptor = &(pusb_host_interface->desc);
-       if (NULL == pusb_interface_descriptor) {
+       if (!pusb_interface_descriptor) {
                JOT(4, "ERROR: pusb_interface_descriptor is NULL\n");
                return;
        }
@@ -4356,7 +4356,7 @@ static void easycap_usb_disconnect(struct usb_interface *pusb_interface)
                return;
 
        peasycap = usb_get_intfdata(pusb_interface);
-       if (NULL == peasycap) {
+       if (!peasycap) {
                SAY("ERROR: peasycap is NULL\n");
                return;
        }
@@ -4372,7 +4372,7 @@ static void easycap_usb_disconnect(struct usb_interface *pusb_interface)
 /*---------------------------------------------------------------------------*/
        if (memcmp(&peasycap->telltale[0], TELLTALE, strlen(TELLTALE))) {
                pv4l2_device = usb_get_intfdata(pusb_interface);
-               if (NULL == pv4l2_device) {
+               if (!pv4l2_device) {
                        SAY("ERROR: pv4l2_device is NULL\n");
                        return;
                }
@@ -4398,14 +4398,14 @@ static void easycap_usb_disconnect(struct usb_interface *pusb_interface)
 /*---------------------------------------------------------------------------*/
        switch (bInterfaceNumber) {
        case 0: {
-               if (NULL != peasycap->purb_video_head) {
+               if (peasycap->purb_video_head) {
                        JOM(4, "killing video urbs\n");
                        m = 0;
                        list_for_each(plist_head, peasycap->purb_video_head) {
                                pdata_urb = list_entry(plist_head,
                                                struct data_urb, list_head);
-                               if (NULL != pdata_urb) {
-                                       if (NULL != pdata_urb->purb) {
+                               if (pdata_urb) {
+                                       if (pdata_urb->purb) {
                                                usb_kill_urb(pdata_urb->purb);
                                                m++;
                                        }
@@ -4417,14 +4417,14 @@ static void easycap_usb_disconnect(struct usb_interface *pusb_interface)
        }
 /*---------------------------------------------------------------------------*/
        case 2: {
-               if (NULL != peasycap->purb_audio_head) {
+               if (peasycap->purb_audio_head) {
                        JOM(4, "killing audio urbs\n");
                        m = 0;
                        list_for_each(plist_head, peasycap->purb_audio_head) {
                                pdata_urb = list_entry(plist_head,
                                                struct data_urb, list_head);
-                               if (NULL != pdata_urb) {
-                                       if (NULL != pdata_urb->purb) {
+                               if (pdata_urb) {
+                                       if (pdata_urb->purb) {
                                                usb_kill_urb(pdata_urb->purb);
                                                m++;
                                        }
@@ -4464,7 +4464,7 @@ static void easycap_usb_disconnect(struct usb_interface *pusb_interface)
                }
 /*---------------------------------------------------------------------------*/
 #ifndef EASYCAP_IS_VIDEODEV_CLIENT
-               if (NULL == peasycap) {
+               if (!peasycap) {
                        SAM("ERROR: peasycap has become NULL\n");
                } else {
                        usb_deregister_dev(pusb_interface, &easycap_class);
index d0ef7af8151ea3d355c0b573c1568ff2449bfe2a..5829e26969d57b8ab26f25cd6ccde968e23bd739 100644 (file)
@@ -83,12 +83,12 @@ easycap_alsa_complete(struct urb *purb)
 
        JOT(16, "\n");
 
-       if (NULL == purb) {
+       if (!purb) {
                SAY("ERROR: purb is NULL\n");
                return;
        }
        peasycap = purb->context;
-       if (NULL == peasycap) {
+       if (!peasycap) {
                SAY("ERROR: peasycap is NULL\n");
                return;
        }
@@ -105,10 +105,10 @@ easycap_alsa_complete(struct urb *purb)
        }
 /*---------------------------------------------------------------------------*/
        pss = peasycap->psubstream;
-       if (NULL == pss)
+       if (!pss)
                goto resubmit;
        prt = pss->runtime;
-       if (NULL == prt)
+       if (!prt)
                goto resubmit;
        dma_bytes = (int)prt->dma_bytes;
        if (0 == dma_bytes)
@@ -294,23 +294,23 @@ static int easycap_alsa_open(struct snd_pcm_substream *pss)
        struct easycap *peasycap;
 
        JOT(4, "\n");
-       if (NULL == pss) {
+       if (!pss) {
                SAY("ERROR:  pss is NULL\n");
                return -EFAULT;
        }
        psnd_pcm = pss->pcm;
-       if (NULL == psnd_pcm) {
+       if (!psnd_pcm) {
                SAY("ERROR:  psnd_pcm is NULL\n");
                return -EFAULT;
        }
        psnd_card = psnd_pcm->card;
-       if (NULL == psnd_card) {
+       if (!psnd_card) {
                SAY("ERROR:  psnd_card is NULL\n");
                return -EFAULT;
        }
 
        peasycap = psnd_card->private_data;
-       if (NULL == peasycap) {
+       if (!peasycap) {
                SAY("ERROR:  peasycap is NULL\n");
                return -EFAULT;
        }
@@ -322,7 +322,7 @@ static int easycap_alsa_open(struct snd_pcm_substream *pss)
                SAM("ERROR: bad peasycap->psnd_card\n");
                return -EFAULT;
        }
-       if (NULL != peasycap->psubstream) {
+       if (peasycap->psubstream) {
                SAM("ERROR: bad peasycap->psubstream\n");
                return -EFAULT;
        }
@@ -345,12 +345,12 @@ static int easycap_alsa_close(struct snd_pcm_substream *pss)
        struct easycap *peasycap;
 
        JOT(4, "\n");
-       if (NULL == pss) {
+       if (!pss) {
                SAY("ERROR:  pss is NULL\n");
                return -EFAULT;
        }
        peasycap = snd_pcm_substream_chip(pss);
-       if (NULL == peasycap) {
+       if (!peasycap) {
                SAY("ERROR:  peasycap is NULL\n");
                return -EFAULT;
        }
@@ -369,12 +369,12 @@ static int easycap_alsa_vmalloc(struct snd_pcm_substream *pss, size_t sz)
        struct snd_pcm_runtime *prt;
        JOT(4, "\n");
 
-       if (NULL == pss) {
+       if (!pss) {
                SAY("ERROR:  pss is NULL\n");
                return -EFAULT;
        }
        prt = pss->runtime;
-       if (NULL == prt) {
+       if (!prt) {
                SAY("ERROR: substream.runtime is NULL\n");
                return -EFAULT;
        }
@@ -384,7 +384,7 @@ static int easycap_alsa_vmalloc(struct snd_pcm_substream *pss, size_t sz)
                vfree(prt->dma_area);
        }
        prt->dma_area = vmalloc(sz);
-       if (NULL == prt->dma_area)
+       if (!prt->dma_area)
                return -ENOMEM;
        prt->dma_bytes = sz;
        return 0;
@@ -396,7 +396,7 @@ static int easycap_alsa_hw_params(struct snd_pcm_substream *pss,
        int rc;
 
        JOT(4, "%i\n", (params_buffer_bytes(phw)));
-       if (NULL == pss) {
+       if (!pss) {
                SAY("ERROR:  pss is NULL\n");
                return -EFAULT;
        }
@@ -411,16 +411,16 @@ static int easycap_alsa_hw_free(struct snd_pcm_substream *pss)
        struct snd_pcm_runtime *prt;
        JOT(4, "\n");
 
-       if (NULL == pss) {
+       if (!pss) {
                SAY("ERROR:  pss is NULL\n");
                return -EFAULT;
        }
        prt = pss->runtime;
-       if (NULL == prt) {
+       if (!prt) {
                SAY("ERROR: substream.runtime is NULL\n");
                return -EFAULT;
        }
-       if (NULL != prt->dma_area) {
+       if (prt->dma_area) {
                JOT(8, "prt->dma_area = %p\n", prt->dma_area);
                vfree(prt->dma_area);
                prt->dma_area = NULL;
@@ -435,13 +435,13 @@ static int easycap_alsa_prepare(struct snd_pcm_substream *pss)
        struct snd_pcm_runtime *prt;
 
        JOT(4, "\n");
-       if (NULL == pss) {
+       if (!pss) {
                SAY("ERROR:  pss is NULL\n");
                return -EFAULT;
        }
        prt = pss->runtime;
        peasycap = snd_pcm_substream_chip(pss);
-       if (NULL == peasycap) {
+       if (!peasycap) {
                SAY("ERROR:  peasycap is NULL\n");
                return -EFAULT;
        }
@@ -483,12 +483,12 @@ static int easycap_alsa_trigger(struct snd_pcm_substream *pss, int cmd)
 
        JOT(4, "%i=cmd cf %i=START %i=STOP\n", cmd, SNDRV_PCM_TRIGGER_START,
            SNDRV_PCM_TRIGGER_STOP);
-       if (NULL == pss) {
+       if (!pss) {
                SAY("ERROR:  pss is NULL\n");
                return -EFAULT;
        }
        peasycap = snd_pcm_substream_chip(pss);
-       if (NULL == peasycap) {
+       if (!peasycap) {
                SAY("ERROR:  peasycap is NULL\n");
                return -EFAULT;
        }
@@ -518,12 +518,12 @@ static snd_pcm_uframes_t easycap_alsa_pointer(struct snd_pcm_substream *pss)
        snd_pcm_uframes_t offset;
 
        JOT(16, "\n");
-       if (NULL == pss) {
+       if (!pss) {
                SAY("ERROR:  pss is NULL\n");
                return -EFAULT;
        }
        peasycap = snd_pcm_substream_chip(pss);
-       if (NULL == peasycap) {
+       if (!peasycap) {
                SAY("ERROR:  peasycap is NULL\n");
                return -EFAULT;
        }
@@ -584,7 +584,7 @@ int easycap_alsa_probe(struct easycap *peasycap)
        struct snd_card *psnd_card;
        struct snd_pcm *psnd_pcm;
 
-       if (NULL == peasycap) {
+       if (!peasycap) {
                SAY("ERROR: peasycap is NULL\n");
                return -ENODEV;
        }
@@ -669,11 +669,11 @@ easycap_sound_setup(struct easycap *peasycap)
 
        JOM(4, "starting initialization\n");
 
-       if (NULL == peasycap) {
+       if (!peasycap) {
                SAY("ERROR:  peasycap is NULL.\n");
                return -EFAULT;
        }
-       if (NULL == peasycap->pusb_device) {
+       if (!peasycap->pusb_device) {
                SAM("ERROR: peasycap->pusb_device is NULL\n");
                return -ENODEV;
        }
@@ -682,12 +682,12 @@ easycap_sound_setup(struct easycap *peasycap)
        rc = audio_setup(peasycap);
        JOM(8, "audio_setup() returned %i\n", rc);
 
-       if (NULL == peasycap->pusb_device) {
+       if (!peasycap->pusb_device) {
                SAM("ERROR: peasycap->pusb_device has become NULL\n");
                return -ENODEV;
        }
 /*---------------------------------------------------------------------------*/
-       if (NULL == peasycap->pusb_device) {
+       if (!peasycap->pusb_device) {
                SAM("ERROR: peasycap->pusb_device has become NULL\n");
                return -ENODEV;
        }
@@ -725,15 +725,15 @@ submit_audio_urbs(struct easycap *peasycap)
        int j, isbad, nospc, m, rc;
        int isbuf;
 
-       if (NULL == peasycap) {
+       if (!peasycap) {
                SAY("ERROR: peasycap is NULL\n");
                return -EFAULT;
        }
-       if (NULL == peasycap->purb_audio_head) {
+       if (!peasycap->purb_audio_head) {
                SAM("ERROR: peasycap->urb_audio_head uninitialized\n");
                return -EFAULT;
        }
-       if (NULL == peasycap->pusb_device) {
+       if (!peasycap->pusb_device) {
                SAM("ERROR: peasycap->pusb_device is NULL\n");
                return -EFAULT;
        }
@@ -751,9 +751,9 @@ submit_audio_urbs(struct easycap *peasycap)
                m = 0;
                list_for_each(plist_head, (peasycap->purb_audio_head)) {
                        pdata_urb = list_entry(plist_head, struct data_urb, list_head);
-                       if (NULL != pdata_urb) {
+                       if (pdata_urb) {
                                purb = pdata_urb->purb;
-                               if (NULL != purb) {
+                               if (purb) {
                                        isbuf = pdata_urb->isbuf;
 
                                        purb->interval = 1;
@@ -801,9 +801,9 @@ submit_audio_urbs(struct easycap *peasycap)
                        JOM(4, "attempting cleanup instead of submitting\n");
                        list_for_each(plist_head, (peasycap->purb_audio_head)) {
                                pdata_urb = list_entry(plist_head, struct data_urb, list_head);
-                               if (NULL != pdata_urb) {
+                               if (pdata_urb) {
                                        purb = pdata_urb->purb;
-                                       if (NULL != purb)
+                                       if (purb)
                                                usb_kill_urb(purb);
                                }
                        }
@@ -830,19 +830,19 @@ kill_audio_urbs(struct easycap *peasycap)
        struct list_head *plist_head;
        struct data_urb *pdata_urb;
 
-       if (NULL == peasycap) {
+       if (!peasycap) {
                SAY("ERROR: peasycap is NULL\n");
                return -EFAULT;
        }
        if (peasycap->audio_isoc_streaming) {
-               if (NULL != peasycap->purb_audio_head) {
+               if (peasycap->purb_audio_head) {
                        peasycap->audio_isoc_streaming = 0;
                        JOM(4, "killing audio urbs\n");
                        m = 0;
                        list_for_each(plist_head, (peasycap->purb_audio_head)) {
                                pdata_urb = list_entry(plist_head, struct data_urb, list_head);
-                               if (NULL != pdata_urb) {
-                                       if (NULL != pdata_urb->purb) {
+                               if (pdata_urb) {
+                                       if (pdata_urb->purb) {
                                                usb_kill_urb(pdata_urb->purb);
                                                m++;
                                        }
index 3e033edc8ede2fe5e0099464e5845460d47ac255..d3980a62a163f1952ac22ed166427d18b9c80348 100644 (file)
@@ -63,12 +63,12 @@ easyoss_complete(struct urb *purb)
 
        JOT(16, "\n");
 
-       if (NULL == purb) {
+       if (!purb) {
                SAY("ERROR: purb is NULL\n");
                return;
        }
        peasycap = purb->context;
-       if (NULL == peasycap) {
+       if (!peasycap) {
                SAY("ERROR: peasycap is NULL\n");
                return;
        }
@@ -288,13 +288,13 @@ static int easyoss_open(struct inode *inode, struct file *file)
        subminor = iminor(inode);
 
        pusb_interface = usb_find_interface(&easycap_usb_driver, subminor);
-       if (NULL == pusb_interface) {
+       if (!pusb_interface) {
                SAY("ERROR: pusb_interface is NULL\n");
                SAY("ending unsuccessfully\n");
                return -1;
        }
        peasycap = usb_get_intfdata(pusb_interface);
-       if (NULL == peasycap) {
+       if (!peasycap) {
                SAY("ERROR: peasycap is NULL\n");
                SAY("ending unsuccessfully\n");
                return -1;
@@ -311,7 +311,7 @@ static int easyoss_open(struct inode *inode, struct file *file)
 /*---------------------------------------------------------------------------*/
        if (memcmp(&peasycap->telltale[0], TELLTALE, strlen(TELLTALE))) {
                pv4l2_device = usb_get_intfdata(pusb_interface);
-               if (NULL == pv4l2_device) {
+               if (!pv4l2_device) {
                        SAY("ERROR: pv4l2_device is NULL\n");
                        return -EFAULT;
                }
@@ -343,7 +343,7 @@ static int easyoss_release(struct inode *inode, struct file *file)
        JOT(4, "begins\n");
 
        peasycap = file->private_data;
-       if (NULL == peasycap) {
+       if (!peasycap) {
                SAY("ERROR:  peasycap is NULL.\n");
                return -EFAULT;
        }
@@ -385,12 +385,12 @@ static ssize_t easyoss_read(struct file *file, char __user *puserspacebuffer,
 
        JOT(8, "%5zd=kount  %5lld=*poff\n", kount, *poff);
 
-       if (NULL == file) {
+       if (!file) {
                SAY("ERROR:  file is NULL\n");
                return -ERESTARTSYS;
        }
        peasycap = file->private_data;
-       if (NULL == peasycap) {
+       if (!peasycap) {
                SAY("ERROR in easyoss_read(): peasycap is NULL\n");
                return -EFAULT;
        }
@@ -398,7 +398,7 @@ static ssize_t easyoss_read(struct file *file, char __user *puserspacebuffer,
                SAY("ERROR: bad peasycap: %p\n", peasycap);
                return -EFAULT;
        }
-       if (NULL == peasycap->pusb_device) {
+       if (!peasycap->pusb_device) {
                SAY("ERROR: peasycap->pusb_device is NULL\n");
                return -EFAULT;
        }
@@ -418,13 +418,13 @@ static ssize_t easyoss_read(struct file *file, char __user *puserspacebuffer,
                 */
                if (kd != isdongle(peasycap))
                        return -ERESTARTSYS;
-               if (NULL == file) {
+               if (!file) {
                        SAY("ERROR:  file is NULL\n");
                        mutex_unlock(&easycapdc60_dongle[kd].mutex_audio);
                        return -ERESTARTSYS;
                }
                peasycap = file->private_data;
-               if (NULL == peasycap) {
+               if (!peasycap) {
                        SAY("ERROR:  peasycap is NULL\n");
                        mutex_unlock(&easycapdc60_dongle[kd].mutex_audio);
                        return -ERESTARTSYS;
@@ -434,7 +434,7 @@ static ssize_t easyoss_read(struct file *file, char __user *puserspacebuffer,
                        mutex_unlock(&easycapdc60_dongle[kd].mutex_audio);
                        return -ERESTARTSYS;
                }
-               if (NULL == peasycap->pusb_device) {
+               if (!peasycap->pusb_device) {
                        SAM("ERROR: peasycap->pusb_device is NULL\n");
                        mutex_unlock(&easycapdc60_dongle[kd].mutex_audio);
                        return -ERESTARTSYS;
@@ -459,7 +459,7 @@ static ssize_t easyoss_read(struct file *file, char __user *puserspacebuffer,
                return -EFAULT;
        }
        pdata_buffer = &peasycap->audio_buffer[peasycap->audio_read];
-       if (NULL == pdata_buffer) {
+       if (!pdata_buffer) {
                SAM("ERROR: pdata_buffer is NULL\n");
                mutex_unlock(&easycapdc60_dongle[kd].mutex_audio);
                return -EFAULT;
@@ -510,12 +510,12 @@ static ssize_t easyoss_read(struct file *file, char __user *puserspacebuffer,
        szret = (size_t)0;
        fragment = (peasycap->audio_read / peasycap->audio_pages_per_fragment);
        while (fragment == (peasycap->audio_read / peasycap->audio_pages_per_fragment)) {
-               if (NULL == pdata_buffer->pgo) {
+               if (!pdata_buffer->pgo) {
                        SAM("ERROR: pdata_buffer->pgo is NULL\n");
                        mutex_unlock(&easycapdc60_dongle[kd].mutex_audio);
                        return -EFAULT;
                }
-               if (NULL == pdata_buffer->pto) {
+               if (!pdata_buffer->pto) {
                        SAM("ERROR: pdata_buffer->pto is NULL\n");
                        mutex_unlock(&easycapdc60_dongle[kd].mutex_audio);
                        return -EFAULT;
@@ -543,17 +543,17 @@ static ssize_t easyoss_read(struct file *file, char __user *puserspacebuffer,
                                return -EFAULT;
                        }
                        pdata_buffer = &peasycap->audio_buffer[peasycap->audio_read];
-                       if (NULL == pdata_buffer) {
+                       if (!pdata_buffer) {
                                SAM("ERROR: pdata_buffer is NULL\n");
                                mutex_unlock(&easycapdc60_dongle[kd].mutex_audio);
                                return -EFAULT;
                        }
-                       if (NULL == pdata_buffer->pgo) {
+                       if (!pdata_buffer->pgo) {
                                SAM("ERROR: pdata_buffer->pgo is NULL\n");
                                mutex_unlock(&easycapdc60_dongle[kd].mutex_audio);
                                return -EFAULT;
                        }
-                       if (NULL == pdata_buffer->pto) {
+                       if (!pdata_buffer->pto) {
                                SAM("ERROR: pdata_buffer->pto is NULL\n");
                                mutex_unlock(&easycapdc60_dongle[kd].mutex_audio);
                                return -EFAULT;
@@ -662,12 +662,12 @@ static long easyoss_unlocked_ioctl(struct file *file,
        struct usb_device *p;
        int kd;
 
-       if (NULL == file) {
+       if (!file) {
                SAY("ERROR:  file is NULL\n");
                return -ERESTARTSYS;
        }
        peasycap = file->private_data;
-       if (NULL == peasycap) {
+       if (!peasycap) {
                SAY("ERROR:  peasycap is NULL.\n");
                return -EFAULT;
        }
@@ -676,7 +676,7 @@ static long easyoss_unlocked_ioctl(struct file *file,
                return -EFAULT;
        }
        p = peasycap->pusb_device;
-       if (NULL == p) {
+       if (!p) {
                SAM("ERROR: peasycap->pusb_device is NULL\n");
                return -EFAULT;
        }
@@ -696,13 +696,13 @@ static long easyoss_unlocked_ioctl(struct file *file,
                */
                if (kd != isdongle(peasycap))
                        return -ERESTARTSYS;
-               if (NULL == file) {
+               if (!file) {
                        SAY("ERROR:  file is NULL\n");
                        mutex_unlock(&easycapdc60_dongle[kd].mutex_audio);
                        return -ERESTARTSYS;
                }
                peasycap = file->private_data;
-               if (NULL == peasycap) {
+               if (!peasycap) {
                        SAY("ERROR:  peasycap is NULL\n");
                        mutex_unlock(&easycapdc60_dongle[kd].mutex_audio);
                        return -ERESTARTSYS;
@@ -713,7 +713,7 @@ static long easyoss_unlocked_ioctl(struct file *file,
                        return -EFAULT;
                }
                p = peasycap->pusb_device;
-               if (NULL == peasycap->pusb_device) {
+               if (!peasycap->pusb_device) {
                        SAM("ERROR: peasycap->pusb_device is NULL\n");
                        mutex_unlock(&easycapdc60_dongle[kd].mutex_audio);
                        return -ERESTARTSYS;
index 9db26af34441ea200ab46dc6868b53dd10f52f09..0f71470ace39cb199d5bb11380a11e12f49db83c 100644 (file)
@@ -39,7 +39,7 @@ easycap_testcard(struct easycap *peasycap, int field)
        unsigned char bfbar[TESTCARD_BYTESPERLINE / 8], *p1, *p2;
        struct data_buffer *pfield_buffer;
 
-       if (NULL == peasycap) {
+       if (!peasycap) {
                SAY("ERROR: peasycap is NULL\n");
                return;
        }