|
@@ -350,7 +350,7 @@ static void capincci_free(struct capidev *cdev, u32 ncci)
|
|
if (ncci == 0xffffffff || np->ncci == ncci) {
|
|
if (ncci == 0xffffffff || np->ncci == ncci) {
|
|
*pp = (*pp)->next;
|
|
*pp = (*pp)->next;
|
|
#ifdef CONFIG_ISDN_CAPI_MIDDLEWARE
|
|
#ifdef CONFIG_ISDN_CAPI_MIDDLEWARE
|
|
- if ((mp = np->minorp) != 0) {
|
|
|
|
|
|
+ if ((mp = np->minorp) != NULL) {
|
|
#if defined(CONFIG_ISDN_CAPI_CAPIFS) || defined(CONFIG_ISDN_CAPI_CAPIFS_MODULE)
|
|
#if defined(CONFIG_ISDN_CAPI_CAPIFS) || defined(CONFIG_ISDN_CAPI_CAPIFS_MODULE)
|
|
capifs_free_ncci(mp->minor);
|
|
capifs_free_ncci(mp->minor);
|
|
#endif
|
|
#endif
|
|
@@ -366,7 +366,7 @@ static void capincci_free(struct capidev *cdev, u32 ncci)
|
|
}
|
|
}
|
|
#endif /* CONFIG_ISDN_CAPI_MIDDLEWARE */
|
|
#endif /* CONFIG_ISDN_CAPI_MIDDLEWARE */
|
|
kfree(np);
|
|
kfree(np);
|
|
- if (*pp == 0) return;
|
|
|
|
|
|
+ if (*pp == NULL) return;
|
|
} else {
|
|
} else {
|
|
pp = &(*pp)->next;
|
|
pp = &(*pp)->next;
|
|
}
|
|
}
|
|
@@ -483,7 +483,7 @@ static int handle_recv_skb(struct capiminor *mp, struct sk_buff *skb)
|
|
#endif
|
|
#endif
|
|
goto bad;
|
|
goto bad;
|
|
}
|
|
}
|
|
- if ((nskb = gen_data_b3_resp_for(mp, skb)) == 0) {
|
|
|
|
|
|
+ if ((nskb = gen_data_b3_resp_for(mp, skb)) == NULL) {
|
|
printk(KERN_ERR "capi: gen_data_b3_resp failed\n");
|
|
printk(KERN_ERR "capi: gen_data_b3_resp failed\n");
|
|
goto bad;
|
|
goto bad;
|
|
}
|
|
}
|
|
@@ -512,7 +512,7 @@ bad:
|
|
static void handle_minor_recv(struct capiminor *mp)
|
|
static void handle_minor_recv(struct capiminor *mp)
|
|
{
|
|
{
|
|
struct sk_buff *skb;
|
|
struct sk_buff *skb;
|
|
- while ((skb = skb_dequeue(&mp->inqueue)) != 0) {
|
|
|
|
|
|
+ while ((skb = skb_dequeue(&mp->inqueue)) != NULL) {
|
|
unsigned int len = skb->len;
|
|
unsigned int len = skb->len;
|
|
mp->inbytes -= len;
|
|
mp->inbytes -= len;
|
|
if (handle_recv_skb(mp, skb) < 0) {
|
|
if (handle_recv_skb(mp, skb) < 0) {
|
|
@@ -538,7 +538,7 @@ static int handle_minor_send(struct capiminor *mp)
|
|
return 0;
|
|
return 0;
|
|
}
|
|
}
|
|
|
|
|
|
- while ((skb = skb_dequeue(&mp->outqueue)) != 0) {
|
|
|
|
|
|
+ while ((skb = skb_dequeue(&mp->outqueue)) != NULL) {
|
|
datahandle = mp->datahandle;
|
|
datahandle = mp->datahandle;
|
|
len = (u16)skb->len;
|
|
len = (u16)skb->len;
|
|
skb_push(skb, CAPI_DATA_B3_REQ_LEN);
|
|
skb_push(skb, CAPI_DATA_B3_REQ_LEN);
|
|
@@ -689,19 +689,19 @@ capi_read(struct file *file, char __user *buf, size_t count, loff_t *ppos)
|
|
if (!cdev->ap.applid)
|
|
if (!cdev->ap.applid)
|
|
return -ENODEV;
|
|
return -ENODEV;
|
|
|
|
|
|
- if ((skb = skb_dequeue(&cdev->recvqueue)) == 0) {
|
|
|
|
|
|
+ if ((skb = skb_dequeue(&cdev->recvqueue)) == NULL) {
|
|
|
|
|
|
if (file->f_flags & O_NONBLOCK)
|
|
if (file->f_flags & O_NONBLOCK)
|
|
return -EAGAIN;
|
|
return -EAGAIN;
|
|
|
|
|
|
for (;;) {
|
|
for (;;) {
|
|
interruptible_sleep_on(&cdev->recvwait);
|
|
interruptible_sleep_on(&cdev->recvwait);
|
|
- if ((skb = skb_dequeue(&cdev->recvqueue)) != 0)
|
|
|
|
|
|
+ if ((skb = skb_dequeue(&cdev->recvqueue)) != NULL)
|
|
break;
|
|
break;
|
|
if (signal_pending(current))
|
|
if (signal_pending(current))
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
- if (skb == 0)
|
|
|
|
|
|
+ if (skb == NULL)
|
|
return -ERESTARTNOHAND;
|
|
return -ERESTARTNOHAND;
|
|
}
|
|
}
|
|
if (skb->len > count) {
|
|
if (skb->len > count) {
|
|
@@ -940,12 +940,12 @@ capi_ioctl(struct inode *inode, struct file *file,
|
|
return -EFAULT;
|
|
return -EFAULT;
|
|
|
|
|
|
mutex_lock(&cdev->ncci_list_mtx);
|
|
mutex_lock(&cdev->ncci_list_mtx);
|
|
- if ((nccip = capincci_find(cdev, (u32) ncci)) == 0) {
|
|
|
|
|
|
+ if ((nccip = capincci_find(cdev, (u32) ncci)) == NULL) {
|
|
mutex_unlock(&cdev->ncci_list_mtx);
|
|
mutex_unlock(&cdev->ncci_list_mtx);
|
|
return 0;
|
|
return 0;
|
|
}
|
|
}
|
|
#ifdef CONFIG_ISDN_CAPI_MIDDLEWARE
|
|
#ifdef CONFIG_ISDN_CAPI_MIDDLEWARE
|
|
- if ((mp = nccip->minorp) != 0) {
|
|
|
|
|
|
+ if ((mp = nccip->minorp) != NULL) {
|
|
count += atomic_read(&mp->ttyopencount);
|
|
count += atomic_read(&mp->ttyopencount);
|
|
}
|
|
}
|
|
#endif /* CONFIG_ISDN_CAPI_MIDDLEWARE */
|
|
#endif /* CONFIG_ISDN_CAPI_MIDDLEWARE */
|
|
@@ -966,7 +966,7 @@ capi_ioctl(struct inode *inode, struct file *file,
|
|
return -EFAULT;
|
|
return -EFAULT;
|
|
mutex_lock(&cdev->ncci_list_mtx);
|
|
mutex_lock(&cdev->ncci_list_mtx);
|
|
nccip = capincci_find(cdev, (u32) ncci);
|
|
nccip = capincci_find(cdev, (u32) ncci);
|
|
- if (!nccip || (mp = nccip->minorp) == 0) {
|
|
|
|
|
|
+ if (!nccip || (mp = nccip->minorp) == NULL) {
|
|
mutex_unlock(&cdev->ncci_list_mtx);
|
|
mutex_unlock(&cdev->ncci_list_mtx);
|
|
return -ESRCH;
|
|
return -ESRCH;
|
|
}
|
|
}
|
|
@@ -986,7 +986,7 @@ capi_open(struct inode *inode, struct file *file)
|
|
if (file->private_data)
|
|
if (file->private_data)
|
|
return -EEXIST;
|
|
return -EEXIST;
|
|
|
|
|
|
- if ((file->private_data = capidev_alloc()) == 0)
|
|
|
|
|
|
+ if ((file->private_data = capidev_alloc()) == NULL)
|
|
return -ENOMEM;
|
|
return -ENOMEM;
|
|
|
|
|
|
return nonseekable_open(inode, file);
|
|
return nonseekable_open(inode, file);
|
|
@@ -1023,9 +1023,9 @@ static int capinc_tty_open(struct tty_struct * tty, struct file * file)
|
|
struct capiminor *mp;
|
|
struct capiminor *mp;
|
|
unsigned long flags;
|
|
unsigned long flags;
|
|
|
|
|
|
- if ((mp = capiminor_find(iminor(file->f_path.dentry->d_inode))) == 0)
|
|
|
|
|
|
+ if ((mp = capiminor_find(iminor(file->f_path.dentry->d_inode))) == NULL)
|
|
return -ENXIO;
|
|
return -ENXIO;
|
|
- if (mp->nccip == 0)
|
|
|
|
|
|
+ if (mp->nccip == NULL)
|
|
return -ENXIO;
|
|
return -ENXIO;
|
|
|
|
|
|
tty->driver_data = (void *)mp;
|
|
tty->driver_data = (void *)mp;
|
|
@@ -1058,7 +1058,7 @@ static void capinc_tty_close(struct tty_struct * tty, struct file * file)
|
|
#ifdef _DEBUG_REFCOUNT
|
|
#ifdef _DEBUG_REFCOUNT
|
|
printk(KERN_DEBUG "capinc_tty_close ocount=%d\n", atomic_read(&mp->ttyopencount));
|
|
printk(KERN_DEBUG "capinc_tty_close ocount=%d\n", atomic_read(&mp->ttyopencount));
|
|
#endif
|
|
#endif
|
|
- if (mp->nccip == 0)
|
|
|
|
|
|
+ if (mp->nccip == NULL)
|
|
capiminor_free(mp);
|
|
capiminor_free(mp);
|
|
}
|
|
}
|
|
|
|
|
|
@@ -1526,9 +1526,9 @@ static int __init capi_init(void)
|
|
char *compileinfo;
|
|
char *compileinfo;
|
|
int major_ret;
|
|
int major_ret;
|
|
|
|
|
|
- if ((p = strchr(revision, ':')) != 0 && p[1]) {
|
|
|
|
|
|
+ if ((p = strchr(revision, ':')) != NULL && p[1]) {
|
|
strlcpy(rev, p + 2, sizeof(rev));
|
|
strlcpy(rev, p + 2, sizeof(rev));
|
|
- if ((p = strchr(rev, '$')) != 0 && p > rev)
|
|
|
|
|
|
+ if ((p = strchr(rev, '$')) != NULL && p > rev)
|
|
*(p-1) = 0;
|
|
*(p-1) = 0;
|
|
} else
|
|
} else
|
|
strcpy(rev, "1.0");
|
|
strcpy(rev, "1.0");
|