tty: tty_buffer: use struct_size() in tty_buffer_alloc()
authorJiri Slaby (SUSE) <jirislaby@kernel.org>
Wed, 16 Aug 2023 10:55:22 +0000 (12:55 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 22 Aug 2023 12:58:15 +0000 (14:58 +0200)
commit46bc78c81b65044fa7bd4781e6501b756b3a86bc
treed59d32b205b9d97942c692a59e6fa358b137a432
parentd4d13ff3ac78b41bfaefd5ad1efd72cfbf43f288
tty: tty_buffer: use struct_size() in tty_buffer_alloc()

Now, that tty_buffer::data has the right type, use struct_size() for
size calculation. struct_size() makes the code less error-prone and more
readable.

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