diff options
author | Jiri Slaby (SUSE) <jirislaby@kernel.org> | 2023-09-19 10:51:48 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2023-10-03 14:31:15 +0200 |
commit | 5b4f9cf3cc339565be1ecd64d608b6ffdfba7c1e (patch) | |
tree | 1b17141ba639a4c716344cd2cfbaa78c0ec6e0ba /drivers/tty/n_tty.c | |
parent | tty: switch tty_{,un}throttle_safe() to return a bool (diff) | |
download | linux-5b4f9cf3cc339565be1ecd64d608b6ffdfba7c1e.tar.xz linux-5b4f9cf3cc339565be1ecd64d608b6ffdfba7c1e.zip |
tty: invert return values of tty_{,un}throttle_safe()
If tty_{,un}throttle_safe() returned true on success (similar to
*_trylock()), it would make the conditions in callers more obvious. So
perform the switch to these inverted values (and fix the callers).
Signed-off-by: "Jiri Slaby (SUSE)" <jirislaby@kernel.org>
Link: https://lore.kernel.org/r/20230919085156.1578-8-jirislaby@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/tty/n_tty.c')
-rw-r--r-- | drivers/tty/n_tty.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/tty/n_tty.c b/drivers/tty/n_tty.c index b34e6612aef6..f252d0b5a434 100644 --- a/drivers/tty/n_tty.c +++ b/drivers/tty/n_tty.c @@ -253,7 +253,7 @@ static void n_tty_check_throttle(struct tty_struct *tty) tty_set_flow_change(tty, TTY_THROTTLE_SAFE); if (N_TTY_BUF_SIZE - read_cnt(ldata) >= TTY_THRESHOLD_THROTTLE) break; - } while (tty_throttle_safe(tty)); + } while (!tty_throttle_safe(tty)); __tty_set_flow_change(tty, 0); } @@ -282,7 +282,7 @@ static void n_tty_check_unthrottle(struct tty_struct *tty) break; n_tty_kick_worker(tty); - } while (tty_unthrottle_safe(tty)); + } while (!tty_unthrottle_safe(tty)); __tty_set_flow_change(tty, 0); } |