media: venus: hfi_cmds: Replace one-element array with flexible-array member
authorGustavo A. R. Silva <gustavoars@kernel.org>
Tue, 16 May 2023 23:14:27 +0000 (00:14 +0100)
committerMauro Carvalho Chehab <mchehab@kernel.org>
Fri, 9 Jun 2023 12:44:14 +0000 (13:44 +0100)
commit40c02059645890d0525b693fc5b80d4c4db8d205
tree42222b3a60c7525fe06c3e09117a0c64ae1712c8
parenta80d6771ae067c3ec2313897fd999d3649a81c9c
media: venus: hfi_cmds: 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 arrays with flexible-array
members in struct hfi_session_set_buffers_pkt, 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].

This results in no differences in binary output.

Link: https://github.com/KSPP/linux/issues/79
Link: https://github.com/KSPP/linux/issues/292
Link: https://gcc.gnu.org/pipermail/gcc-patches/2022-October/602902.html
Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>
Signed-off-by: Stanimir Varbanov <stanimir.k.varbanov@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
drivers/media/platform/qcom/venus/hfi_cmds.c
drivers/media/platform/qcom/venus/hfi_cmds.h