Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Tilman Schmidt and committed by
David S. Miller
7dc2ce5f 7fdaadcc

+13 -14
+13 -14
drivers/isdn/capi/capi.c
··· 336 336 capincci_alloc_minor(struct capidev *cdev, struct capincci *np) { } 337 337 static inline void capincci_free_minor(struct capincci *np) { } 338 338 339 - static inline unsigned int capincci_minor_opencount(struct capincci *np) 340 - { 341 - return 0; 342 - } 343 - 344 339 #endif /* !CONFIG_ISDN_CAPI_MIDDLEWARE */ 345 340 346 341 static struct capincci *capincci_alloc(struct capidev *cdev, u32 ncci) ··· 367 372 } 368 373 } 369 374 375 + #ifdef CONFIG_ISDN_CAPI_MIDDLEWARE 370 376 static struct capincci *capincci_find(struct capidev *cdev, u32 ncci) 371 377 { 372 378 struct capincci *np; ··· 378 382 return NULL; 379 383 } 380 384 381 - #ifdef CONFIG_ISDN_CAPI_MIDDLEWARE 382 385 /* -------- handle data queue --------------------------------------- */ 383 386 384 387 static struct sk_buff * ··· 573 578 struct tty_struct *tty; 574 579 struct capiminor *mp; 575 580 u16 datahandle; 576 - #endif /* CONFIG_ISDN_CAPI_MIDDLEWARE */ 577 581 struct capincci *np; 582 + #endif /* CONFIG_ISDN_CAPI_MIDDLEWARE */ 578 583 579 584 mutex_lock(&cdev->lock); 580 585 ··· 592 597 goto unlock_out; 593 598 } 594 599 600 + #ifndef CONFIG_ISDN_CAPI_MIDDLEWARE 601 + skb_queue_tail(&cdev->recvqueue, skb); 602 + wake_up_interruptible(&cdev->recvwait); 603 + 604 + #else /* CONFIG_ISDN_CAPI_MIDDLEWARE */ 605 + 595 606 np = capincci_find(cdev, CAPIMSG_CONTROL(skb->data)); 596 607 if (!np) { 597 608 printk(KERN_ERR "BUG: capi_signal: ncci not found\n"); ··· 605 604 wake_up_interruptible(&cdev->recvwait); 606 605 goto unlock_out; 607 606 } 608 - 609 - #ifndef CONFIG_ISDN_CAPI_MIDDLEWARE 610 - skb_queue_tail(&cdev->recvqueue, skb); 611 - wake_up_interruptible(&cdev->recvwait); 612 - 613 - #else /* CONFIG_ISDN_CAPI_MIDDLEWARE */ 614 607 615 608 mp = np->minorp; 616 609 if (!mp) { ··· 888 893 return -EFAULT; 889 894 return 0; 890 895 896 + #ifndef CONFIG_ISDN_CAPI_MIDDLEWARE 897 + case CAPI_NCCI_OPENCOUNT: 898 + return 0; 899 + 900 + #else /* CONFIG_ISDN_CAPI_MIDDLEWARE */ 891 901 case CAPI_NCCI_OPENCOUNT: { 892 902 struct capincci *nccip; 893 903 unsigned ncci; ··· 909 909 return count; 910 910 } 911 911 912 - #ifdef CONFIG_ISDN_CAPI_MIDDLEWARE 913 912 case CAPI_NCCI_GETUNIT: { 914 913 struct capincci *nccip; 915 914 struct capiminor *mp;