Skip to content

Commit 2783eb9

Browse files
gclementgregkh
authored andcommitted
tty: n_gsm: Fix bogus i++ in gsm_data_kick
[ Upstream commit 4dd31f1 ] When submitting the previous fix "tty: n_gsm: Fix waking up upper tty layer when room available". It was suggested to switch from a while to a for loop, but when doing it, there was a remaining bogus i++. This patch removes this i++ and also reorganizes the code making it more compact. Fixes: e1eaea4 ("tty: n_gsm line discipline") Signed-off-by: Gregory CLEMENT <gregory.clement@bootlin.com> Link: https://lore.kernel.org/r/20200518084517.2173242-3-gregory.clement@bootlin.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent 549ff84 commit 2783eb9

File tree

1 file changed

+3
-11
lines changed

1 file changed

+3
-11
lines changed

drivers/tty/n_gsm.c

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -703,17 +703,9 @@ static void gsm_data_kick(struct gsm_mux *gsm, struct gsm_dlci *dlci)
703703
} else {
704704
int i = 0;
705705

706-
for (i = 0; i < NUM_DLCI; i++) {
707-
struct gsm_dlci *dlci;
708-
709-
dlci = gsm->dlci[i];
710-
if (dlci == NULL) {
711-
i++;
712-
continue;
713-
}
714-
715-
tty_port_tty_wakeup(&dlci->port);
716-
}
706+
for (i = 0; i < NUM_DLCI; i++)
707+
if (gsm->dlci[i])
708+
tty_port_tty_wakeup(&gsm->dlci[i]->port);
717709
}
718710
}
719711
}

0 commit comments

Comments
 (0)