tty: n_tty: invert the condition in copy_from_read_buf()
authorJiri Slaby (SUSE) <jirislaby@kernel.org>
Tue, 19 Sep 2023 08:51:45 +0000 (10:51 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 3 Oct 2023 12:31:15 +0000 (14:31 +0200)
commitc2b0fb9f69987ddec6bf21f95157603ea4c83aff
tree04cc5036a8e7cd7c273fcdf0180dbea9f9a49b59
parent72369f2d493d4c0f4f0ed5a66b19c6912c4837ef
tty: n_tty: invert the condition in copy_from_read_buf()

Make "no numbers available" a fast quit from the function. And do the
heavy work outside the 'if'. This makes the code more understandable and
conforming to the common kernel coding style.

Signed-off-by: "Jiri Slaby (SUSE)" <jirislaby@kernel.org>
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Link: https://lore.kernel.org/r/20230919085156.1578-5-jirislaby@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/n_tty.c