tty: hvc_console: use flexible array for outbuf
authorJiri Slaby (SUSE) <jirislaby@kernel.org>
Tue, 21 Nov 2023 09:22:52 +0000 (10:22 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 25 Nov 2023 07:23:17 +0000 (07:23 +0000)
commit7588b0820354694f4e3a2fbadc4d39176ee221aa
treec5033a7c21890492444640b45f9b119715fb79b8
parent4ccef1f142effe765a130c7b020c36eec6bd2a31
tty: hvc_console: use flexible array for outbuf

This means:
* move outbuf to the end of struct hvc_struct and convert from pointer
  to flexible array (the structure is smaller now)
* use struct_size() at the allocation site
* align outbuf in the struct instead of ALIGN() at kzalloc()

And apart from the above, use u8 instead of char (which are the same
thanks to -funsigned-char). The former is now preferred over the latter.

It makes the code easier to understand.

Signed-off-by: "Jiri Slaby (SUSE)" <jirislaby@kernel.org>
Cc: linuxppc-dev@lists.ozlabs.org
Link: https://lore.kernel.org/r/20231121092258.9334-12-jirislaby@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/hvc/hvc_console.c
drivers/tty/hvc/hvc_console.h