tty: n_tty: deduplicate copy code in n_tty_receive_buf_real_raw()
authorJiri Slaby (SUSE) <jirislaby@kernel.org>
Sun, 27 Aug 2023 07:41:47 +0000 (09:41 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 27 Aug 2023 09:46:52 +0000 (11:46 +0200)
commita84853c5954fe2c1b97db2f005ae156dc29ae233
treec47a076af76b9dab7054b1c0da530d2b8509b090
parent2aa91851ffa7cdfc0a63330d273115d38324b585
tty: n_tty: deduplicate copy code in n_tty_receive_buf_real_raw()

The code is duplicated to perform the copy twice -- to handle buffer
wrap-around. Instead of the duplication, roll this into the loop.

(And add some blank lines around to have the code a bit more readable.)

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