aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/isdn/gigaset/asyncdata.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/isdn/gigaset/asyncdata.c')
-rw-r--r--drivers/isdn/gigaset/asyncdata.c27
1 files changed, 6 insertions, 21 deletions
diff --git a/drivers/isdn/gigaset/asyncdata.c b/drivers/isdn/gigaset/asyncdata.c
index a375d0a411b5..8601b7a8f6a6 100644
--- a/drivers/isdn/gigaset/asyncdata.c
+++ b/drivers/isdn/gigaset/asyncdata.c
@@ -117,20 +117,14 @@ static inline int hdlc_loop(unsigned char c, unsigned char *src, int numbytes,
117{ 117{
118 struct cardstate *cs = inbuf->cs; 118 struct cardstate *cs = inbuf->cs;
119 struct bc_state *bcs = inbuf->bcs; 119 struct bc_state *bcs = inbuf->bcs;
120 int inputstate; 120 int inputstate = bcs->inputstate;
121 __u16 fcs; 121 __u16 fcs = bcs->fcs;
122 struct sk_buff *skb; 122 struct sk_buff *skb = bcs->skb;
123 unsigned char error; 123 unsigned char error;
124 struct sk_buff *compskb; 124 struct sk_buff *compskb;
125 int startbytes = numbytes; 125 int startbytes = numbytes;
126 int l; 126 int l;
127 127
128 IFNULLRETVAL(bcs, numbytes);
129 inputstate = bcs->inputstate;
130 fcs = bcs->fcs;
131 skb = bcs->skb;
132 IFNULLRETVAL(skb, numbytes);
133
134 if (unlikely(inputstate & INS_byte_stuff)) { 128 if (unlikely(inputstate & INS_byte_stuff)) {
135 inputstate &= ~INS_byte_stuff; 129 inputstate &= ~INS_byte_stuff;
136 goto byte_stuff; 130 goto byte_stuff;
@@ -292,15 +286,10 @@ static inline int iraw_loop(unsigned char c, unsigned char *src, int numbytes,
292{ 286{
293 struct cardstate *cs = inbuf->cs; 287 struct cardstate *cs = inbuf->cs;
294 struct bc_state *bcs = inbuf->bcs; 288 struct bc_state *bcs = inbuf->bcs;
295 int inputstate; 289 int inputstate = bcs->inputstate;
296 struct sk_buff *skb; 290 struct sk_buff *skb = bcs->skb;
297 int startbytes = numbytes; 291 int startbytes = numbytes;
298 292
299 IFNULLRETVAL(bcs, numbytes);
300 inputstate = bcs->inputstate;
301 skb = bcs->skb;
302 IFNULLRETVAL(skb, numbytes);
303
304 for (;;) { 293 for (;;) {
305 /* add character */ 294 /* add character */
306 inputstate |= INS_have_data; 295 inputstate |= INS_have_data;
@@ -577,11 +566,7 @@ static struct sk_buff *iraw_encode(struct sk_buff *skb, int head, int tail)
577 */ 566 */
578int gigaset_m10x_send_skb(struct bc_state *bcs, struct sk_buff *skb) 567int gigaset_m10x_send_skb(struct bc_state *bcs, struct sk_buff *skb)
579{ 568{
580 unsigned len; 569 unsigned len = skb->len;
581
582 IFNULLRETVAL(bcs, -EFAULT);
583 IFNULLRETVAL(skb, -EFAULT);
584 len = skb->len;
585 570
586 if (bcs->proto2 == ISDN_PROTO_L2_HDLC) 571 if (bcs->proto2 == ISDN_PROTO_L2_HDLC)
587 skb = HDLC_Encode(skb, HW_HDR_LEN, 0); 572 skb = HDLC_Encode(skb, HW_HDR_LEN, 0);