From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 1DDB5C7EE22 for ; Thu, 18 May 2023 10:40:54 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id F21A7822; Thu, 18 May 2023 12:40:01 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz F21A7822 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1684406452; bh=3TOCDTczR6JFr1+GTXKGf9VFQvNk3v41cPOnsRAe2Tw=; h=Date:Subject:To:Cc:References:From:In-Reply-To:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=ZN0A2XGEbOV3i/+JwAMxFilR84oT/f5j8U+3Uy/stKWccku1a4hValoYiaABNYGAF 2BtU4+e5r+FgRBDrcX2PQceI0Sx+obDS/Fw/1NtH9h0ZV/qLDpfj7K4kwbzEMoi3nr hJejrtxj5BLZcKVNLYMbmGSRpl//t1KGdIExPKfo= Received: by alsa1.perex.cz (Postfix, from userid 50401) id 27185F805BD; Thu, 18 May 2023 12:38:47 +0200 (CEST) Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id AC8D5F805B3; Thu, 18 May 2023 12:38:46 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 6A345F805B3; Thu, 18 May 2023 12:38:43 +0200 (CEST) Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 02A59F80549 for ; Thu, 18 May 2023 12:38:40 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 02A59F80549 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key, unprotected) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=NJRIdGng DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1684406322; x=1715942322; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=3TOCDTczR6JFr1+GTXKGf9VFQvNk3v41cPOnsRAe2Tw=; b=NJRIdGng59z8n0VoSjn6MwWAkWnYPm2RiMck7XCJJSzBAbdd0TQ75JPb FJ6PioR+y1XSaC9EwJlH6iAiI3CtkkDaorzSVw66pJNbsmYvoimAbkyGN J/ZAlOPriRf08uV3bo3kJZn5qGAvg48uCNjxKbu9Yqr4OF5fYsQ6HnNuC glIzjLnQRAdmOC0wNimDnrSohCvba7on7K9RVSISl9w2dXvjLkOqg9vqm xi+NeL3+NCJFJQHxkfbRifie0Vb8hvPdPLcHmQ95rQs/uMAQs6jyKxiZD rCEJgKR9JGWkbfHeLqFZlV4drNMszmyNxyKiGOsS/+gV/pCORyY4JKb2g A==; X-IronPort-AV: E=McAfee;i="6600,9927,10713"; a="350865551" X-IronPort-AV: E=Sophos;i="5.99,285,1677571200"; d="scan'208";a="350865551" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 May 2023 03:38:39 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10713"; a="735034833" X-IronPort-AV: E=Sophos;i="5.99,285,1677571200"; d="scan'208";a="735034833" Received: from aslawinx-mobl.ger.corp.intel.com (HELO [10.99.16.144]) ([10.99.16.144]) by orsmga001-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 May 2023 03:38:37 -0700 Message-ID: <9b46f2a3-a907-ef28-c874-74b03f18b9bf@linux.intel.com> Date: Thu, 18 May 2023 12:38:35 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.11.0 Subject: Re: [PATCH 07/20] ASoC: soc-pcm.c: cleanup normal connection loop at soc_get_playback_capture() part2 Content-Language: en-US To: Kuninori Morimoto , Jaroslav Kysela , Liam Girdwood , Mark Brown , Takashi Iwai Cc: alsa-devel@alsa-project.org References: <87353uqjiu.wl-kuninori.morimoto.gx@renesas.com> <87sfbup4wj.wl-kuninori.morimoto.gx@renesas.com> From: =?UTF-8?Q?Amadeusz_S=c5=82awi=c5=84ski?= In-Reply-To: <87sfbup4wj.wl-kuninori.morimoto.gx@renesas.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Message-ID-Hash: KQO2EEQSB5SVU3H72EQOV3FR6PPZ42V7 X-Message-ID-Hash: KQO2EEQSB5SVU3H72EQOV3FR6PPZ42V7 X-MailFrom: amadeuszx.slawinski@linux.intel.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-alsa-devel.alsa-project.org-0; header-match-alsa-devel.alsa-project.org-1; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.8 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: On 5/18/2023 7:47 AM, Kuninori Morimoto wrote: > soc_get_playback_capture() (A) is handling both DPCM (X) / Normal (Y) > connection. > > (A) static int soc_get_playback_capture(...) > { > ... > ^ if (dai_link->dynamic || dai_link->no_pcm) { > (X) ... > v > ^ } else { > | ... > | for_each_rtd_codec_dais(rtd, i, codec_dai) { > | if (dai_link->num_cpus == 1) { > |(a) cpu_dai = ... > (Y) } else if (dai_link->num_cpus == dai_link->num_codecs) { > |(b) cpu_dai = ... > | } > | ... > | } > | ... > v } > ... > } > > In Normal connection case (Y), it is checking number of CPU / Codec. > (a) is for Single CPU case > (b) is for Multi CPU case > > We can simply merge (a) and (b). Because it is doing > same judgement, same operation. > > Signed-off-by: Kuninori Morimoto > --- Reviewed-by: Amadeusz Sławiński