drm/i915/guc: Replace zero-length arrays with flexible-array members
authorGustavo A. R. Silva <gustavoars@kernel.org>
Tue, 10 Jan 2023 16:44:53 +0000 (10:44 -0600)
committerRodrigo Vivi <rodrigo.vivi@intel.com>
Wed, 11 Jan 2023 09:21:34 +0000 (04:21 -0500)
commitf7a79bdc4e672092f111efc917668706c93b535f
treec2978e5934cda2da9a9c5b5790443c8f08f9cd07
parent3e95263dfb52d5e5b60fbdda51094c788c446f07
drm/i915/guc: Replace zero-length arrays with flexible-array members

Zero-length arrays are deprecated[1] and we are moving towards
adopting C99 flexible-array members, instead. So, replace zero-length
arrays in a couple of structures (three, actually) with flex-array
members.

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 [2].

Link: https://www.kernel.org/doc/html/latest/process/deprecated.html#zero-length-and-one-element-arrays
Link: https://gcc.gnu.org/pipermail/gcc-patches/2022-October/602902.html
Link: https://github.com/KSPP/linux/issues/78
Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>
Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/Y72WBTUmh9r1lvKN@work
drivers/gpu/drm/i915/gt/uc/guc_capture_fwif.h