ASoC: SOF: probes: Replace [0] union members with DECLARE_FLEX_ARRAY()
authorJyri Sarha <jyri.sarha@intel.com>
Mon, 31 Oct 2022 10:51:37 +0000 (12:51 +0200)
committerMark Brown <broonie@kernel.org>
Mon, 31 Oct 2022 13:20:17 +0000 (13:20 +0000)
Replace probes related [0] arrays, all found within unions, with
DECLARE_FLEX_ARRAY() declarations.

Signed-off-by: Jyri Sarha <jyri.sarha@intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20221031105141.19037-2-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/sof/sof-client-probes.c

index ddeabbb5580e1c74c5cbb6de99b797b051ab775f..e767e53f53d13c06e71043778a5cc3dea96a24b2 100644 (file)
@@ -13,6 +13,7 @@
 #include <linux/module.h>
 #include <linux/pm_runtime.h>
 #include <linux/string_helpers.h>
+#include <linux/stddef.h>
 
 #include <sound/soc.h>
 #include <sound/sof/header.h>
@@ -59,8 +60,8 @@ struct sof_ipc_probe_info_params {
        struct sof_ipc_reply rhdr;
        unsigned int num_elems;
        union {
-               struct sof_probe_dma dma[0];
-               struct sof_probe_point_desc desc[0];
+               DECLARE_FLEX_ARRAY(struct sof_probe_dma, dma);
+               DECLARE_FLEX_ARRAY(struct sof_probe_point_desc, desc);
        };
 } __packed;