Commit a5290feb authored by Gustavo A. R. Silva's avatar Gustavo A. R. Silva

tools/testing/nvdimm: Replace zero-length array with flexible-array

There is a regular need in the kernel to provide a way to declare having a
dynamically sized set of trailing elements in a structure. Kernel code should
always use “flexible array members”[1] for these cases. The older style of
one-element or zero-length arrays should no longer be used[2].

[1] https://en.wikipedia.org/wiki/Flexible_array_member
[2] https://github.com/KSPP/linux/issues/21Signed-off-by: default avatarGustavo A. R. Silva <gustavoars@kernel.org>
parent 9c5fbf05
...@@ -51,7 +51,7 @@ struct nd_cmd_translate_spa { ...@@ -51,7 +51,7 @@ struct nd_cmd_translate_spa {
__u32 nfit_device_handle; __u32 nfit_device_handle;
__u32 _reserved; __u32 _reserved;
__u64 dpa; __u64 dpa;
} __packed devices[0]; } __packed devices[];
} __packed; } __packed;
...@@ -74,7 +74,7 @@ struct nd_cmd_ars_err_inj_stat { ...@@ -74,7 +74,7 @@ struct nd_cmd_ars_err_inj_stat {
struct nd_error_stat_query_record { struct nd_error_stat_query_record {
__u64 err_inj_stat_spa_range_base; __u64 err_inj_stat_spa_range_base;
__u64 err_inj_stat_spa_range_length; __u64 err_inj_stat_spa_range_length;
} __packed record[0]; } __packed record[];
} __packed; } __packed;
#define ND_INTEL_SMART 1 #define ND_INTEL_SMART 1
...@@ -180,7 +180,7 @@ struct nd_intel_fw_send_data { ...@@ -180,7 +180,7 @@ struct nd_intel_fw_send_data {
__u32 context; __u32 context;
__u32 offset; __u32 offset;
__u32 length; __u32 length;
__u8 data[0]; __u8 data[];
/* this field is not declared due ot variable data from input */ /* this field is not declared due ot variable data from input */
/* __u32 status; */ /* __u32 status; */
} __packed; } __packed;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment