diff options
author | Cezary Rojewski <cezary.rojewski@intel.com> | 2024-04-05 11:09:19 +0200 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2024-04-05 13:13:03 +0100 |
commit | 6dd68c2da44d92c25b323bcc2603421463437a64 (patch) | |
tree | 2b707393d4041b75ee59ea81da7efaab828f30f6 | |
parent | c91b692781c1839fcc389b2a9120e46593c6424b (diff) |
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.h | 4 | ||||
-rw-r--r-- | sound/soc/intel/avs/path.c | 2 |
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; |