summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCezary Rojewski <cezary.rojewski@intel.com>2024-04-05 12:09:19 +0300
committerMark Brown <broonie@kernel.org>2024-04-05 15:13:03 +0300
commit6dd68c2da44d92c25b323bcc2603421463437a64 (patch)
tree2b707393d4041b75ee59ea81da7efaab828f30f6
parentc91b692781c1839fcc389b2a9120e46593c6424b (diff)
downloadlinux-6dd68c2da44d92c25b323bcc2603421463437a64.tar.xz
ASoC: Intel: avs: Silence false-positive memcpy() warnings
Commit df8fc4e934c1 ("kbuild: Enable -fstrict-flex-arrays=3") enforced strict flex array declarations. This generates false-positive in form of: "memcpy: detected field-spanning write". Avoid it by utilizing the DECLARE_FLEX_ARRAY() macro. Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com> Link: https://msgid.link/r/20240405090929.1184068-4-cezary.rojewski@intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
-rw-r--r--sound/soc/intel/avs/messages.h4
-rw-r--r--sound/soc/intel/avs/path.c2
2 files changed, 3 insertions, 3 deletions
diff --git a/sound/soc/intel/avs/messages.h b/sound/soc/intel/avs/messages.h
index 4e609a08863c..007bc4fb6d99 100644
--- a/sound/soc/intel/avs/messages.h
+++ b/sound/soc/intel/avs/messages.h
@@ -752,9 +752,9 @@ struct avs_copier_gtw_cfg {
union avs_connector_node_id node_id;
u32 dma_buffer_size;
u32 config_length;
- struct {
+ union {
union avs_gtw_attributes attrs;
- u32 blob[];
+ DECLARE_FLEX_ARRAY(u32, blob);
} config;
} __packed;
diff --git a/sound/soc/intel/avs/path.c b/sound/soc/intel/avs/path.c
index e785fc2a7008..5944865a1193 100644
--- a/sound/soc/intel/avs/path.c
+++ b/sound/soc/intel/avs/path.c
@@ -254,7 +254,7 @@ static int avs_copier_create(struct avs_dev *adev, struct avs_path_module *mod)
/* config_length in DWORDs */
cfg->gtw_cfg.config_length = DIV_ROUND_UP(data_size, 4);
if (data)
- memcpy(&cfg->gtw_cfg.config, data, data_size);
+ memcpy(&cfg->gtw_cfg.config.blob, data, data_size);
mod->gtw_attrs = cfg->gtw_cfg.config.attrs;