Skip to content

Commit

Permalink
ASoC: Intel: Skylake: Replace zero-length arrays with DECLARE_FLEX_AR…
Browse files Browse the repository at this point in the history
…RAY() helper

Zero-length arrays are deprecated and we are moving towards adopting
C99 flexible-array members, instead. So, replace zero-length arrays
declarations in anonymous union with the new DECLARE_FLEX_ARRAY()
helper macro.

This helper allows for flexible-array members in unions.

Link: KSPP#193
Link: KSPP#226
Link: https://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html
Signed-off-by: Gustavo A. R. Silva <[email protected]>
Reviewed-by: Kees Cook <[email protected]>
Reviewed-by: Amadeusz Sławiński <[email protected]>
Link: https://lore.kernel.org/r/YzIuiUul2CwPlkKh@work
Signed-off-by: Mark Brown <[email protected]>
  • Loading branch information
GustavoARSilva authored and broonie committed Sep 27, 2022
1 parent b3eec3e commit 6fed326
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions sound/soc/intel/skylake/skl-topology.h
Original file line number Diff line number Diff line change
Expand Up @@ -233,8 +233,8 @@ struct skl_uuid_inst_map {
struct skl_kpb_params {
u32 num_modules;
union {
struct skl_mod_inst_map map[0];
struct skl_uuid_inst_map map_uuid[0];
DECLARE_FLEX_ARRAY(struct skl_mod_inst_map, map);
DECLARE_FLEX_ARRAY(struct skl_uuid_inst_map, map_uuid);
} u;
};

Expand Down

0 comments on commit 6fed326

Please sign in to comment.