Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f650dd28 authored by Tilman Schmidt's avatar Tilman Schmidt Committed by David S. Miller
Browse files

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: default avatarTilman Schmidt <tilman@imap.cc>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent ff66fc3a
Loading
Loading
Loading
Loading
+24 −28
Original line number Diff line number Diff line
@@ -304,7 +304,6 @@ static void gigaset_modem_fill(unsigned long data)
	struct cardstate *cs = (struct cardstate *) data;
	struct bc_state *bcs = &cs->bcs[0]; /* only one channel */
	struct cmdbuf_t *cb;
	int again;

	gig_dbg(DEBUG_OUTPUT, "modem_fill");

@@ -313,8 +312,7 @@ static void gigaset_modem_fill(unsigned long data)
		return;
	}

	do {
		again = 0;
again:
	if (!bcs->tx_skb) {	/* no skb is being sent */
		cb = cs->cmdbuf;
		if (cb) {	/* commands to send? */
@@ -322,27 +320,25 @@ static void gigaset_modem_fill(unsigned long data)
			if (send_cb(cs, cb) < 0) {
				gig_dbg(DEBUG_OUTPUT,
					"modem_fill: send_cb failed");
					again = 1; /* no callback will be
						      called! */
				goto again; /* no callback will be called! */
			}
			return;
		}
			} else { /* skbs to send? */

		/* skbs to send? */
		bcs->tx_skb = skb_dequeue(&bcs->squeue);
				if (bcs->tx_skb)
					gig_dbg(DEBUG_INTR,
						"Dequeued skb (Adr: %lx)!",
		if (!bcs->tx_skb)
			return;

		gig_dbg(DEBUG_INTR, "Dequeued skb (Adr: %lx)!",
			(unsigned long) bcs->tx_skb);
	}
		}

		if (bcs->tx_skb) {
	gig_dbg(DEBUG_OUTPUT, "modem_fill: tx_skb");
	if (write_modem(cs) < 0) {
				gig_dbg(DEBUG_OUTPUT,
					"modem_fill: write_modem failed");
				again = 1; /* no callback will be called! */
			}
		gig_dbg(DEBUG_OUTPUT, "modem_fill: write_modem failed");
		goto again;	/* no callback will be called! */
	}
	} while (again);
}

/*