isdn/gigaset: clarify gigaset_modem_fill control structure

Replace the flag-controlled retry loop by explicit goto statements
in the error branches to make the control structure easier to
understand.

Signed-off-by: Tilman Schmidt <tilman@imap.cc>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
Tilman Schmidt 2014-12-10 13:41:55 +01:00 committed by David S. Miller
parent ff66fc3ab0
commit f650dd2805
1 changed files with 24 additions and 28 deletions

View File

@ -304,7 +304,6 @@ static void gigaset_modem_fill(unsigned long data)
struct cardstate *cs = (struct cardstate *) data; struct cardstate *cs = (struct cardstate *) data;
struct bc_state *bcs = &cs->bcs[0]; /* only one channel */ struct bc_state *bcs = &cs->bcs[0]; /* only one channel */
struct cmdbuf_t *cb; struct cmdbuf_t *cb;
int again;
gig_dbg(DEBUG_OUTPUT, "modem_fill"); gig_dbg(DEBUG_OUTPUT, "modem_fill");
@ -313,36 +312,33 @@ static void gigaset_modem_fill(unsigned long data)
return; return;
} }
do { again:
again = 0; if (!bcs->tx_skb) { /* no skb is being sent */
if (!bcs->tx_skb) { /* no skb is being sent */ cb = cs->cmdbuf;
cb = cs->cmdbuf; if (cb) { /* commands to send? */
if (cb) { /* commands to send? */ gig_dbg(DEBUG_OUTPUT, "modem_fill: cb");
gig_dbg(DEBUG_OUTPUT, "modem_fill: cb"); if (send_cb(cs, cb) < 0) {
if (send_cb(cs, cb) < 0) { gig_dbg(DEBUG_OUTPUT,
gig_dbg(DEBUG_OUTPUT, "modem_fill: send_cb failed");
"modem_fill: send_cb failed"); goto again; /* no callback will be called! */
again = 1; /* no callback will be
called! */
}
} else { /* skbs to send? */
bcs->tx_skb = skb_dequeue(&bcs->squeue);
if (bcs->tx_skb)
gig_dbg(DEBUG_INTR,
"Dequeued skb (Adr: %lx)!",
(unsigned long) bcs->tx_skb);
} }
return;
} }
if (bcs->tx_skb) { /* skbs to send? */
gig_dbg(DEBUG_OUTPUT, "modem_fill: tx_skb"); bcs->tx_skb = skb_dequeue(&bcs->squeue);
if (write_modem(cs) < 0) { if (!bcs->tx_skb)
gig_dbg(DEBUG_OUTPUT, return;
"modem_fill: write_modem failed");
again = 1; /* no callback will be called! */ gig_dbg(DEBUG_INTR, "Dequeued skb (Adr: %lx)!",
} (unsigned long) bcs->tx_skb);
} }
} while (again);
gig_dbg(DEBUG_OUTPUT, "modem_fill: tx_skb");
if (write_modem(cs) < 0) {
gig_dbg(DEBUG_OUTPUT, "modem_fill: write_modem failed");
goto again; /* no callback will be called! */
}
} }
/* /*