Commit 47b5176e authored by Gregory CLEMENT's avatar Gregory CLEMENT Committed by Kelsey Skunberg

tty: n_gsm: Fix bogus i++ in gsm_data_kick

BugLink: https://bugs.launchpad.net/bugs/1885932

[ Upstream commit 4dd31f1f ]

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: e1eaea46 ("tty: n_gsm line discipline")
Signed-off-by: default avatarGregory CLEMENT <gregory.clement@bootlin.com>
Link: https://lore.kernel.org/r/20200518084517.2173242-3-gregory.clement@bootlin.comSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
Signed-off-by: default avatarKamal Mostafa <kamal@canonical.com>
Signed-off-by: default avatarKelsey Skunberg <kelsey.skunberg@canonical.com>
parent f5128837
......@@ -719,17 +719,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);
}
}
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment