Skip to contentSkip to conversation

ASoC: Intel: Skylake: Replace zero-length arrays with DECLARE_FLEX_ARRAY() helper

PATCH In review Gustavo A. R. Silva 4 participants 4 messages Sep 26, 2022 – Sep 27, 2022

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ASoC: Intel: Skylake: Replace zero-length arrays with DECLARE_FLEX_ARRAY() 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.

---
 sound/soc/intel/skylake/skl-topology.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
sound/soc/intel/skylake/skl-topology.h +2 -2
index a5bccf2fcd88..017ac0ef324d 100644
@@ -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;
 };
 
Signature · 1 line
2.34.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 11 lines · Gustavo A. R. Silva

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.

Signature · 1 line
Kees Cook
Reviewed-by on v1 1/1
#2 lore raw
In reply to Gustavo A. R. Silva
Quoted 20 lines · Gustavo A. R. Silva

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.

---
  sound/soc/intel/skylake/skl-topology.h | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)
sound/soc/intel/skylake/skl-topology.h +0 -0
index a5bccf2fcd88..017ac0ef324d 100644

sound/soc/intel/skylake/skl-topology.h struct skl_uuid_inst_map { · line 240

Quoted 10 lines
sound/soc/intel/skylake/skl-topology.h +2 -2
@@ -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;
  };
 
maintainer
#3 lore raw
In reply to Gustavo A. R. Silva
Quoted 8 lines · Gustavo A. R. Silva

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.

[...]

Applied to

https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next

Thanks!

[1/1] ASoC: Intel: Skylake: Replace zero-length arrays with DECLARE_FLEX_ARRAY() helper

      commit: 6fed3265c3c811c79819860051375f6d7efc1d7e

All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying to this mail.

Thanks,
Mark