isdn/capi: elliminate capincci_find() in non-middleware case
If Kernel CAPI is compiled without CONFIG_ISDN_CAPI_MIDDLEWARE, the structure retrieved via capincci_find() is never actually used, so don't compile that function in that case. Signed-off-by: Tilman Schmidt <tilman@imap.cc> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
7fdaadcc2e
commit
7dc2ce5f12
|
@ -336,11 +336,6 @@ static inline void
|
||||||
capincci_alloc_minor(struct capidev *cdev, struct capincci *np) { }
|
capincci_alloc_minor(struct capidev *cdev, struct capincci *np) { }
|
||||||
static inline void capincci_free_minor(struct capincci *np) { }
|
static inline void capincci_free_minor(struct capincci *np) { }
|
||||||
|
|
||||||
static inline unsigned int capincci_minor_opencount(struct capincci *np)
|
|
||||||
{
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif /* !CONFIG_ISDN_CAPI_MIDDLEWARE */
|
#endif /* !CONFIG_ISDN_CAPI_MIDDLEWARE */
|
||||||
|
|
||||||
static struct capincci *capincci_alloc(struct capidev *cdev, u32 ncci)
|
static struct capincci *capincci_alloc(struct capidev *cdev, u32 ncci)
|
||||||
|
@ -372,6 +367,7 @@ static void capincci_free(struct capidev *cdev, u32 ncci)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef CONFIG_ISDN_CAPI_MIDDLEWARE
|
||||||
static struct capincci *capincci_find(struct capidev *cdev, u32 ncci)
|
static struct capincci *capincci_find(struct capidev *cdev, u32 ncci)
|
||||||
{
|
{
|
||||||
struct capincci *np;
|
struct capincci *np;
|
||||||
|
@ -382,7 +378,6 @@ static struct capincci *capincci_find(struct capidev *cdev, u32 ncci)
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef CONFIG_ISDN_CAPI_MIDDLEWARE
|
|
||||||
/* -------- handle data queue --------------------------------------- */
|
/* -------- handle data queue --------------------------------------- */
|
||||||
|
|
||||||
static struct sk_buff *
|
static struct sk_buff *
|
||||||
|
@ -578,8 +573,8 @@ static void capi_recv_message(struct capi20_appl *ap, struct sk_buff *skb)
|
||||||
struct tty_struct *tty;
|
struct tty_struct *tty;
|
||||||
struct capiminor *mp;
|
struct capiminor *mp;
|
||||||
u16 datahandle;
|
u16 datahandle;
|
||||||
#endif /* CONFIG_ISDN_CAPI_MIDDLEWARE */
|
|
||||||
struct capincci *np;
|
struct capincci *np;
|
||||||
|
#endif /* CONFIG_ISDN_CAPI_MIDDLEWARE */
|
||||||
|
|
||||||
mutex_lock(&cdev->lock);
|
mutex_lock(&cdev->lock);
|
||||||
|
|
||||||
|
@ -597,6 +592,12 @@ static void capi_recv_message(struct capi20_appl *ap, struct sk_buff *skb)
|
||||||
goto unlock_out;
|
goto unlock_out;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifndef CONFIG_ISDN_CAPI_MIDDLEWARE
|
||||||
|
skb_queue_tail(&cdev->recvqueue, skb);
|
||||||
|
wake_up_interruptible(&cdev->recvwait);
|
||||||
|
|
||||||
|
#else /* CONFIG_ISDN_CAPI_MIDDLEWARE */
|
||||||
|
|
||||||
np = capincci_find(cdev, CAPIMSG_CONTROL(skb->data));
|
np = capincci_find(cdev, CAPIMSG_CONTROL(skb->data));
|
||||||
if (!np) {
|
if (!np) {
|
||||||
printk(KERN_ERR "BUG: capi_signal: ncci not found\n");
|
printk(KERN_ERR "BUG: capi_signal: ncci not found\n");
|
||||||
|
@ -605,12 +606,6 @@ static void capi_recv_message(struct capi20_appl *ap, struct sk_buff *skb)
|
||||||
goto unlock_out;
|
goto unlock_out;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef CONFIG_ISDN_CAPI_MIDDLEWARE
|
|
||||||
skb_queue_tail(&cdev->recvqueue, skb);
|
|
||||||
wake_up_interruptible(&cdev->recvwait);
|
|
||||||
|
|
||||||
#else /* CONFIG_ISDN_CAPI_MIDDLEWARE */
|
|
||||||
|
|
||||||
mp = np->minorp;
|
mp = np->minorp;
|
||||||
if (!mp) {
|
if (!mp) {
|
||||||
skb_queue_tail(&cdev->recvqueue, skb);
|
skb_queue_tail(&cdev->recvqueue, skb);
|
||||||
|
@ -893,6 +888,11 @@ register_out:
|
||||||
return -EFAULT;
|
return -EFAULT;
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
#ifndef CONFIG_ISDN_CAPI_MIDDLEWARE
|
||||||
|
case CAPI_NCCI_OPENCOUNT:
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
#else /* CONFIG_ISDN_CAPI_MIDDLEWARE */
|
||||||
case CAPI_NCCI_OPENCOUNT: {
|
case CAPI_NCCI_OPENCOUNT: {
|
||||||
struct capincci *nccip;
|
struct capincci *nccip;
|
||||||
unsigned ncci;
|
unsigned ncci;
|
||||||
|
@ -909,7 +909,6 @@ register_out:
|
||||||
return count;
|
return count;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef CONFIG_ISDN_CAPI_MIDDLEWARE
|
|
||||||
case CAPI_NCCI_GETUNIT: {
|
case CAPI_NCCI_GETUNIT: {
|
||||||
struct capincci *nccip;
|
struct capincci *nccip;
|
||||||
struct capiminor *mp;
|
struct capiminor *mp;
|
||||||
|
|
Loading…
Reference in a new issue