From 3f572b8cb67ede1e47719d49fa29d451ae0f3887 Mon Sep 17 00:00:00 2001 From: Andrula Song Date: Fri, 15 Dec 2023 14:58:59 +0800 Subject: [PATCH] Audio: ASRC: Fix the IPC3 incompatible pointer type Fix the IPC3 incompatible pointer type passing 'struct timestamp_data *' to parameter of type 'struct dai_ts_data *', which is found by ./scripts/fuzz.sh test. Signed-off-by: Andrula Song --- src/audio/asrc/asrc.h | 13 +++++-------- src/audio/asrc/asrc_ipc3.c | 4 ++++ 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/src/audio/asrc/asrc.h b/src/audio/asrc/asrc.h index af868cb51886..eac4c0e88caf 100644 --- a/src/audio/asrc/asrc.h +++ b/src/audio/asrc/asrc.h @@ -39,12 +39,6 @@ static inline bool asrc_get_asynchronous_mode(const struct ipc4_asrc_module_cfg return false; } -#if CONFIG_ZEPHYR_NATIVE_DRIVERS -int asrc_dai_get_timestamp(struct comp_data *cd, struct dai_ts_data *tsd); -#else -int asrc_dai_get_timestamp(struct comp_data *cd, struct timestamp_data *tsd); -#endif - #else /*IPC3 version*/ typedef struct ipc_config_asrc ipc_asrc_cfg; @@ -68,10 +62,13 @@ static inline bool asrc_get_asynchronous_mode(const struct ipc_config_asrc *ipc_ return ipc_asrc->asynchronous_mode; } -int asrc_dai_get_timestamp(struct comp_data *cd, struct timestamp_data *tsd); - #endif +#if CONFIG_ZEPHYR_NATIVE_DRIVERS +int asrc_dai_get_timestamp(struct comp_data *cd, struct dai_ts_data *tsd); +#else +int asrc_dai_get_timestamp(struct comp_data *cd, struct timestamp_data *tsd); +#endif /* Simple count value to prevent first delta timestamp * from being input to low-pass filter. */ diff --git a/src/audio/asrc/asrc_ipc3.c b/src/audio/asrc/asrc_ipc3.c index f57498c59381..92c01564f495 100644 --- a/src/audio/asrc/asrc_ipc3.c +++ b/src/audio/asrc/asrc_ipc3.c @@ -46,7 +46,11 @@ int asrc_dai_stop_timestamp(struct comp_data *cd) return -EINVAL; } +#if CONFIG_ZEPHYR_NATIVE_DRIVERS +int asrc_dai_get_timestamp(struct comp_data *cd, struct dai_ts_data *tsd) +#else int asrc_dai_get_timestamp(struct comp_data *cd, struct timestamp_data *tsd) +#endif { if (!cd->dai_dev) return -EINVAL;