mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-28 15:20:41 +00:00
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 [1] Link: https://gcc.gnu.org/pipermail/gcc-patches/2022-October/602902.html [2] 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
This commit is contained in:
parent
3e95263dfb
commit
f7a79bdc4e
1 changed files with 3 additions and 3 deletions
|
@ -73,7 +73,7 @@ struct guc_debug_capture_list_header {
|
|||
|
||||
struct guc_debug_capture_list {
|
||||
struct guc_debug_capture_list_header header;
|
||||
struct guc_mmio_reg regs[0];
|
||||
struct guc_mmio_reg regs[];
|
||||
} __packed;
|
||||
|
||||
/**
|
||||
|
@ -125,7 +125,7 @@ struct guc_state_capture_header_t {
|
|||
|
||||
struct guc_state_capture_t {
|
||||
struct guc_state_capture_header_t header;
|
||||
struct guc_mmio_reg mmio_entries[0];
|
||||
struct guc_mmio_reg mmio_entries[];
|
||||
} __packed;
|
||||
|
||||
enum guc_capture_group_types {
|
||||
|
@ -145,7 +145,7 @@ struct guc_state_capture_group_header_t {
|
|||
/* this is the top level structure where an error-capture dump starts */
|
||||
struct guc_state_capture_group_t {
|
||||
struct guc_state_capture_group_header_t grp_header;
|
||||
struct guc_state_capture_t capture_entries[0];
|
||||
struct guc_state_capture_t capture_entries[];
|
||||
} __packed;
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue