mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-03 23:58:05 +00:00
[PATCH] isdn4linux: Siemens Gigaset drivers: uninline
With Hansjoerg Lipp <hjlipp@web.de> Uninline a function which was slightly too big to warrant inlining. Signed-off-by: Hansjoerg Lipp <hjlipp@web.de> Signed-off-by: Tilman Schmidt <tilman@imap.cc> Cc: Karsten Keil <kkeil@suse.de> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
This commit is contained in:
parent
d48c77841a
commit
714e8236e5
2 changed files with 43 additions and 40 deletions
|
@ -521,6 +521,47 @@ static void gigaset_inbuf_init(struct inbuf_t *inbuf, struct bc_state *bcs,
|
||||||
inbuf->inputstate = inputstate;
|
inbuf->inputstate = inputstate;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* append received bytes to inbuf */
|
||||||
|
int gigaset_fill_inbuf(struct inbuf_t *inbuf, const unsigned char *src,
|
||||||
|
unsigned numbytes)
|
||||||
|
{
|
||||||
|
unsigned n, head, tail, bytesleft;
|
||||||
|
|
||||||
|
gig_dbg(DEBUG_INTR, "received %u bytes", numbytes);
|
||||||
|
|
||||||
|
if (!numbytes)
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
bytesleft = numbytes;
|
||||||
|
tail = atomic_read(&inbuf->tail);
|
||||||
|
head = atomic_read(&inbuf->head);
|
||||||
|
gig_dbg(DEBUG_INTR, "buffer state: %u -> %u", head, tail);
|
||||||
|
|
||||||
|
while (bytesleft) {
|
||||||
|
if (head > tail)
|
||||||
|
n = head - 1 - tail;
|
||||||
|
else if (head == 0)
|
||||||
|
n = (RBUFSIZE-1) - tail;
|
||||||
|
else
|
||||||
|
n = RBUFSIZE - tail;
|
||||||
|
if (!n) {
|
||||||
|
dev_err(inbuf->cs->dev,
|
||||||
|
"buffer overflow (%u bytes lost)", bytesleft);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
if (n > bytesleft)
|
||||||
|
n = bytesleft;
|
||||||
|
memcpy(inbuf->data + tail, src, n);
|
||||||
|
bytesleft -= n;
|
||||||
|
tail = (tail + n) % RBUFSIZE;
|
||||||
|
src += n;
|
||||||
|
}
|
||||||
|
gig_dbg(DEBUG_INTR, "setting tail to %u", tail);
|
||||||
|
atomic_set(&inbuf->tail, tail);
|
||||||
|
return numbytes != bytesleft;
|
||||||
|
}
|
||||||
|
EXPORT_SYMBOL_GPL(gigaset_fill_inbuf);
|
||||||
|
|
||||||
/* Initialize the b-channel structure */
|
/* Initialize the b-channel structure */
|
||||||
static struct bc_state *gigaset_initbcs(struct bc_state *bcs,
|
static struct bc_state *gigaset_initbcs(struct bc_state *bcs,
|
||||||
struct cardstate *cs, int channel)
|
struct cardstate *cs, int channel)
|
||||||
|
|
|
@ -902,47 +902,9 @@ static inline void gigaset_rcv_error(struct sk_buff *procskb,
|
||||||
/* bitwise byte inversion table */
|
/* bitwise byte inversion table */
|
||||||
extern __u8 gigaset_invtab[]; /* in common.c */
|
extern __u8 gigaset_invtab[]; /* in common.c */
|
||||||
|
|
||||||
|
|
||||||
/* append received bytes to inbuf */
|
/* append received bytes to inbuf */
|
||||||
static inline int gigaset_fill_inbuf(struct inbuf_t *inbuf,
|
int gigaset_fill_inbuf(struct inbuf_t *inbuf, const unsigned char *src,
|
||||||
const unsigned char *src,
|
unsigned numbytes);
|
||||||
unsigned numbytes)
|
|
||||||
{
|
|
||||||
unsigned n, head, tail, bytesleft;
|
|
||||||
|
|
||||||
gig_dbg(DEBUG_INTR, "received %u bytes", numbytes);
|
|
||||||
|
|
||||||
if (!numbytes)
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
bytesleft = numbytes;
|
|
||||||
tail = atomic_read(&inbuf->tail);
|
|
||||||
head = atomic_read(&inbuf->head);
|
|
||||||
gig_dbg(DEBUG_INTR, "buffer state: %u -> %u", head, tail);
|
|
||||||
|
|
||||||
while (bytesleft) {
|
|
||||||
if (head > tail)
|
|
||||||
n = head - 1 - tail;
|
|
||||||
else if (head == 0)
|
|
||||||
n = (RBUFSIZE-1) - tail;
|
|
||||||
else
|
|
||||||
n = RBUFSIZE - tail;
|
|
||||||
if (!n) {
|
|
||||||
dev_err(inbuf->cs->dev,
|
|
||||||
"buffer overflow (%u bytes lost)", bytesleft);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
if (n > bytesleft)
|
|
||||||
n = bytesleft;
|
|
||||||
memcpy(inbuf->data + tail, src, n);
|
|
||||||
bytesleft -= n;
|
|
||||||
tail = (tail + n) % RBUFSIZE;
|
|
||||||
src += n;
|
|
||||||
}
|
|
||||||
gig_dbg(DEBUG_INTR, "setting tail to %u", tail);
|
|
||||||
atomic_set(&inbuf->tail, tail);
|
|
||||||
return numbytes != bytesleft;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* ===========================================================================
|
/* ===========================================================================
|
||||||
* Functions implemented in interface.c
|
* Functions implemented in interface.c
|
||||||
|
|
Loading…
Reference in a new issue