diff options
author | Gregory CLEMENT <gregory.clement@bootlin.com> | 2020-05-18 10:45:13 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2020-05-19 16:19:54 +0200 |
commit | 4dd31f1ffec6c370c3c2e0c605628bf5e16d5c46 (patch) | |
tree | 0b9dbb07684ca0403ed983570a0880f946e72473 /drivers/tty/n_gsm.c | |
parent | 57626ff1c9135211b92dfbea1923333c7b6dd12c (diff) | |
download | linux-4dd31f1ffec6c370c3c2e0c605628bf5e16d5c46.tar.bz2 |
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: e1eaea46bb40 ("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>
Diffstat (limited to 'drivers/tty/n_gsm.c')
-rw-r--r-- | drivers/tty/n_gsm.c | 14 |
1 files changed, 3 insertions, 11 deletions
diff --git a/drivers/tty/n_gsm.c b/drivers/tty/n_gsm.c index 4465dd04fead..0a29a94ec438 100644 --- a/drivers/tty/n_gsm.c +++ b/drivers/tty/n_gsm.c @@ -700,17 +700,9 @@ static void gsm_data_kick(struct gsm_mux *gsm, struct gsm_dlci *dlci) } else { int i = 0; - for (i = 0; i < NUM_DLCI; i++) { - struct gsm_dlci *dlci; - - dlci = gsm->dlci[i]; - if (dlci == NULL) { - i++; - continue; - } - - tty_port_tty_wakeup(&dlci->port); - } + for (i = 0; i < NUM_DLCI; i++) + if (gsm->dlci[i]) + tty_port_tty_wakeup(&gsm->dlci[i]->port); } } } |