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)
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 */
/*---------------------------------------------------------------------------*/
......
......@@ -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)
......
This diff is collapsed.
......@@ -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++;
}
......
......@@ -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;
......
......@@ -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;
}
......
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