HID: hyperv: Replace one-element array with flexible-array member
authorPaulo Miguel Almeida <paulo.miguel.almeida.rodenas@gmail.com>
Mon, 17 Oct 2022 07:51:22 +0000 (20:51 +1300)
committerJiri Kosina <jkosina@suse.cz>
Tue, 18 Oct 2022 12:55:37 +0000 (14:55 +0200)
commit542f25a94471570e2594be5b422b9ca572cf88a1
tree1838b55baa454e89b1dd1dc1449df70d5e6534ac
parent79d11de9637a37035b4a72ccb528b3dfebc1bf67
HID: hyperv: Replace one-element array with flexible-array member

One-element arrays are deprecated, and we are replacing them with
flexible array members instead. So, replace one-element array with
flexible-array member in structs synthhid_msg, synthhid_input_report,
pipe_prt_msg and refactor the rest of the code accordingly.

This helps with the ongoing efforts to tighten the FORTIFY_SOURCE
routines on memcpy() and help us make progress towards globally
enabling -fstrict-flex-arrays=3 [1].

Link: https://github.com/KSPP/linux/issues/79
Link: https://github.com/KSPP/linux/issues/210
Link: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101836
Signed-off-by: Paulo Miguel Almeida <paulo.miguel.almeida.rodenas@gmail.com>
Reviewed-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Reviewed-by: Michael Kelley <mikelley@microsoft.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
drivers/hid/hid-hyperv.c