]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
tty: n_tty: clean up process_output_block()
authorJiri Slaby (SUSE) <jirislaby@kernel.org>
Mon, 17 Mar 2025 07:00:22 +0000 (08:00 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 20 Mar 2025 15:00:50 +0000 (08:00 -0700)
commite287d64605d6ab66884b6d473a04fc91d5dc16c3
treedeb19a497a0d3e85ad47162452479f0e52b1dd9c
parentfdfa49a8c96500ef9e1fe1cd2e68c8fd71d8b53a
tty: n_tty: clean up process_output_block()

* Use guard(mutex), which results in:
  - the function can return directly when "space == 0".
  - "i" can now be "unsigned" as it is no longer abused to hold a retval
    from tty->ops->write(). Note the compared-to "nr" is already
    "unsigned".
* The end label is now dubbed "do_write" as that is what happens there.
  Unlike the uncertain "break_out" name.

Signed-off-by: Jiri Slaby (SUSE) <jirislaby@kernel.org>
Link: https://lore.kernel.org/r/20250317070046.24386-8-jirislaby@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/n_tty.c