From patchwork Mon Nov 27 12:56:22 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Carpenter X-Patchwork-Id: 170129 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:ce62:0:b0:403:3b70:6f57 with SMTP id o2csp3081461vqx; Mon, 27 Nov 2023 04:56:46 -0800 (PST) X-Google-Smtp-Source: AGHT+IF6Akub1R3pwZ6tH7jaoMNLu/PG9bOsWlXjZKqmmDxXGmzSgA5bfyZ3Pb36LX6DbDwcWQMP X-Received: by 2002:a05:6808:18a4:b0:3b8:5ea4:5bc7 with SMTP id bi36-20020a05680818a400b003b85ea45bc7mr9459904oib.39.1701089806207; Mon, 27 Nov 2023 04:56:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701089806; cv=none; d=google.com; s=arc-20160816; b=FdqK0OaUCk6V7d3ipgcqpRSjWOANvRycGmJRG39/sspjCRKXXw8LghqYpZfvxpE1W0 4SG8Ida+wPT9ADsV/zjKeTic+5UokkBNS8A+vMyG0VsxOnWpQKIqfFEFyMdvRxc0oXV7 mbIGrl5WfBmG6K5veV95IloynDrnSYRJvTl7LAH6fraqUb/TAPI1BI2Q9l1XehQCkxJq ekEHo7SPeve1NmfYm+RHqrZCktKDDnVJ+HVPhpfHFEBvQGDzayIpP4XhMLLtl8XgeIHH 9MwCneTxdqLwTw+LIDyZWtCicP1lVVDBmoOuQAOI5KooNpaf+GD3pLGgNv8RxVkyHZnM D83w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-disposition:mime-version:message-id :subject:cc:to:from:date:dkim-signature; bh=tP2t/kYtlEwSamszENbZNCB37/rUPT3TVZUIwyv3H7c=; fh=vBbCNLOwGJRq/p2cZBB8cxrr7vEqNDnnRYS0UCqclZ4=; b=EvaGknSB/iUkeVGespsjEr7yzjeCGqHVmTviSob1TVooOA+GByj/EfdoxksKmZmjD0 4riEFd4Ep0bpRHaaey8gI6utOBfMjxey34yQhpShyhfrgGk25/YHca3FfT3QTbxcd+ql WKQB0l4P2vRAewFKvT/K+ZaWZt+tFdg0HEf21Ht8kjRuocnI52sanSrXsUXaOyTPkSnE 8eKiAhKSwjOwQTLsIDgD+U3XnxjR0msO+eUr97tjX5qj6FyfzqHriqb+2GGcw0Df12ee fTqphMxDuEqCiQ6WTS10vz/kL5JJK0O1STpLFl4TpdrzFDhRD/EvHrtzyZi9aa0FYaGU xBNw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=mUCf86Hh; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from lipwig.vger.email (lipwig.vger.email. [23.128.96.33]) by mx.google.com with ESMTPS id k24-20020a6568d8000000b005655bf61e32si9317126pgt.23.2023.11.27.04.56.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Nov 2023 04:56:46 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) client-ip=23.128.96.33; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=mUCf86Hh; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id D9D1B8070E15; Mon, 27 Nov 2023 04:56:39 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233433AbjK0M4X (ORCPT + 99 others); Mon, 27 Nov 2023 07:56:23 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55354 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233387AbjK0M4V (ORCPT ); Mon, 27 Nov 2023 07:56:21 -0500 Received: from mail-wm1-x32b.google.com (mail-wm1-x32b.google.com [IPv6:2a00:1450:4864:20::32b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 072309B for ; Mon, 27 Nov 2023 04:56:28 -0800 (PST) Received: by mail-wm1-x32b.google.com with SMTP id 5b1f17b1804b1-409299277bbso30770995e9.2 for ; Mon, 27 Nov 2023 04:56:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1701089786; x=1701694586; darn=vger.kernel.org; h=content-disposition:mime-version:message-id:subject:cc:to:from:date :from:to:cc:subject:date:message-id:reply-to; bh=tP2t/kYtlEwSamszENbZNCB37/rUPT3TVZUIwyv3H7c=; b=mUCf86Hh7Fj7Qw0V879sDzs0k9t/5gBqQGaaCeYfkl/TcFlAYbKSToONqiPlgHULMO Fo3ShSXO8aJd6wuWoFxptlfUT3Y317Ua+RauuxFesMRNkhx0bMBnR/824dIJf3KVPx2R 6vR64dAfozVMls+uZLGEl/zZjCFhFZw6aGHFPkt0nCHtbk7hlXAynC0uU6fXF4EYMSKl T3lOaLn4/qh/bC1PEWyH+jteEFTg+PZy35t9OP0a3xoXLOTY//+epO2pTim5cpgtbwy/ KKhYDIT63Fw9RSsNRTSi6xK8j88NyWz4Y6HD8I7AaTZ6H3+Ylv0b4EZDCpG28cG0NWK/ qOPA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701089786; x=1701694586; h=content-disposition:mime-version:message-id:subject:cc:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=tP2t/kYtlEwSamszENbZNCB37/rUPT3TVZUIwyv3H7c=; b=xBOkAdN8RmjFtBpAnd1U5+bpzVAS6CAYcz58R3xYwnOYNDDJrSpjY+NZ0USqj/T6TA 7hhUoZoJyjeDwixyxRoyBqLyj4lQuiPbwfpii7BaMbcNz9XSwJjjwuHvd0Lpmlou+W+n RPrR/xuTkMcZeflEEzsRKG8NrAH9rAd9AXUpIuDFyT3a0Mzffq2uKrOEBhiSOuPGbccD Al1DNcz/iGnzMzYF5rW3VvGea6UAzFT9sNAN7NppI+QnT7og0ZXNPwJRLnbOuD2OEkzD NDfDnASkvRnRbU8EmmAZHpPG8tZDVtpNomGKi6Q5FkAz8N4vZeRxUoFvlU0ywglIzs+o rcYw== X-Gm-Message-State: AOJu0Yxt/5YThmHB8zYUFV7f7G4pz5lmfBjLMVjQzSlKYutiUEnIVz2L OYOY46bmANsGbjwm04oajriLLw== X-Received: by 2002:a05:600c:5488:b0:408:403a:34dc with SMTP id iv8-20020a05600c548800b00408403a34dcmr8829868wmb.37.1701089786489; Mon, 27 Nov 2023 04:56:26 -0800 (PST) Received: from localhost ([102.36.222.112]) by smtp.gmail.com with ESMTPSA id k10-20020a05600c1c8a00b004042dbb8925sm14497219wms.38.2023.11.27.04.56.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Nov 2023 04:56:26 -0800 (PST) Date: Mon, 27 Nov 2023 15:56:22 +0300 From: Dan Carpenter To: Liam Girdwood Cc: Mark Brown , Jaroslav Kysela , Takashi Iwai , Syed Saba Kareem , Nicolas Ferre , Kuninori Morimoto , Uwe =?iso-8859-1?q?Kl?= =?iso-8859-1?q?eine-K=F6nig?= , Yang Li , linux-sound@vger.kernel.org, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org Subject: [PATCH] ASoC: amd: acp: Remove unnecessary NULL check Message-ID: MIME-Version: 1.0 Content-Disposition: inline X-Mailer: git-send-email haha only kidding X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Mon, 27 Nov 2023 04:56:40 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1783721944714340957 X-GMAIL-MSGID: 1783721944714340957 The list iterator cannot be NULL so there is no need to check. Delete the check and pull the code in a tab. Signed-off-by: Dan Carpenter --- 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 0d7cdd4017e5..f65955215487 100644 --- a/sound/soc/amd/acp/acp70.c +++ b/sound/soc/amd/acp/acp70.c @@ -215,18 +215,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);