From: Tilman Schmidt <tilman@imap.cc>
To: Karsten Keil <isdn@linux-pingi.de>, David Miller <davem@davemloft.net>
Cc: Hansjoerg Lipp <hjlipp@web.de>, Karsten Keil <keil@b1-systems.de>,
i4ldeveloper@listserv.isdn4linux.de, netdev@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: [PATCH 8/8] isdn/capi: elliminate capincci_find() in non-middleware case
Date: Thu, 26 Apr 2012 01:02:20 +0200 (CEST) [thread overview]
Message-ID: <20120425-patch-gigaset-08.tilman@imap.cc> (raw)
In-Reply-To: <20120425-patch-gigaset-00.tilman@imap.cc>
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>
---
drivers/isdn/capi/capi.c | 27 +++++++++++++--------------
1 files changed, 13 insertions(+), 14 deletions(-)
diff --git a/drivers/isdn/capi/capi.c b/drivers/isdn/capi/capi.c
index 9ee3991..38c4bd8 100644
--- a/drivers/isdn/capi/capi.c
+++ b/drivers/isdn/capi/capi.c
@@ -336,11 +336,6 @@ static inline void
capincci_alloc_minor(struct capidev *cdev, 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 */
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)
{
struct capincci *np;
@@ -382,7 +378,6 @@ static struct capincci *capincci_find(struct capidev *cdev, u32 ncci)
return NULL;
}
-#ifdef CONFIG_ISDN_CAPI_MIDDLEWARE
/* -------- handle data queue --------------------------------------- */
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 capiminor *mp;
u16 datahandle;
-#endif /* CONFIG_ISDN_CAPI_MIDDLEWARE */
struct capincci *np;
+#endif /* CONFIG_ISDN_CAPI_MIDDLEWARE */
mutex_lock(&cdev->lock);
@@ -597,6 +592,12 @@ static void capi_recv_message(struct capi20_appl *ap, struct sk_buff *skb)
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));
if (!np) {
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;
}
-#ifndef CONFIG_ISDN_CAPI_MIDDLEWARE
- skb_queue_tail(&cdev->recvqueue, skb);
- wake_up_interruptible(&cdev->recvwait);
-
-#else /* CONFIG_ISDN_CAPI_MIDDLEWARE */
-
mp = np->minorp;
if (!mp) {
skb_queue_tail(&cdev->recvqueue, skb);
@@ -893,6 +888,11 @@ register_out:
return -EFAULT;
return 0;
+#ifndef CONFIG_ISDN_CAPI_MIDDLEWARE
+ case CAPI_NCCI_OPENCOUNT:
+ return 0;
+
+#else /* CONFIG_ISDN_CAPI_MIDDLEWARE */
case CAPI_NCCI_OPENCOUNT: {
struct capincci *nccip;
unsigned ncci;
@@ -909,7 +909,6 @@ register_out:
return count;
}
-#ifdef CONFIG_ISDN_CAPI_MIDDLEWARE
case CAPI_NCCI_GETUNIT: {
struct capincci *nccip;
struct capiminor *mp;
--
1.7.3.4
next prev parent reply other threads:[~2012-04-25 23:02 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-04-25 23:02 [PATCH 0/8] ISDN patches for net-next Tilman Schmidt
2012-04-25 23:02 ` [PATCH 1/8] isdn/gigaset: ratelimit CAPI message dumps Tilman Schmidt
2012-04-26 6:39 ` Karsten Keil
2012-04-27 10:29 ` Tilman Schmidt
2012-04-28 9:29 ` Karsten Keil
2012-04-25 23:02 ` Tilman Schmidt [this message]
2012-04-25 23:02 ` [PATCH 3/8] isdn/gigaset: improve error handling querying firmware version Tilman Schmidt
2012-04-25 23:02 ` [PATCH 4/8] isdn/gigaset: fix readability damage Tilman Schmidt
2012-04-25 23:02 ` [PATCH 2/8] isdn/gigaset: fix CAPI disconnect B3 handling Tilman Schmidt
2012-04-25 23:02 ` [PATCH 6/8] isdn/gigaset: unify function return values Tilman Schmidt
2012-04-25 23:02 ` [PATCH 5/8] isdn/gigaset: internal function name cleanup Tilman Schmidt
2012-04-25 23:02 ` [PATCH 7/8] isdn/capi: fix readability damage Tilman Schmidt
2012-05-08 0:24 ` [PATCH 0/8] ISDN patches for net-next Tilman Schmidt
2012-05-08 2:29 ` David Miller
2012-05-08 2:42 ` David Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20120425-patch-gigaset-08.tilman@imap.cc \
--to=tilman@imap.cc \
--cc=davem@davemloft.net \
--cc=hjlipp@web.de \
--cc=i4ldeveloper@listserv.isdn4linux.de \
--cc=isdn@linux-pingi.de \
--cc=keil@b1-systems.de \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).