Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c894ac44 authored by Vignesh Kulothungan's avatar Vignesh Kulothungan Committed by Gerrit - the friendly Code Review server
Browse files

dsp: Avoid excessive list iterations



Exit list iteration after the required conditions
for the loop has been satisfied to avoid additional
list iteration.

Change-Id: I96872d3be469420e613ec0244588a0a8ecb50e58
Signed-off-by: default avatarVignesh Kulothungan <vigneshk@codeaurora.org>
parent 880afb60
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
/*
 * Copyright (c) 2012-2017, The Linux Foundation. All rights reserved.
 * Copyright (c) 2012-2018, The Linux Foundation. All rights reserved.
 * Author: Brian Swetland <swetland@google.com>
 *
 * This software is licensed under the terms of the GNU General Public
@@ -8268,8 +8268,10 @@ static int __q6asm_read(struct audio_client *ac, bool is_custom_len_reqd,
		list_for_each_safe(ptr, next, &ac->port[OUT].mem_map_handle) {
			buf_node = list_entry(ptr, struct asm_buffer_node,
					list);
			if (buf_node->buf_phys_addr == ab->phys)
			if (buf_node->buf_phys_addr == ab->phys) {
				read.mem_map_handle = buf_node->mmap_hdl;
				break;
			}
		}
		dev_vdbg(ac->dev, "memory_map handle in q6asm_read: [%0x]:",
				read.mem_map_handle);