Skip to content

Commit 4dd31f1

Browse files
gclementgregkh
authored andcommitted
tty: n_gsm: Fix bogus i++ in gsm_data_kick
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>
1 parent 57626ff commit 4dd31f1

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
@@ -700,17 +700,9 @@ static void gsm_data_kick(struct gsm_mux *gsm, struct gsm_dlci *dlci)
700700
} else {
701701
int i = 0;
702702

703-
for (i = 0; i < NUM_DLCI; i++) {
704-
struct gsm_dlci *dlci;
705-
706-
dlci = gsm->dlci[i];
707-
if (dlci == NULL) {
708-
i++;
709-
continue;
710-
}
711-
712-
tty_port_tty_wakeup(&dlci->port);
713-
}
703+
for (i = 0; i < NUM_DLCI; i++)
704+
if (gsm->dlci[i])
705+
tty_port_tty_wakeup(&gsm->dlci[i]->port);
714706
}
715707
}
716708
}

0 commit comments

Comments
 (0)