diff --git a/src/audio/audio_stream.c b/src/audio/audio_stream.c index 5fa8fa805c10..295fa65ac1c0 100644 --- a/src/audio/audio_stream.c +++ b/src/audio/audio_stream.c @@ -8,9 +8,7 @@ static size_t audio_stream_get_free_size(struct sof_sink *sink) { - struct audio_stream *audio_stream = - attr_container_of(sink, struct audio_stream, - sink_api, __sparse_cache); + struct audio_stream *audio_stream = container_of(sink, struct audio_stream, sink_api); return audio_stream_get_free_bytes(audio_stream); } @@ -18,9 +16,7 @@ static size_t audio_stream_get_free_size(struct sof_sink *sink) static int audio_stream_get_buffer(struct sof_sink *sink, size_t req_size, void **data_ptr, void **buffer_start, size_t *buffer_size) { - struct audio_stream *audio_stream = - attr_container_of(sink, struct audio_stream, - sink_api, __sparse_cache); + struct audio_stream *audio_stream = container_of(sink, struct audio_stream, sink_api); if (req_size > audio_stream_get_free_size(sink)) return -ENODATA; @@ -34,15 +30,11 @@ static int audio_stream_get_buffer(struct sof_sink *sink, size_t req_size, static int audio_stream_commit_buffer(struct sof_sink *sink, size_t commit_size) { - struct audio_stream *audio_stream = - attr_container_of(sink, struct audio_stream, - sink_api, __sparse_cache); - struct comp_buffer *buffer_c = - attr_container_of(audio_stream, struct comp_buffer, - stream, __sparse_cache); + struct audio_stream *audio_stream = container_of(sink, struct audio_stream, sink_api); + struct comp_buffer *buffer = container_of(audio_stream, struct comp_buffer, stream); if (commit_size) { - buffer_stream_writeback(buffer_c, commit_size); + buffer_stream_writeback(buffer, commit_size); audio_stream_produce(audio_stream, commit_size); } @@ -51,9 +43,7 @@ static int audio_stream_commit_buffer(struct sof_sink *sink, size_t commit_size) static size_t audio_stream_get_data_available(struct sof_source *source) { - struct audio_stream *audio_stream = - attr_container_of(source, struct audio_stream, - source_api, __sparse_cache); + struct audio_stream *audio_stream = container_of(source, struct audio_stream, source_api); return audio_stream_get_avail_bytes(audio_stream); } @@ -61,18 +51,13 @@ static size_t audio_stream_get_data_available(struct sof_source *source) static int audio_stream_get_data(struct sof_source *source, size_t req_size, void **data_ptr, void **buffer_start, size_t *buffer_size) { - struct audio_stream *audio_stream = - attr_container_of(source, struct audio_stream, - source_api, __sparse_cache); - - struct comp_buffer *buffer_c = - attr_container_of(audio_stream, struct comp_buffer, - stream, __sparse_cache); + struct audio_stream *audio_stream = container_of(source, struct audio_stream, source_api); + struct comp_buffer *buffer = container_of(audio_stream, struct comp_buffer, stream); if (req_size > audio_stream_get_data_available(source)) return -ENODATA; - buffer_stream_invalidate(buffer_c, req_size); + buffer_stream_invalidate(buffer, req_size); /* get circular buffer parameters */ *data_ptr = audio_stream->r_ptr; @@ -83,9 +68,7 @@ static int audio_stream_get_data(struct sof_source *source, size_t req_size, static int audio_stream_release_data(struct sof_source *source, size_t free_size) { - struct audio_stream *audio_stream = - attr_container_of(source, struct audio_stream, - source_api, __sparse_cache); + struct audio_stream *audio_stream = container_of(source, struct audio_stream, source_api); if (free_size) audio_stream_consume(audio_stream, free_size); @@ -97,12 +80,8 @@ static int audio_stream_set_ipc_params_source(struct sof_source *source, struct sof_ipc_stream_params *params, bool force_update) { - struct audio_stream *audio_stream = - attr_container_of(source, struct audio_stream, - source_api, __sparse_cache); - struct comp_buffer *buffer = - attr_container_of(audio_stream, struct comp_buffer, - stream, __sparse_cache); + struct audio_stream *audio_stream = container_of(source, struct audio_stream, source_api); + struct comp_buffer *buffer = container_of(audio_stream, struct comp_buffer, stream); return buffer_set_params(buffer, params, force_update); } @@ -111,12 +90,8 @@ static int audio_stream_set_ipc_params_sink(struct sof_sink *sink, struct sof_ipc_stream_params *params, bool force_update) { - struct audio_stream *audio_stream = - attr_container_of(sink, struct audio_stream, - sink_api, __sparse_cache); - struct comp_buffer *buffer = - attr_container_of(audio_stream, struct comp_buffer, - stream, __sparse_cache); + struct audio_stream *audio_stream = container_of(sink, struct audio_stream, sink_api); + struct comp_buffer *buffer = container_of(audio_stream, struct comp_buffer, stream); return buffer_set_params(buffer, params, force_update); } @@ -125,9 +100,7 @@ static int audio_stream_source_set_alignment_constants(struct sof_source *source const uint32_t byte_align, const uint32_t frame_align_req) { - struct audio_stream *audio_stream = - attr_container_of(source, struct audio_stream, - source_api, __sparse_cache); + struct audio_stream *audio_stream = container_of(source, struct audio_stream, source_api); audio_stream_init_alignment_constants(byte_align, frame_align_req, audio_stream); @@ -138,9 +111,7 @@ static int audio_stream_sink_set_alignment_constants(struct sof_sink *sink, const uint32_t byte_align, const uint32_t frame_align_req) { - struct audio_stream *audio_stream = - attr_container_of(sink, struct audio_stream, - sink_api, __sparse_cache); + struct audio_stream *audio_stream = container_of(sink, struct audio_stream, sink_api); audio_stream_init_alignment_constants(byte_align, frame_align_req, audio_stream); @@ -177,10 +148,8 @@ void audio_stream_init(struct audio_stream *audio_stream, audio_stream_init_alignment_constants(1, 1, audio_stream); source_init(audio_stream_get_source(audio_stream), &audio_stream_source_ops, - (__sparse_force struct sof_audio_stream_params *) &audio_stream->runtime_stream_params); sink_init(audio_stream_get_sink(audio_stream), &audio_stream_sink_ops, - (__sparse_force struct sof_audio_stream_params *) &audio_stream->runtime_stream_params); audio_stream_reset(audio_stream); } diff --git a/src/include/sof/audio/module_adapter/module/module_interface.h b/src/include/sof/audio/module_adapter/module/module_interface.h index 5a4e27c354f7..fab3cefdc0ef 100644 --- a/src/include/sof/audio/module_adapter/module/module_interface.h +++ b/src/include/sof/audio/module_adapter/module/module_interface.h @@ -50,7 +50,7 @@ enum module_processing_mode { * \brief Input stream buffer */ struct input_stream_buffer { - void __sparse_cache *data; /* data stream buffer */ + void *data; /* data stream buffer */ uint32_t size; /* size of data in the buffer */ uint32_t consumed; /* number of bytes consumed by the module */ @@ -63,7 +63,7 @@ struct input_stream_buffer { * \brief Output stream buffer */ struct output_stream_buffer { - void __sparse_cache *data; /* data stream buffer */ + void *data; /* data stream buffer */ uint32_t size; /* size of data in the buffer */ };