From patchwork Mon Feb 24 22:12:12 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thorsten Blum X-Patchwork-Id: 13989016 Received: from out-182.mta1.migadu.com (out-182.mta1.migadu.com [95.215.58.182]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7B5371FCD07 for ; Mon, 24 Feb 2025 22:17:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=95.215.58.182 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740435469; cv=none; b=SzIxUFWWUekuu2OxaoUTDFComOIuSpcbdQeiy0wp6yrBwDHZvL9PXeOqd9042jpJh64AfxZeq68eGr+I2wbta62joUm0yRLEbkb4ciVITF0SqE9rqRi/bal4i94sHRqz5uUO3ZrhbiTfqKZ0Gydan24JXViaIxHZcnly/DCLrnY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740435469; c=relaxed/simple; bh=j9ul9lajmssaQGsq2f0RPtIkSoaHICdgb6sZ0MzTFZI=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=dExLq/KXpsVWoZY7LwGyiSkGzVnLG7NCKaxGdT/4nRrhsCPxvC43RdKmtRxenOvAdute9lp/eoUt/5dlevzKloH6FmIpQoZS5iwbNwFtT2wx328ZpmAvmODCM1P4OPwFP4DOh/QgG8k1+/AvPPPdl7MCvUn3z/INq3yWRS2DtDc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=jPh52aGb; arc=none smtp.client-ip=95.215.58.182 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="jPh52aGb" X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1740435455; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=dwgY2gg0fChR9PNYJGZKx8vqnKeNt/Cl9yuFpNMFMTQ=; b=jPh52aGbtItWazshP7zdpw3qDR5bkqzjfncQ/BYRKizUSg5as3bcDNA/K/truiH4Y+MzQ0 fYBcpOn4VLSDOVQevunASLIKWA6H4NOu7oxgilCvCw67DTn5CoFbk5js9DNLQIQTJe/S1I liyvH0h0VPyEZKdNu9D1v0nZUzhLHKA= From: Thorsten Blum To: Liam Girdwood , Mark Brown , Jaroslav Kysela , Takashi Iwai , Vijendar Mukunda , Venkata Prasad Potturu , =?utf-8?q?Uwe_Klein?= =?utf-8?q?e-K=C3=B6nig?= , Peter Zijlstra Cc: Thorsten Blum , linux-sound@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] ASoC: amd: acp: acp70: Remove unnecessary if-check Date: Mon, 24 Feb 2025 23:12:12 +0100 Message-ID: <20250224221214.199849-2-thorsten.blum@linux.dev> Precedence: bulk X-Mailing-List: linux-sound@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Migadu-Flow: FLOW_OUT Since list_for_each_entry() expects the list to not be empty, the iterator variable cannot be NULL and the unnecessary if-check can be removed. Remove it and indent the code accordingly. Compile-tested only. Signed-off-by: Thorsten Blum --- sound/soc/amd/acp/acp70.c | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/sound/soc/amd/acp/acp70.c b/sound/soc/amd/acp/acp70.c index ef3f6504bc7f..7f4ec3bfaeab 100644 --- a/sound/soc/amd/acp/acp70.c +++ b/sound/soc/amd/acp/acp70.c @@ -230,18 +230,16 @@ static int __maybe_unused acp70_pcm_resume(struct device *dev) spin_lock(&adata->acp_lock); list_for_each_entry(stream, &adata->stream_list, list) { - if (stream) { - substream = stream->substream; - if (substream && substream->runtime) { - buf_in_frames = (substream->runtime->buffer_size); - buf_size = frames_to_bytes(substream->runtime, buf_in_frames); - config_pte_for_stream(adata, stream); - config_acp_dma(adata, stream, buf_size); - if (stream->dai_id) - restore_acp_i2s_params(substream, adata, stream); - else - restore_acp_pdm_params(substream, adata); - } + substream = stream->substream; + if (substream && substream->runtime) { + buf_in_frames = (substream->runtime->buffer_size); + buf_size = frames_to_bytes(substream->runtime, buf_in_frames); + config_pte_for_stream(adata, stream); + config_acp_dma(adata, stream, buf_size); + if (stream->dai_id) + restore_acp_i2s_params(substream, adata, stream); + else + restore_acp_pdm_params(substream, adata); } } spin_unlock(&adata->acp_lock);