Skip to content

Commit

Permalink
tty: n_gsm: Fix bogus i++ in gsm_data_kick
Browse files Browse the repository at this point in the history
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 <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Greg Kroah-Hartman <[email protected]>
  • Loading branch information
gclement authored and gregkh committed May 19, 2020
1 parent 57626ff commit 4dd31f1
Showing 1 changed file with 3 additions and 11 deletions.
14 changes: 3 additions & 11 deletions drivers/tty/n_gsm.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
}
Expand Down

0 comments on commit 4dd31f1

Please sign in to comment.