aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/isdn/capi
diff options
context:
space:
mode:
authorTilman Schmidt <tilman@imap.cc>2012-04-25 09:02:20 -0400
committerDavid S. Miller <davem@davemloft.net>2012-05-07 22:37:57 -0400
commit7dc2ce5f12cb5d166140820d5063027dc2449ac1 (patch)
tree19eb6c0efdc277a61af8fe6089dfc0b620ae8a23 /drivers/isdn/capi
parent7fdaadcc2ee4d43eb43c564dbef85b768565cd7a (diff)
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>
Diffstat (limited to 'drivers/isdn/capi')
-rw-r--r--drivers/isdn/capi/capi.c27
1 files changed, 13 insertions, 14 deletions
diff --git a/drivers/isdn/capi/capi.c b/drivers/isdn/capi/capi.c
index 9ee399145fb3..38c4bd87b2c9 100644
--- a/drivers/isdn/capi/capi.c
+++ b/drivers/isdn/capi/capi.c
@@ -336,11 +336,6 @@ static inline void
336capincci_alloc_minor(struct capidev *cdev, struct capincci *np) { } 336capincci_alloc_minor(struct capidev *cdev, struct capincci *np) { }
337static inline void capincci_free_minor(struct capincci *np) { } 337static inline void capincci_free_minor(struct capincci *np) { }
338 338
339static inline unsigned int capincci_minor_opencount(struct capincci *np)
340{
341 return 0;
342}
343
344#endif /* !CONFIG_ISDN_CAPI_MIDDLEWARE */ 339#endif /* !CONFIG_ISDN_CAPI_MIDDLEWARE */
345 340
346static struct capincci *capincci_alloc(struct capidev *cdev, u32 ncci) 341static struct capincci *capincci_alloc(struct capidev *cdev, u32 ncci)
@@ -372,6 +367,7 @@ static void capincci_free(struct capidev *cdev, u32 ncci)
372 } 367 }
373} 368}
374 369
370#ifdef CONFIG_ISDN_CAPI_MIDDLEWARE
375static struct capincci *capincci_find(struct capidev *cdev, u32 ncci) 371static struct capincci *capincci_find(struct capidev *cdev, u32 ncci)
376{ 372{
377 struct capincci *np; 373 struct capincci *np;
@@ -382,7 +378,6 @@ static struct capincci *capincci_find(struct capidev *cdev, u32 ncci)
382 return NULL; 378 return NULL;
383} 379}
384 380
385#ifdef CONFIG_ISDN_CAPI_MIDDLEWARE
386/* -------- handle data queue --------------------------------------- */ 381/* -------- handle data queue --------------------------------------- */
387 382
388static struct sk_buff * 383static struct sk_buff *
@@ -578,8 +573,8 @@ static void capi_recv_message(struct capi20_appl *ap, struct sk_buff *skb)
578 struct tty_struct *tty; 573 struct tty_struct *tty;
579 struct capiminor *mp; 574 struct capiminor *mp;
580 u16 datahandle; 575 u16 datahandle;
581#endif /* CONFIG_ISDN_CAPI_MIDDLEWARE */
582 struct capincci *np; 576 struct capincci *np;
577#endif /* CONFIG_ISDN_CAPI_MIDDLEWARE */
583 578
584 mutex_lock(&cdev->lock); 579 mutex_lock(&cdev->lock);
585 580
@@ -597,6 +592,12 @@ static void capi_recv_message(struct capi20_appl *ap, struct sk_buff *skb)
597 goto unlock_out; 592 goto unlock_out;
598 } 593 }
599 594
595#ifndef CONFIG_ISDN_CAPI_MIDDLEWARE
596 skb_queue_tail(&cdev->recvqueue, skb);
597 wake_up_interruptible(&cdev->recvwait);
598
599#else /* CONFIG_ISDN_CAPI_MIDDLEWARE */
600
600 np = capincci_find(cdev, CAPIMSG_CONTROL(skb->data)); 601 np = capincci_find(cdev, CAPIMSG_CONTROL(skb->data));
601 if (!np) { 602 if (!np) {
602 printk(KERN_ERR "BUG: capi_signal: ncci not found\n"); 603 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)
605 goto unlock_out; 606 goto unlock_out;
606 } 607 }
607 608
608#ifndef CONFIG_ISDN_CAPI_MIDDLEWARE
609 skb_queue_tail(&cdev->recvqueue, skb);
610 wake_up_interruptible(&cdev->recvwait);
611
612#else /* CONFIG_ISDN_CAPI_MIDDLEWARE */
613
614 mp = np->minorp; 609 mp = np->minorp;
615 if (!mp) { 610 if (!mp) {
616 skb_queue_tail(&cdev->recvqueue, skb); 611 skb_queue_tail(&cdev->recvqueue, skb);
@@ -893,6 +888,11 @@ register_out:
893 return -EFAULT; 888 return -EFAULT;
894 return 0; 889 return 0;
895 890
891#ifndef CONFIG_ISDN_CAPI_MIDDLEWARE
892 case CAPI_NCCI_OPENCOUNT:
893 return 0;
894
895#else /* CONFIG_ISDN_CAPI_MIDDLEWARE */
896 case CAPI_NCCI_OPENCOUNT: { 896 case CAPI_NCCI_OPENCOUNT: {
897 struct capincci *nccip; 897 struct capincci *nccip;
898 unsigned ncci; 898 unsigned ncci;
@@ -909,7 +909,6 @@ register_out:
909 return count; 909 return count;
910 } 910 }
911 911
912#ifdef CONFIG_ISDN_CAPI_MIDDLEWARE
913 case CAPI_NCCI_GETUNIT: { 912 case CAPI_NCCI_GETUNIT: {
914 struct capincci *nccip; 913 struct capincci *nccip;
915 struct capiminor *mp; 914 struct capiminor *mp;