Commit 6888393c authored by Tomas Winkler's avatar Tomas Winkler Committed by Greg Kroah-Hartman

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: default avatarTomas Winkler <tomas.winkler@intel.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent febd32bc
...@@ -48,11 +48,11 @@ int adjust_standard(struct easycap *peasycap, v4l2_std_id std_id) ...@@ -48,11 +48,11 @@ int adjust_standard(struct easycap *peasycap, v4l2_std_id std_id)
unsigned int itwas, isnow; unsigned int itwas, isnow;
bool resubmit; bool resubmit;
if (NULL == peasycap) { if (!peasycap) {
SAY("ERROR: peasycap is NULL\n"); SAY("ERROR: peasycap is NULL\n");
return -EFAULT; return -EFAULT;
} }
if (NULL == peasycap->pusb_device) { if (!peasycap->pusb_device) {
SAM("ERROR: peasycap->pusb_device is NULL\n"); SAM("ERROR: peasycap->pusb_device is NULL\n");
return -EFAULT; return -EFAULT;
} }
...@@ -370,7 +370,7 @@ int adjust_format(struct easycap *peasycap, ...@@ -370,7 +370,7 @@ int adjust_format(struct easycap *peasycap,
u32 uc; u32 uc;
bool resubmit; bool resubmit;
if (NULL == peasycap) { if (!peasycap) {
SAY("ERROR: peasycap is NULL\n"); SAY("ERROR: peasycap is NULL\n");
return -EFAULT; return -EFAULT;
} }
...@@ -379,7 +379,7 @@ int adjust_format(struct easycap *peasycap, ...@@ -379,7 +379,7 @@ int adjust_format(struct easycap *peasycap,
return -EBUSY; return -EBUSY;
} }
p = peasycap->pusb_device; p = peasycap->pusb_device;
if (NULL == p) { if (!p) {
SAM("ERROR: peaycap->pusb_device is NULL\n"); SAM("ERROR: peaycap->pusb_device is NULL\n");
return -EFAULT; return -EFAULT;
} }
...@@ -491,7 +491,7 @@ int adjust_format(struct easycap *peasycap, ...@@ -491,7 +491,7 @@ int adjust_format(struct easycap *peasycap,
return peasycap->format_offset; return peasycap->format_offset;
} }
} }
if (NULL == peasycap_best_format) { if (!peasycap_best_format) {
SAM("MISTAKE: peasycap_best_format is NULL"); SAM("MISTAKE: peasycap_best_format is NULL");
return -EINVAL; return -EINVAL;
} }
...@@ -632,11 +632,11 @@ int adjust_brightness(struct easycap *peasycap, int value) ...@@ -632,11 +632,11 @@ int adjust_brightness(struct easycap *peasycap, int value)
unsigned int mood; unsigned int mood;
int i1, k; int i1, k;
if (NULL == peasycap) { if (!peasycap) {
SAY("ERROR: peasycap is NULL\n"); SAY("ERROR: peasycap is NULL\n");
return -EFAULT; return -EFAULT;
} }
if (NULL == peasycap->pusb_device) { if (!peasycap->pusb_device) {
SAM("ERROR: peasycap->pusb_device is NULL\n"); SAM("ERROR: peasycap->pusb_device is NULL\n");
return -EFAULT; return -EFAULT;
} }
...@@ -689,11 +689,11 @@ int adjust_contrast(struct easycap *peasycap, int value) ...@@ -689,11 +689,11 @@ int adjust_contrast(struct easycap *peasycap, int value)
unsigned int mood; unsigned int mood;
int i1, k; int i1, k;
if (NULL == peasycap) { if (!peasycap) {
SAY("ERROR: peasycap is NULL\n"); SAY("ERROR: peasycap is NULL\n");
return -EFAULT; return -EFAULT;
} }
if (NULL == peasycap->pusb_device) { if (!peasycap->pusb_device) {
SAM("ERROR: peasycap->pusb_device is NULL\n"); SAM("ERROR: peasycap->pusb_device is NULL\n");
return -EFAULT; return -EFAULT;
} }
...@@ -747,11 +747,11 @@ int adjust_saturation(struct easycap *peasycap, int value) ...@@ -747,11 +747,11 @@ int adjust_saturation(struct easycap *peasycap, int value)
unsigned int mood; unsigned int mood;
int i1, k; int i1, k;
if (NULL == peasycap) { if (!peasycap) {
SAY("ERROR: peasycap is NULL\n"); SAY("ERROR: peasycap is NULL\n");
return -EFAULT; return -EFAULT;
} }
if (NULL == peasycap->pusb_device) { if (!peasycap->pusb_device) {
SAM("ERROR: peasycap->pusb_device is NULL\n"); SAM("ERROR: peasycap->pusb_device is NULL\n");
return -EFAULT; return -EFAULT;
} }
...@@ -805,11 +805,11 @@ int adjust_hue(struct easycap *peasycap, int value) ...@@ -805,11 +805,11 @@ int adjust_hue(struct easycap *peasycap, int value)
unsigned int mood; unsigned int mood;
int i1, i2, k; int i1, i2, k;
if (NULL == peasycap) { if (!peasycap) {
SAY("ERROR: peasycap is NULL\n"); SAY("ERROR: peasycap is NULL\n");
return -EFAULT; return -EFAULT;
} }
if (NULL == peasycap->pusb_device) { if (!peasycap->pusb_device) {
SAM("ERROR: peasycap->pusb_device is NULL\n"); SAM("ERROR: peasycap->pusb_device is NULL\n");
return -EFAULT; return -EFAULT;
} }
...@@ -859,11 +859,11 @@ int adjust_volume(struct easycap *peasycap, int value) ...@@ -859,11 +859,11 @@ int adjust_volume(struct easycap *peasycap, int value)
s8 mood; s8 mood;
int i1; int i1;
if (NULL == peasycap) { if (!peasycap) {
SAY("ERROR: peasycap is NULL\n"); SAY("ERROR: peasycap is NULL\n");
return -EFAULT; return -EFAULT;
} }
if (NULL == peasycap->pusb_device) { if (!peasycap->pusb_device) {
SAM("ERROR: peasycap->pusb_device is NULL\n"); SAM("ERROR: peasycap->pusb_device is NULL\n");
return -EFAULT; return -EFAULT;
} }
...@@ -916,11 +916,11 @@ static int adjust_mute(struct easycap *peasycap, int value) ...@@ -916,11 +916,11 @@ static int adjust_mute(struct easycap *peasycap, int value)
{ {
int i1; int i1;
if (NULL == peasycap) { if (!peasycap) {
SAY("ERROR: peasycap is NULL\n"); SAY("ERROR: peasycap is NULL\n");
return -EFAULT; return -EFAULT;
} }
if (NULL == peasycap->pusb_device) { if (!peasycap->pusb_device) {
SAM("ERROR: peasycap->pusb_device is NULL\n"); SAM("ERROR: peasycap->pusb_device is NULL\n");
return -EFAULT; return -EFAULT;
} }
...@@ -958,12 +958,12 @@ long easycap_unlocked_ioctl(struct file *file, ...@@ -958,12 +958,12 @@ long easycap_unlocked_ioctl(struct file *file,
struct usb_device *p; struct usb_device *p;
int kd; int kd;
if (NULL == file) { if (!file) {
SAY("ERROR: file is NULL\n"); SAY("ERROR: file is NULL\n");
return -ERESTARTSYS; return -ERESTARTSYS;
} }
peasycap = file->private_data; peasycap = file->private_data;
if (NULL == peasycap) { if (!peasycap) {
SAY("ERROR: peasycap is NULL\n"); SAY("ERROR: peasycap is NULL\n");
return -1; return -1;
} }
...@@ -972,7 +972,7 @@ long easycap_unlocked_ioctl(struct file *file, ...@@ -972,7 +972,7 @@ long easycap_unlocked_ioctl(struct file *file,
return -EFAULT; return -EFAULT;
} }
p = peasycap->pusb_device; p = peasycap->pusb_device;
if (NULL == p) { if (!p) {
SAM("ERROR: peasycap->pusb_device is NULL\n"); SAM("ERROR: peasycap->pusb_device is NULL\n");
return -EFAULT; return -EFAULT;
} }
...@@ -993,13 +993,13 @@ long easycap_unlocked_ioctl(struct file *file, ...@@ -993,13 +993,13 @@ long easycap_unlocked_ioctl(struct file *file,
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/
if (kd != isdongle(peasycap)) if (kd != isdongle(peasycap))
return -ERESTARTSYS; return -ERESTARTSYS;
if (NULL == file) { if (!file) {
SAY("ERROR: file is NULL\n"); SAY("ERROR: file is NULL\n");
mutex_unlock(&easycapdc60_dongle[kd].mutex_video); mutex_unlock(&easycapdc60_dongle[kd].mutex_video);
return -ERESTARTSYS; return -ERESTARTSYS;
} }
peasycap = file->private_data; peasycap = file->private_data;
if (NULL == peasycap) { if (!peasycap) {
SAY("ERROR: peasycap is NULL\n"); SAY("ERROR: peasycap is NULL\n");
mutex_unlock(&easycapdc60_dongle[kd].mutex_video); mutex_unlock(&easycapdc60_dongle[kd].mutex_video);
return -ERESTARTSYS; return -ERESTARTSYS;
...@@ -1010,7 +1010,7 @@ long easycap_unlocked_ioctl(struct file *file, ...@@ -1010,7 +1010,7 @@ long easycap_unlocked_ioctl(struct file *file,
return -EFAULT; return -EFAULT;
} }
p = peasycap->pusb_device; p = peasycap->pusb_device;
if (NULL == peasycap->pusb_device) { if (!peasycap->pusb_device) {
SAM("ERROR: peasycap->pusb_device is NULL\n"); SAM("ERROR: peasycap->pusb_device is NULL\n");
mutex_unlock(&easycapdc60_dongle[kd].mutex_video); mutex_unlock(&easycapdc60_dongle[kd].mutex_video);
return -ERESTARTSYS; return -ERESTARTSYS;
...@@ -2325,7 +2325,7 @@ long easycap_unlocked_ioctl(struct file *file, ...@@ -2325,7 +2325,7 @@ long easycap_unlocked_ioctl(struct file *file,
peasycap->isequence = 0; peasycap->isequence = 0;
for (i = 0; i < 180; i++) for (i = 0; i < 180; i++)
peasycap->merit[i] = 0; peasycap->merit[i] = 0;
if (NULL == peasycap->pusb_device) { if (!peasycap->pusb_device) {
SAM("ERROR: peasycap->pusb_device is NULL\n"); SAM("ERROR: peasycap->pusb_device is NULL\n");
mutex_unlock(&easycapdc60_dongle[kd].mutex_video); mutex_unlock(&easycapdc60_dongle[kd].mutex_video);
return -EFAULT; return -EFAULT;
...@@ -2341,7 +2341,7 @@ long easycap_unlocked_ioctl(struct file *file, ...@@ -2341,7 +2341,7 @@ long easycap_unlocked_ioctl(struct file *file,
case VIDIOC_STREAMOFF: { case VIDIOC_STREAMOFF: {
JOM(8, "VIDIOC_STREAMOFF\n"); JOM(8, "VIDIOC_STREAMOFF\n");
if (NULL == peasycap->pusb_device) { if (!peasycap->pusb_device) {
SAM("ERROR: peasycap->pusb_device is NULL\n"); SAM("ERROR: peasycap->pusb_device is NULL\n");
mutex_unlock(&easycapdc60_dongle[kd].mutex_video); mutex_unlock(&easycapdc60_dongle[kd].mutex_video);
return -EFAULT; return -EFAULT;
...@@ -2362,7 +2362,7 @@ long easycap_unlocked_ioctl(struct file *file, ...@@ -2362,7 +2362,7 @@ long easycap_unlocked_ioctl(struct file *file,
wake_up_interruptible(&(peasycap->wq_audio)); wake_up_interruptible(&(peasycap->wq_audio));
#else #else
if (NULL != peasycap->psubstream) if (peasycap->psubstream)
snd_pcm_period_elapsed(peasycap->psubstream); snd_pcm_period_elapsed(peasycap->psubstream);
#endif /* CONFIG_EASYCAP_OSS */ #endif /* CONFIG_EASYCAP_OSS */
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/
......
...@@ -330,7 +330,7 @@ int confirm_resolution(struct usb_device *p) ...@@ -330,7 +330,7 @@ int confirm_resolution(struct usb_device *p)
{ {
u8 get0, get1, get2, get3, get4, get5, get6, get7; u8 get0, get1, get2, get3, get4, get5, get6, get7;
if (NULL == p) if (!p)
return -ENODEV; return -ENODEV;
GET(p, 0x0110, &get0); GET(p, 0x0110, &get0);
GET(p, 0x0111, &get1); GET(p, 0x0111, &get1);
...@@ -371,7 +371,7 @@ int confirm_stream(struct usb_device *p) ...@@ -371,7 +371,7 @@ int confirm_stream(struct usb_device *p)
u16 get2; u16 get2;
u8 igot; u8 igot;
if (NULL == p) if (!p)
return -ENODEV; return -ENODEV;
GET(p, 0x0100, &igot); get2 = 0x80 & igot; GET(p, 0x0100, &igot); get2 = 0x80 & igot;
if (0x80 == get2) if (0x80 == get2)
...@@ -385,7 +385,7 @@ int setup_stk(struct usb_device *p, bool ntsc) ...@@ -385,7 +385,7 @@ int setup_stk(struct usb_device *p, bool ntsc)
{ {
int i0; int i0;
if (NULL == p) if (!p)
return -ENODEV; return -ENODEV;
i0 = 0; i0 = 0;
if (ntsc) { if (ntsc) {
...@@ -411,7 +411,7 @@ int setup_saa(struct usb_device *p, bool ntsc) ...@@ -411,7 +411,7 @@ int setup_saa(struct usb_device *p, bool ntsc)
{ {
int i0, ir; int i0, ir;
if (NULL == p) if (!p)
return -ENODEV; return -ENODEV;
i0 = 0; i0 = 0;
if (ntsc) { if (ntsc) {
...@@ -434,7 +434,7 @@ int write_000(struct usb_device *p, u16 set2, u16 set0) ...@@ -434,7 +434,7 @@ int write_000(struct usb_device *p, u16 set2, u16 set0)
{ {
u8 igot0, igot2; u8 igot0, igot2;
if (NULL == p) if (!p)
return -ENODEV; return -ENODEV;
GET(p, 0x0002, &igot2); GET(p, 0x0002, &igot2);
GET(p, 0x0000, &igot0); GET(p, 0x0000, &igot0);
...@@ -445,7 +445,7 @@ int write_000(struct usb_device *p, u16 set2, u16 set0) ...@@ -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) int write_saa(struct usb_device *p, u16 reg0, u16 set0)
{ {
if (NULL == p) if (!p)
return -ENODEV; return -ENODEV;
SET(p, 0x200, 0x00); SET(p, 0x200, 0x00);
SET(p, 0x204, reg0); SET(p, 0x204, reg0);
...@@ -470,7 +470,7 @@ write_vt(struct usb_device *p, u16 reg0, u16 set0) ...@@ -470,7 +470,7 @@ write_vt(struct usb_device *p, u16 reg0, u16 set0)
u16 got502, got503; u16 got502, got503;
u16 set502, set503; u16 set502, set503;
if (NULL == p) if (!p)
return -ENODEV; return -ENODEV;
SET(p, 0x0504, reg0); SET(p, 0x0504, reg0);
SET(p, 0x0500, 0x008B); SET(p, 0x0500, 0x008B);
...@@ -506,7 +506,7 @@ int read_vt(struct usb_device *p, u16 reg0) ...@@ -506,7 +506,7 @@ int read_vt(struct usb_device *p, u16 reg0)
u8 igot; u8 igot;
u16 got502, got503; u16 got502, got503;
if (NULL == p) if (!p)
return -ENODEV; return -ENODEV;
SET(p, 0x0504, reg0); SET(p, 0x0504, reg0);
SET(p, 0x0500, 0x008B); SET(p, 0x0500, 0x008B);
...@@ -527,7 +527,7 @@ int read_vt(struct usb_device *p, u16 reg0) ...@@ -527,7 +527,7 @@ int read_vt(struct usb_device *p, u16 reg0)
/*--------------------------------------------------------------------------*/ /*--------------------------------------------------------------------------*/
int write_300(struct usb_device *p) int write_300(struct usb_device *p)
{ {
if (NULL == p) if (!p)
return -ENODEV; return -ENODEV;
SET(p, 0x300, 0x0012); SET(p, 0x300, 0x0012);
SET(p, 0x350, 0x002D); SET(p, 0x350, 0x002D);
...@@ -548,7 +548,7 @@ int check_saa(struct usb_device *p, bool ntsc) ...@@ -548,7 +548,7 @@ int check_saa(struct usb_device *p, bool ntsc)
{ {
int i0, ir, rc; int i0, ir, rc;
if (NULL == p) if (!p)
return -ENODEV; return -ENODEV;
i0 = 0; i0 = 0;
rc = 0; rc = 0;
...@@ -597,7 +597,7 @@ int merit_saa(struct usb_device *p) ...@@ -597,7 +597,7 @@ int merit_saa(struct usb_device *p)
{ {
int rc; int rc;
if (NULL == p) if (!p)
return -ENODEV; return -ENODEV;
rc = read_saa(p, 0x1F); rc = read_saa(p, 0x1F);
return ((0 > rc) || (0x02 & rc)) ? 1 : 0; return ((0 > rc) || (0x02 & rc)) ? 1 : 0;
...@@ -615,7 +615,7 @@ int ready_saa(struct usb_device *p) ...@@ -615,7 +615,7 @@ int ready_saa(struct usb_device *p)
* 3 FOR NON-INTERLACED 60 Hz * 3 FOR NON-INTERLACED 60 Hz
*/ */
/*--------------------------------------------------------------------------*/ /*--------------------------------------------------------------------------*/
if (NULL == p) if (!p)
return -ENODEV; return -ENODEV;
j = 0; j = 0;
while (max > j) { while (max > j) {
...@@ -660,7 +660,7 @@ int check_stk(struct usb_device *p, bool ntsc) ...@@ -660,7 +660,7 @@ int check_stk(struct usb_device *p, bool ntsc)
{ {
int i0, ir; int i0, ir;
if (NULL == p) if (!p)
return -ENODEV; return -ENODEV;
i0 = 0; i0 = 0;
if (ntsc) { if (ntsc) {
...@@ -731,7 +731,7 @@ int read_saa(struct usb_device *p, u16 reg0) ...@@ -731,7 +731,7 @@ int read_saa(struct usb_device *p, u16 reg0)
{ {
u8 igot; u8 igot;
if (NULL == p) if (!p)
return -ENODEV; return -ENODEV;
SET(p, 0x208, reg0); SET(p, 0x208, reg0);
SET(p, 0x200, 0x20); SET(p, 0x200, 0x20);
...@@ -746,7 +746,7 @@ int read_stk(struct usb_device *p, u32 reg0) ...@@ -746,7 +746,7 @@ int read_stk(struct usb_device *p, u32 reg0)
{ {
u8 igot; u8 igot;
if (NULL == p) if (!p)
return -ENODEV; return -ENODEV;
igot = 0; igot = 0;
GET(p, reg0, &igot); GET(p, reg0, &igot);
...@@ -776,7 +776,7 @@ select_input(struct usb_device *p, int input, int mode) ...@@ -776,7 +776,7 @@ select_input(struct usb_device *p, int input, int mode)
{ {
int ir; int ir;
if (NULL == p) if (!p)
return -ENODEV; return -ENODEV;
stop_100(p); stop_100(p);
switch (input) { switch (input) {
...@@ -879,7 +879,7 @@ int set_resolution(struct usb_device *p, ...@@ -879,7 +879,7 @@ int set_resolution(struct usb_device *p,
{ {
u16 u0x0111, u0x0113, u0x0115, u0x0117; u16 u0x0111, u0x0113, u0x0115, u0x0117;
if (NULL == p) if (!p)
return -ENODEV; return -ENODEV;
u0x0111 = ((0xFF00 & set0) >> 8); u0x0111 = ((0xFF00 & set0) >> 8);
u0x0113 = ((0xFF00 & set1) >> 8); u0x0113 = ((0xFF00 & set1) >> 8);
...@@ -903,7 +903,7 @@ int start_100(struct usb_device *p) ...@@ -903,7 +903,7 @@ int start_100(struct usb_device *p)
u16 get116, get117, get0; u16 get116, get117, get0;
u8 igot116, igot117, igot; u8 igot116, igot117, igot;
if (NULL == p) if (!p)
return -ENODEV; return -ENODEV;
GET(p, 0x0116, &igot116); GET(p, 0x0116, &igot116);
get116 = igot116; get116 = igot116;
...@@ -927,7 +927,7 @@ int stop_100(struct usb_device *p) ...@@ -927,7 +927,7 @@ int stop_100(struct usb_device *p)
u16 get0; u16 get0;
u8 igot; u8 igot;
if (NULL == p) if (!p)
return -ENODEV; return -ENODEV;
GET(p, 0x0100, &igot); GET(p, 0x0100, &igot);
get0 = igot; get0 = igot;
...@@ -947,7 +947,7 @@ int wait_i2c(struct usb_device *p) ...@@ -947,7 +947,7 @@ int wait_i2c(struct usb_device *p)
const int max = 2; const int max = 2;
int k; int k;
if (NULL == p) if (!p)
return -ENODEV; return -ENODEV;
for (k = 0; k < max; k++) { for (k = 0; k < max; k++) {
...@@ -1000,11 +1000,11 @@ audio_setup(struct easycap *peasycap) ...@@ -1000,11 +1000,11 @@ audio_setup(struct easycap *peasycap)
const u16 index = 0x0301; const u16 index = 0x0301;
const u16 length = 1; const u16 length = 1;
if (NULL == peasycap) if (!peasycap)
return -EFAULT; return -EFAULT;
pusb_device = peasycap->pusb_device; pusb_device = peasycap->pusb_device;
if (NULL == pusb_device) if (!pusb_device)
return -ENODEV; return -ENODEV;
JOM(8, "%02X %02X %02X %02X %02X %02X %02X %02X\n", 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) ...@@ -1143,7 +1143,7 @@ int audio_gainset(struct usb_device *pusb_device, s8 loud)
u8 tmp; u8 tmp;
u16 mute; u16 mute;
if (NULL == pusb_device) if (!pusb_device)
return -ENODEV; return -ENODEV;
if (0 > loud) if (0 > loud)
loud = 0; loud = 0;
...@@ -1209,7 +1209,7 @@ int audio_gainget(struct usb_device *pusb_device) ...@@ -1209,7 +1209,7 @@ int audio_gainget(struct usb_device *pusb_device)
{ {
int igot; int igot;
if (NULL == pusb_device) if (!pusb_device)
return -ENODEV; return -ENODEV;
igot = read_vt(pusb_device, 0x001C); igot = read_vt(pusb_device, 0x001C);
if (0 > igot) if (0 > igot)
......
This diff is collapsed.
...@@ -83,12 +83,12 @@ easycap_alsa_complete(struct urb *purb) ...@@ -83,12 +83,12 @@ easycap_alsa_complete(struct urb *purb)
JOT(16, "\n"); JOT(16, "\n");
if (NULL == purb) { if (!purb) {
SAY("ERROR: purb is NULL\n"); SAY("ERROR: purb is NULL\n");
return; return;
} }
peasycap = purb->context; peasycap = purb->context;
if (NULL == peasycap) { if (!peasycap) {
SAY("ERROR: peasycap is NULL\n"); SAY("ERROR: peasycap is NULL\n");
return; return;
} }
...@@ -105,10 +105,10 @@ easycap_alsa_complete(struct urb *purb) ...@@ -105,10 +105,10 @@ easycap_alsa_complete(struct urb *purb)
} }
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/
pss = peasycap->psubstream; pss = peasycap->psubstream;
if (NULL == pss) if (!pss)
goto resubmit; goto resubmit;
prt = pss->runtime; prt = pss->runtime;
if (NULL == prt) if (!prt)
goto resubmit; goto resubmit;
dma_bytes = (int)prt->dma_bytes; dma_bytes = (int)prt->dma_bytes;
if (0 == dma_bytes) if (0 == dma_bytes)
...@@ -294,23 +294,23 @@ static int easycap_alsa_open(struct snd_pcm_substream *pss) ...@@ -294,23 +294,23 @@ static int easycap_alsa_open(struct snd_pcm_substream *pss)
struct easycap *peasycap; struct easycap *peasycap;
JOT(4, "\n"); JOT(4, "\n");
if (NULL == pss) { if (!pss) {
SAY("ERROR: pss is NULL\n"); SAY("ERROR: pss is NULL\n");
return -EFAULT; return -EFAULT;
} }
psnd_pcm = pss->pcm; psnd_pcm = pss->pcm;
if (NULL == psnd_pcm) { if (!psnd_pcm) {
SAY("ERROR: psnd_pcm is NULL\n"); SAY("ERROR: psnd_pcm is NULL\n");
return -EFAULT; return -EFAULT;
} }
psnd_card = psnd_pcm->card; psnd_card = psnd_pcm->card;
if (NULL == psnd_card) { if (!psnd_card) {
SAY("ERROR: psnd_card is NULL\n"); SAY("ERROR: psnd_card is NULL\n");
return -EFAULT; return -EFAULT;
} }
peasycap = psnd_card->private_data; peasycap = psnd_card->private_data;
if (NULL == peasycap) { if (!peasycap) {
SAY("ERROR: peasycap is NULL\n"); SAY("ERROR: peasycap is NULL\n");
return -EFAULT; return -EFAULT;
} }
...@@ -322,7 +322,7 @@ static int easycap_alsa_open(struct snd_pcm_substream *pss) ...@@ -322,7 +322,7 @@ static int easycap_alsa_open(struct snd_pcm_substream *pss)
SAM("ERROR: bad peasycap->psnd_card\n"); SAM("ERROR: bad peasycap->psnd_card\n");
return -EFAULT; return -EFAULT;
} }
if (NULL != peasycap->psubstream) { if (peasycap->psubstream) {
SAM("ERROR: bad peasycap->psubstream\n"); SAM("ERROR: bad peasycap->psubstream\n");
return -EFAULT; return -EFAULT;
} }
...@@ -345,12 +345,12 @@ static int easycap_alsa_close(struct snd_pcm_substream *pss) ...@@ -345,12 +345,12 @@ static int easycap_alsa_close(struct snd_pcm_substream *pss)
struct easycap *peasycap; struct easycap *peasycap;
JOT(4, "\n"); JOT(4, "\n");
if (NULL == pss) { if (!pss) {
SAY("ERROR: pss is NULL\n"); SAY("ERROR: pss is NULL\n");
return -EFAULT; return -EFAULT;
} }
peasycap = snd_pcm_substream_chip(pss); peasycap = snd_pcm_substream_chip(pss);
if (NULL == peasycap) { if (!peasycap) {
SAY("ERROR: peasycap is NULL\n"); SAY("ERROR: peasycap is NULL\n");
return -EFAULT; return -EFAULT;
} }
...@@ -369,12 +369,12 @@ static int easycap_alsa_vmalloc(struct snd_pcm_substream *pss, size_t sz) ...@@ -369,12 +369,12 @@ static int easycap_alsa_vmalloc(struct snd_pcm_substream *pss, size_t sz)
struct snd_pcm_runtime *prt; struct snd_pcm_runtime *prt;
JOT(4, "\n"); JOT(4, "\n");
if (NULL == pss) { if (!pss) {
SAY("ERROR: pss is NULL\n"); SAY("ERROR: pss is NULL\n");
return -EFAULT; return -EFAULT;
} }
prt = pss->runtime; prt = pss->runtime;
if (NULL == prt) { if (!prt) {
SAY("ERROR: substream.runtime is NULL\n"); SAY("ERROR: substream.runtime is NULL\n");
return -EFAULT; return -EFAULT;
} }
...@@ -384,7 +384,7 @@ static int easycap_alsa_vmalloc(struct snd_pcm_substream *pss, size_t sz) ...@@ -384,7 +384,7 @@ static int easycap_alsa_vmalloc(struct snd_pcm_substream *pss, size_t sz)
vfree(prt->dma_area); vfree(prt->dma_area);
} }
prt->dma_area = vmalloc(sz); prt->dma_area = vmalloc(sz);
if (NULL == prt->dma_area) if (!prt->dma_area)
return -ENOMEM; return -ENOMEM;
prt->dma_bytes = sz; prt->dma_bytes = sz;
return 0; return 0;
...@@ -396,7 +396,7 @@ static int easycap_alsa_hw_params(struct snd_pcm_substream *pss, ...@@ -396,7 +396,7 @@ static int easycap_alsa_hw_params(struct snd_pcm_substream *pss,
int rc; int rc;
JOT(4, "%i\n", (params_buffer_bytes(phw))); JOT(4, "%i\n", (params_buffer_bytes(phw)));
if (NULL == pss) { if (!pss) {
SAY("ERROR: pss is NULL\n"); SAY("ERROR: pss is NULL\n");
return -EFAULT; return -EFAULT;
} }
...@@ -411,16 +411,16 @@ static int easycap_alsa_hw_free(struct snd_pcm_substream *pss) ...@@ -411,16 +411,16 @@ static int easycap_alsa_hw_free(struct snd_pcm_substream *pss)
struct snd_pcm_runtime *prt; struct snd_pcm_runtime *prt;
JOT(4, "\n"); JOT(4, "\n");
if (NULL == pss) { if (!pss) {
SAY("ERROR: pss is NULL\n"); SAY("ERROR: pss is NULL\n");
return -EFAULT; return -EFAULT;
} }
prt = pss->runtime; prt = pss->runtime;
if (NULL == prt) { if (!prt) {
SAY("ERROR: substream.runtime is NULL\n"); SAY("ERROR: substream.runtime is NULL\n");
return -EFAULT; return -EFAULT;
} }
if (NULL != prt->dma_area) { if (prt->dma_area) {
JOT(8, "prt->dma_area = %p\n", prt->dma_area); JOT(8, "prt->dma_area = %p\n", prt->dma_area);
vfree(prt->dma_area); vfree(prt->dma_area);
prt->dma_area = NULL; prt->dma_area = NULL;
...@@ -435,13 +435,13 @@ static int easycap_alsa_prepare(struct snd_pcm_substream *pss) ...@@ -435,13 +435,13 @@ static int easycap_alsa_prepare(struct snd_pcm_substream *pss)
struct snd_pcm_runtime *prt; struct snd_pcm_runtime *prt;
JOT(4, "\n"); JOT(4, "\n");
if (NULL == pss) { if (!pss) {
SAY("ERROR: pss is NULL\n"); SAY("ERROR: pss is NULL\n");
return -EFAULT; return -EFAULT;
} }
prt = pss->runtime; prt = pss->runtime;
peasycap = snd_pcm_substream_chip(pss); peasycap = snd_pcm_substream_chip(pss);
if (NULL == peasycap) { if (!peasycap) {
SAY("ERROR: peasycap is NULL\n"); SAY("ERROR: peasycap is NULL\n");
return -EFAULT; return -EFAULT;
} }
...@@ -483,12 +483,12 @@ static int easycap_alsa_trigger(struct snd_pcm_substream *pss, int cmd) ...@@ -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, JOT(4, "%i=cmd cf %i=START %i=STOP\n", cmd, SNDRV_PCM_TRIGGER_START,
SNDRV_PCM_TRIGGER_STOP); SNDRV_PCM_TRIGGER_STOP);
if (NULL == pss) { if (!pss) {
SAY("ERROR: pss is NULL\n"); SAY("ERROR: pss is NULL\n");
return -EFAULT; return -EFAULT;
} }
peasycap = snd_pcm_substream_chip(pss); peasycap = snd_pcm_substream_chip(pss);
if (NULL == peasycap) { if (!peasycap) {
SAY("ERROR: peasycap is NULL\n"); SAY("ERROR: peasycap is NULL\n");
return -EFAULT; return -EFAULT;
} }
...@@ -518,12 +518,12 @@ static snd_pcm_uframes_t easycap_alsa_pointer(struct snd_pcm_substream *pss) ...@@ -518,12 +518,12 @@ static snd_pcm_uframes_t easycap_alsa_pointer(struct snd_pcm_substream *pss)
snd_pcm_uframes_t offset; snd_pcm_uframes_t offset;
JOT(16, "\n"); JOT(16, "\n");
if (NULL == pss) { if (!pss) {
SAY("ERROR: pss is NULL\n"); SAY("ERROR: pss is NULL\n");
return -EFAULT; return -EFAULT;
} }
peasycap = snd_pcm_substream_chip(pss); peasycap = snd_pcm_substream_chip(pss);
if (NULL == peasycap) { if (!peasycap) {
SAY("ERROR: peasycap is NULL\n"); SAY("ERROR: peasycap is NULL\n");
return -EFAULT; return -EFAULT;
} }
...@@ -584,7 +584,7 @@ int easycap_alsa_probe(struct easycap *peasycap) ...@@ -584,7 +584,7 @@ int easycap_alsa_probe(struct easycap *peasycap)
struct snd_card *psnd_card; struct snd_card *psnd_card;
struct snd_pcm *psnd_pcm; struct snd_pcm *psnd_pcm;
if (NULL == peasycap) { if (!peasycap) {
SAY("ERROR: peasycap is NULL\n"); SAY("ERROR: peasycap is NULL\n");
return -ENODEV; return -ENODEV;
} }
...@@ -669,11 +669,11 @@ easycap_sound_setup(struct easycap *peasycap) ...@@ -669,11 +669,11 @@ easycap_sound_setup(struct easycap *peasycap)
JOM(4, "starting initialization\n"); JOM(4, "starting initialization\n");
if (NULL == peasycap) { if (!peasycap) {
SAY("ERROR: peasycap is NULL.\n"); SAY("ERROR: peasycap is NULL.\n");
return -EFAULT; return -EFAULT;
} }
if (NULL == peasycap->pusb_device) { if (!peasycap->pusb_device) {
SAM("ERROR: peasycap->pusb_device is NULL\n"); SAM("ERROR: peasycap->pusb_device is NULL\n");
return -ENODEV; return -ENODEV;
} }
...@@ -682,12 +682,12 @@ easycap_sound_setup(struct easycap *peasycap) ...@@ -682,12 +682,12 @@ easycap_sound_setup(struct easycap *peasycap)
rc = audio_setup(peasycap); rc = audio_setup(peasycap);
JOM(8, "audio_setup() returned %i\n", rc); 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"); SAM("ERROR: peasycap->pusb_device has become NULL\n");
return -ENODEV; return -ENODEV;
} }
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/
if (NULL == peasycap->pusb_device) { if (!peasycap->pusb_device) {
SAM("ERROR: peasycap->pusb_device has become NULL\n"); SAM("ERROR: peasycap->pusb_device has become NULL\n");
return -ENODEV; return -ENODEV;
} }
...@@ -725,15 +725,15 @@ submit_audio_urbs(struct easycap *peasycap) ...@@ -725,15 +725,15 @@ submit_audio_urbs(struct easycap *peasycap)
int j, isbad, nospc, m, rc; int j, isbad, nospc, m, rc;
int isbuf; int isbuf;
if (NULL == peasycap) { if (!peasycap) {
SAY("ERROR: peasycap is NULL\n"); SAY("ERROR: peasycap is NULL\n");
return -EFAULT; return -EFAULT;
} }
if (NULL == peasycap->purb_audio_head) { if (!peasycap->purb_audio_head) {
SAM("ERROR: peasycap->urb_audio_head uninitialized\n"); SAM("ERROR: peasycap->urb_audio_head uninitialized\n");
return -EFAULT; return -EFAULT;
} }
if (NULL == peasycap->pusb_device) { if (!peasycap->pusb_device) {
SAM("ERROR: peasycap->pusb_device is NULL\n"); SAM("ERROR: peasycap->pusb_device is NULL\n");
return -EFAULT; return -EFAULT;
} }
...@@ -751,9 +751,9 @@ submit_audio_urbs(struct easycap *peasycap) ...@@ -751,9 +751,9 @@ submit_audio_urbs(struct easycap *peasycap)
m = 0; m = 0;
list_for_each(plist_head, (peasycap->purb_audio_head)) { list_for_each(plist_head, (peasycap->purb_audio_head)) {
pdata_urb = list_entry(plist_head, struct data_urb, list_head); pdata_urb = list_entry(plist_head, struct data_urb, list_head);
if (NULL != pdata_urb) { if (pdata_urb) {
purb = pdata_urb->purb; purb = pdata_urb->purb;
if (NULL != purb) { if (purb) {
isbuf = pdata_urb->isbuf; isbuf = pdata_urb->isbuf;
purb->interval = 1; purb->interval = 1;
...@@ -801,9 +801,9 @@ submit_audio_urbs(struct easycap *peasycap) ...@@ -801,9 +801,9 @@ submit_audio_urbs(struct easycap *peasycap)
JOM(4, "attempting cleanup instead of submitting\n"); JOM(4, "attempting cleanup instead of submitting\n");
list_for_each(plist_head, (peasycap->purb_audio_head)) { list_for_each(plist_head, (peasycap->purb_audio_head)) {
pdata_urb = list_entry(plist_head, struct data_urb, list_head); pdata_urb = list_entry(plist_head, struct data_urb, list_head);
if (NULL != pdata_urb) { if (pdata_urb) {
purb = pdata_urb->purb; purb = pdata_urb->purb;
if (NULL != purb) if (purb)
usb_kill_urb(purb); usb_kill_urb(purb);
} }
} }
...@@ -830,19 +830,19 @@ kill_audio_urbs(struct easycap *peasycap) ...@@ -830,19 +830,19 @@ kill_audio_urbs(struct easycap *peasycap)
struct list_head *plist_head; struct list_head *plist_head;
struct data_urb *pdata_urb; struct data_urb *pdata_urb;
if (NULL == peasycap) { if (!peasycap) {
SAY("ERROR: peasycap is NULL\n"); SAY("ERROR: peasycap is NULL\n");
return -EFAULT; return -EFAULT;
} }
if (peasycap->audio_isoc_streaming) { if (peasycap->audio_isoc_streaming) {
if (NULL != peasycap->purb_audio_head) { if (peasycap->purb_audio_head) {
peasycap->audio_isoc_streaming = 0; peasycap->audio_isoc_streaming = 0;
JOM(4, "killing audio urbs\n"); JOM(4, "killing audio urbs\n");
m = 0; m = 0;
list_for_each(plist_head, (peasycap->purb_audio_head)) { list_for_each(plist_head, (peasycap->purb_audio_head)) {
pdata_urb = list_entry(plist_head, struct data_urb, list_head); pdata_urb = list_entry(plist_head, struct data_urb, list_head);
if (NULL != pdata_urb) { if (pdata_urb) {
if (NULL != pdata_urb->purb) { if (pdata_urb->purb) {
usb_kill_urb(pdata_urb->purb); usb_kill_urb(pdata_urb->purb);
m++; m++;
} }
......
...@@ -63,12 +63,12 @@ easyoss_complete(struct urb *purb) ...@@ -63,12 +63,12 @@ easyoss_complete(struct urb *purb)
JOT(16, "\n"); JOT(16, "\n");
if (NULL == purb) { if (!purb) {
SAY("ERROR: purb is NULL\n"); SAY("ERROR: purb is NULL\n");
return; return;
} }
peasycap = purb->context; peasycap = purb->context;
if (NULL == peasycap) { if (!peasycap) {
SAY("ERROR: peasycap is NULL\n"); SAY("ERROR: peasycap is NULL\n");
return; return;
} }
...@@ -288,13 +288,13 @@ static int easyoss_open(struct inode *inode, struct file *file) ...@@ -288,13 +288,13 @@ static int easyoss_open(struct inode *inode, struct file *file)
subminor = iminor(inode); subminor = iminor(inode);
pusb_interface = usb_find_interface(&easycap_usb_driver, subminor); pusb_interface = usb_find_interface(&easycap_usb_driver, subminor);
if (NULL == pusb_interface) { if (!pusb_interface) {
SAY("ERROR: pusb_interface is NULL\n"); SAY("ERROR: pusb_interface is NULL\n");
SAY("ending unsuccessfully\n"); SAY("ending unsuccessfully\n");
return -1; return -1;
} }
peasycap = usb_get_intfdata(pusb_interface); peasycap = usb_get_intfdata(pusb_interface);
if (NULL == peasycap) { if (!peasycap) {
SAY("ERROR: peasycap is NULL\n"); SAY("ERROR: peasycap is NULL\n");
SAY("ending unsuccessfully\n"); SAY("ending unsuccessfully\n");
return -1; return -1;
...@@ -311,7 +311,7 @@ static int easyoss_open(struct inode *inode, struct file *file) ...@@ -311,7 +311,7 @@ static int easyoss_open(struct inode *inode, struct file *file)
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/
if (memcmp(&peasycap->telltale[0], TELLTALE, strlen(TELLTALE))) { if (memcmp(&peasycap->telltale[0], TELLTALE, strlen(TELLTALE))) {
pv4l2_device = usb_get_intfdata(pusb_interface); pv4l2_device = usb_get_intfdata(pusb_interface);
if (NULL == pv4l2_device) { if (!pv4l2_device) {
SAY("ERROR: pv4l2_device is NULL\n"); SAY("ERROR: pv4l2_device is NULL\n");
return -EFAULT; return -EFAULT;
} }
...@@ -343,7 +343,7 @@ static int easyoss_release(struct inode *inode, struct file *file) ...@@ -343,7 +343,7 @@ static int easyoss_release(struct inode *inode, struct file *file)
JOT(4, "begins\n"); JOT(4, "begins\n");
peasycap = file->private_data; peasycap = file->private_data;
if (NULL == peasycap) { if (!peasycap) {
SAY("ERROR: peasycap is NULL.\n"); SAY("ERROR: peasycap is NULL.\n");
return -EFAULT; return -EFAULT;
} }
...@@ -385,12 +385,12 @@ static ssize_t easyoss_read(struct file *file, char __user *puserspacebuffer, ...@@ -385,12 +385,12 @@ static ssize_t easyoss_read(struct file *file, char __user *puserspacebuffer,
JOT(8, "%5zd=kount %5lld=*poff\n", kount, *poff); JOT(8, "%5zd=kount %5lld=*poff\n", kount, *poff);
if (NULL == file) { if (!file) {
SAY("ERROR: file is NULL\n"); SAY("ERROR: file is NULL\n");
return -ERESTARTSYS; return -ERESTARTSYS;
} }
peasycap = file->private_data; peasycap = file->private_data;
if (NULL == peasycap) { if (!peasycap) {
SAY("ERROR in easyoss_read(): peasycap is NULL\n"); SAY("ERROR in easyoss_read(): peasycap is NULL\n");
return -EFAULT; return -EFAULT;
} }
...@@ -398,7 +398,7 @@ static ssize_t easyoss_read(struct file *file, char __user *puserspacebuffer, ...@@ -398,7 +398,7 @@ static ssize_t easyoss_read(struct file *file, char __user *puserspacebuffer,
SAY("ERROR: bad peasycap: %p\n", peasycap); SAY("ERROR: bad peasycap: %p\n", peasycap);
return -EFAULT; return -EFAULT;
} }
if (NULL == peasycap->pusb_device) { if (!peasycap->pusb_device) {
SAY("ERROR: peasycap->pusb_device is NULL\n"); SAY("ERROR: peasycap->pusb_device is NULL\n");
return -EFAULT; return -EFAULT;
} }
...@@ -418,13 +418,13 @@ static ssize_t easyoss_read(struct file *file, char __user *puserspacebuffer, ...@@ -418,13 +418,13 @@ static ssize_t easyoss_read(struct file *file, char __user *puserspacebuffer,
*/ */
if (kd != isdongle(peasycap)) if (kd != isdongle(peasycap))
return -ERESTARTSYS; return -ERESTARTSYS;
if (NULL == file) { if (!file) {
SAY("ERROR: file is NULL\n"); SAY("ERROR: file is NULL\n");
mutex_unlock(&easycapdc60_dongle[kd].mutex_audio); mutex_unlock(&easycapdc60_dongle[kd].mutex_audio);
return -ERESTARTSYS; return -ERESTARTSYS;
} }
peasycap = file->private_data; peasycap = file->private_data;
if (NULL == peasycap) { if (!peasycap) {
SAY("ERROR: peasycap is NULL\n"); SAY("ERROR: peasycap is NULL\n");
mutex_unlock(&easycapdc60_dongle[kd].mutex_audio); mutex_unlock(&easycapdc60_dongle[kd].mutex_audio);
return -ERESTARTSYS; return -ERESTARTSYS;
...@@ -434,7 +434,7 @@ static ssize_t easyoss_read(struct file *file, char __user *puserspacebuffer, ...@@ -434,7 +434,7 @@ static ssize_t easyoss_read(struct file *file, char __user *puserspacebuffer,
mutex_unlock(&easycapdc60_dongle[kd].mutex_audio); mutex_unlock(&easycapdc60_dongle[kd].mutex_audio);
return -ERESTARTSYS; return -ERESTARTSYS;
} }
if (NULL == peasycap->pusb_device) { if (!peasycap->pusb_device) {
SAM("ERROR: peasycap->pusb_device is NULL\n"); SAM("ERROR: peasycap->pusb_device is NULL\n");
mutex_unlock(&easycapdc60_dongle[kd].mutex_audio); mutex_unlock(&easycapdc60_dongle[kd].mutex_audio);
return -ERESTARTSYS; return -ERESTARTSYS;
...@@ -459,7 +459,7 @@ static ssize_t easyoss_read(struct file *file, char __user *puserspacebuffer, ...@@ -459,7 +459,7 @@ static ssize_t easyoss_read(struct file *file, char __user *puserspacebuffer,
return -EFAULT; return -EFAULT;
} }
pdata_buffer = &peasycap->audio_buffer[peasycap->audio_read]; pdata_buffer = &peasycap->audio_buffer[peasycap->audio_read];
if (NULL == pdata_buffer) { if (!pdata_buffer) {
SAM("ERROR: pdata_buffer is NULL\n"); SAM("ERROR: pdata_buffer is NULL\n");
mutex_unlock(&easycapdc60_dongle[kd].mutex_audio); mutex_unlock(&easycapdc60_dongle[kd].mutex_audio);
return -EFAULT; return -EFAULT;
...@@ -510,12 +510,12 @@ static ssize_t easyoss_read(struct file *file, char __user *puserspacebuffer, ...@@ -510,12 +510,12 @@ static ssize_t easyoss_read(struct file *file, char __user *puserspacebuffer,
szret = (size_t)0; szret = (size_t)0;
fragment = (peasycap->audio_read / peasycap->audio_pages_per_fragment); fragment = (peasycap->audio_read / peasycap->audio_pages_per_fragment);
while (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"); SAM("ERROR: pdata_buffer->pgo is NULL\n");
mutex_unlock(&easycapdc60_dongle[kd].mutex_audio); mutex_unlock(&easycapdc60_dongle[kd].mutex_audio);
return -EFAULT; return -EFAULT;
} }
if (NULL == pdata_buffer->pto) { if (!pdata_buffer->pto) {
SAM("ERROR: pdata_buffer->pto is NULL\n"); SAM("ERROR: pdata_buffer->pto is NULL\n");
mutex_unlock(&easycapdc60_dongle[kd].mutex_audio); mutex_unlock(&easycapdc60_dongle[kd].mutex_audio);
return -EFAULT; return -EFAULT;
...@@ -543,17 +543,17 @@ static ssize_t easyoss_read(struct file *file, char __user *puserspacebuffer, ...@@ -543,17 +543,17 @@ static ssize_t easyoss_read(struct file *file, char __user *puserspacebuffer,
return -EFAULT; return -EFAULT;
} }
pdata_buffer = &peasycap->audio_buffer[peasycap->audio_read]; pdata_buffer = &peasycap->audio_buffer[peasycap->audio_read];
if (NULL == pdata_buffer) { if (!pdata_buffer) {
SAM("ERROR: pdata_buffer is NULL\n"); SAM("ERROR: pdata_buffer is NULL\n");
mutex_unlock(&easycapdc60_dongle[kd].mutex_audio); mutex_unlock(&easycapdc60_dongle[kd].mutex_audio);
return -EFAULT; return -EFAULT;
} }
if (NULL == pdata_buffer->pgo) { if (!pdata_buffer->pgo) {
SAM("ERROR: pdata_buffer->pgo is NULL\n"); SAM("ERROR: pdata_buffer->pgo is NULL\n");
mutex_unlock(&easycapdc60_dongle[kd].mutex_audio); mutex_unlock(&easycapdc60_dongle[kd].mutex_audio);
return -EFAULT; return -EFAULT;
} }
if (NULL == pdata_buffer->pto) { if (!pdata_buffer->pto) {
SAM("ERROR: pdata_buffer->pto is NULL\n"); SAM("ERROR: pdata_buffer->pto is NULL\n");
mutex_unlock(&easycapdc60_dongle[kd].mutex_audio); mutex_unlock(&easycapdc60_dongle[kd].mutex_audio);
return -EFAULT; return -EFAULT;
...@@ -662,12 +662,12 @@ static long easyoss_unlocked_ioctl(struct file *file, ...@@ -662,12 +662,12 @@ static long easyoss_unlocked_ioctl(struct file *file,
struct usb_device *p; struct usb_device *p;
int kd; int kd;
if (NULL == file) { if (!file) {
SAY("ERROR: file is NULL\n"); SAY("ERROR: file is NULL\n");
return -ERESTARTSYS; return -ERESTARTSYS;
} }
peasycap = file->private_data; peasycap = file->private_data;
if (NULL == peasycap) { if (!peasycap) {
SAY("ERROR: peasycap is NULL.\n"); SAY("ERROR: peasycap is NULL.\n");
return -EFAULT; return -EFAULT;
} }
...@@ -676,7 +676,7 @@ static long easyoss_unlocked_ioctl(struct file *file, ...@@ -676,7 +676,7 @@ static long easyoss_unlocked_ioctl(struct file *file,
return -EFAULT; return -EFAULT;
} }
p = peasycap->pusb_device; p = peasycap->pusb_device;
if (NULL == p) { if (!p) {
SAM("ERROR: peasycap->pusb_device is NULL\n"); SAM("ERROR: peasycap->pusb_device is NULL\n");
return -EFAULT; return -EFAULT;
} }
...@@ -696,13 +696,13 @@ static long easyoss_unlocked_ioctl(struct file *file, ...@@ -696,13 +696,13 @@ static long easyoss_unlocked_ioctl(struct file *file,
*/ */
if (kd != isdongle(peasycap)) if (kd != isdongle(peasycap))
return -ERESTARTSYS; return -ERESTARTSYS;
if (NULL == file) { if (!file) {
SAY("ERROR: file is NULL\n"); SAY("ERROR: file is NULL\n");
mutex_unlock(&easycapdc60_dongle[kd].mutex_audio); mutex_unlock(&easycapdc60_dongle[kd].mutex_audio);
return -ERESTARTSYS; return -ERESTARTSYS;
} }
peasycap = file->private_data; peasycap = file->private_data;
if (NULL == peasycap) { if (!peasycap) {
SAY("ERROR: peasycap is NULL\n"); SAY("ERROR: peasycap is NULL\n");
mutex_unlock(&easycapdc60_dongle[kd].mutex_audio); mutex_unlock(&easycapdc60_dongle[kd].mutex_audio);
return -ERESTARTSYS; return -ERESTARTSYS;
...@@ -713,7 +713,7 @@ static long easyoss_unlocked_ioctl(struct file *file, ...@@ -713,7 +713,7 @@ static long easyoss_unlocked_ioctl(struct file *file,
return -EFAULT; return -EFAULT;
} }
p = peasycap->pusb_device; p = peasycap->pusb_device;
if (NULL == peasycap->pusb_device) { if (!peasycap->pusb_device) {
SAM("ERROR: peasycap->pusb_device is NULL\n"); SAM("ERROR: peasycap->pusb_device is NULL\n");
mutex_unlock(&easycapdc60_dongle[kd].mutex_audio); mutex_unlock(&easycapdc60_dongle[kd].mutex_audio);
return -ERESTARTSYS; return -ERESTARTSYS;
......
...@@ -39,7 +39,7 @@ easycap_testcard(struct easycap *peasycap, int field) ...@@ -39,7 +39,7 @@ easycap_testcard(struct easycap *peasycap, int field)
unsigned char bfbar[TESTCARD_BYTESPERLINE / 8], *p1, *p2; unsigned char bfbar[TESTCARD_BYTESPERLINE / 8], *p1, *p2;
struct data_buffer *pfield_buffer; struct data_buffer *pfield_buffer;
if (NULL == peasycap) { if (!peasycap) {
SAY("ERROR: peasycap is NULL\n"); SAY("ERROR: peasycap is NULL\n");
return; return;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment