From dfd8ffa06913776d73d71b0b7e0c709a31aa70eb Mon Sep 17 00:00:00 2001 From: Ranjani Sridharan Date: Thu, 8 Feb 2024 13:09:15 -0800 Subject: [PATCH] audio: audio_stream: Explicitly cast to enum MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit To prevent the following with C++ compilation. error: invalid conversion from ‘uint32_t’ {aka ‘unsigned int’} to ‘sof_ipc_frame’ [-fpermissive] Signed-off-by: Ranjani Sridharan --- src/include/sof/audio/audio_stream.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/include/sof/audio/audio_stream.h b/src/include/sof/audio/audio_stream.h index cc143acd6..650d2caf9 100644 --- a/src/include/sof/audio/audio_stream.h +++ b/src/include/sof/audio/audio_stream.h @@ -365,7 +365,7 @@ static inline int audio_stream_set_params(struct audio_stream *buffer, if (!params) return -EINVAL; - buffer->runtime_stream_params.frame_fmt = params->frame_fmt; + buffer->runtime_stream_params.frame_fmt = (enum sof_ipc_frame)params->frame_fmt; buffer->runtime_stream_params.rate = params->rate; buffer->runtime_stream_params.channels = params->channels; @@ -990,8 +990,8 @@ static inline void audio_stream_fmt_conversion(enum ipc4_bit_depth depth, * IPC4_DEPTH_24BIT (24) <---> SOF_IPC_FRAME_S24_4LE (1) * IPC4_DEPTH_32BIT (32) <---> SOF_IPC_FRAME_S32_LE (2) */ - *frame_fmt = (depth >> 3) - 2; - *valid_fmt = (valid >> 3) - 2; + *frame_fmt = (enum sof_ipc_frame)((depth >> 3) - 2); + *valid_fmt = (enum sof_ipc_frame)((valid >> 3) - 2); #ifdef CONFIG_FORMAT_U8 if (depth == 8)