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

ASoC: SOF: 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 eb492c62
...@@ -36,7 +36,7 @@ struct sof_probe_point_desc { ...@@ -36,7 +36,7 @@ struct sof_probe_point_desc {
struct sof_ipc_probe_dma_add_params { struct sof_ipc_probe_dma_add_params {
struct sof_ipc_cmd_hdr hdr; struct sof_ipc_cmd_hdr hdr;
unsigned int num_elems; unsigned int num_elems;
struct sof_probe_dma dma[0]; struct sof_probe_dma dma[];
} __packed; } __packed;
struct sof_ipc_probe_info_params { struct sof_ipc_probe_info_params {
...@@ -51,19 +51,19 @@ struct sof_ipc_probe_info_params { ...@@ -51,19 +51,19 @@ struct sof_ipc_probe_info_params {
struct sof_ipc_probe_dma_remove_params { struct sof_ipc_probe_dma_remove_params {
struct sof_ipc_cmd_hdr hdr; struct sof_ipc_cmd_hdr hdr;
unsigned int num_elems; unsigned int num_elems;
unsigned int stream_tag[0]; unsigned int stream_tag[];
} __packed; } __packed;
struct sof_ipc_probe_point_add_params { struct sof_ipc_probe_point_add_params {
struct sof_ipc_cmd_hdr hdr; struct sof_ipc_cmd_hdr hdr;
unsigned int num_elems; unsigned int num_elems;
struct sof_probe_point_desc desc[0]; struct sof_probe_point_desc desc[];
} __packed; } __packed;
struct sof_ipc_probe_point_remove_params { struct sof_ipc_probe_point_remove_params {
struct sof_ipc_cmd_hdr hdr; struct sof_ipc_cmd_hdr hdr;
unsigned int num_elems; unsigned int num_elems;
unsigned int buffer_id[0]; unsigned int buffer_id[];
} __packed; } __packed;
int sof_ipc_probe_init(struct snd_sof_dev *sdev, int sof_ipc_probe_init(struct snd_sof_dev *sdev,
......
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