audio: host-zephyr: remove redundant return

there are two return in common update, remove the first
to save cycles, test platform is tgl board with debug sof
build, it can save cycles from 455 to 452.

Signed-off-by: Baofeng Tian <baofeng.tian@intel.com>
This commit is contained in:
Baofeng Tian 2023-09-04 09:32:29 +08:00 committed by Kai Vehmanen
parent 036da2ac43
commit dd2a64ba1a
1 changed files with 5 additions and 11 deletions

View File

@ -247,7 +247,7 @@ void host_common_update(struct host_data *hd, struct comp_dev *dev, uint32_t byt
bool update_mailbox = false; bool update_mailbox = false;
bool send_ipc = false; bool send_ipc = false;
if (hd->ipc_host.direction == SOF_IPC_STREAM_PLAYBACK) { if (dev->direction == SOF_IPC_STREAM_PLAYBACK) {
source = buffer_acquire(hd->dma_buffer); source = buffer_acquire(hd->dma_buffer);
sink = buffer_acquire(hd->local_buffer); sink = buffer_acquire(hd->local_buffer);
ret = dma_buffer_copy_from(source, sink, hd->process, bytes); ret = dma_buffer_copy_from(source, sink, hd->process, bytes);
@ -257,20 +257,14 @@ void host_common_update(struct host_data *hd, struct comp_dev *dev, uint32_t byt
ret = dma_buffer_copy_to(source, sink, hd->process, bytes); ret = dma_buffer_copy_to(source, sink, hd->process, bytes);
} }
/* assert dma_buffer_copy succeed */
if (ret < 0)
comp_err(dev, "host_common_update() dma buffer copy failed, dir %d bytes %d avail %d free %d",
hd->ipc_host.direction, bytes,
audio_stream_get_avail_samples(&source->stream) *
audio_stream_frame_bytes(&source->stream),
audio_stream_get_free_samples(&sink->stream) *
audio_stream_frame_bytes(&sink->stream));
buffer_release(sink); buffer_release(sink);
buffer_release(source); buffer_release(source);
if (ret < 0) if (ret < 0) {
comp_err(dev, "host_common_update() copy failed, dir %d bytes %d return: %d",
dev->direction, bytes, ret);
return; return;
}
hd->total_data_processed += bytes; hd->total_data_processed += bytes;