From nobody Thu Nov 28 01:22:47 2024 Received: from NAM11-BN8-obe.outbound.protection.outlook.com (mail-bn8nam11on2071.outbound.protection.outlook.com [40.107.236.71]) (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 3E60B18C347; Mon, 7 Oct 2024 08:53:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.236.71 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728291236; cv=fail; b=KGsRf7RkwLzYLP2VZUA3J7T0lCJD/Ad4/Uc1vdrMrh1WRvFclDiErmKLZldK6y2O/BQcU2VqK/zq+LuqANgnyc+u1M2lIcvZ+fK3EKIg/G1Ciyby1VNvY/Ubip9UjzntFsRUxSA/h7X6NrTYoJJPlspIpGAxdI+0ne4EtjaYPQA= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728291236; c=relaxed/simple; bh=apfTT4964LnIJyHqKMgDadof/5bd5+ZedoJd5+Vdrew=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=oSrZrdESXztHso82SJMbGwvLLq2VCn0eSnYi0JH60uYqU3t2/QjRQDBD5/GkJ/lp9ApZFTx/uKtFLoIgvYfnOUA+u6S9gW1mZG+ip4DzrqItzypOE8bMYdoYdVEpUpCDm5hghAltphCSqHCoju8EZDrh3BYVLRGeATy68A59xPc= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com; spf=fail smtp.mailfrom=amd.com; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b=NrqWzQh7; arc=fail smtp.client-ip=40.107.236.71 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=amd.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b="NrqWzQh7" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=He+D3QbId/z/hQMliF5/IxS/6NoG7EtPVCW2wbF0olv8pW1nuB9fxmt9RjokjbYUjNIAkB1n2N+LvOzrlQXMCnY0xl4MJ5cvqhyciV3FSSOfNtaAKD83HEgld0IYYj2jK8NdTC4ns/7SwP+i9K/c9qoSiT2YaGGPdgP/5B/MLE27K0aiU4cmBMlLK6u0pFu8hZvFUBWhhBZJBg4deHw3Lws6YerL+DKonxS6rAClufsNQETTHvTkurxvzTOvB3l59/hP0gQdXb+zX7oR8TdW7B+4MJ5TsU0BvbZAXJYypL50kk5iNEvaJWsclnzj5bJX5D+rwqVK3Ic8Vqi+Y7l/QA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=M9icqqq6gOnUjbija4Vs9MCWkqfX4oCnxW6yDk2+msY=; b=x2iENei+LAwxQ7WftkfioT/jOZVr5/OiOvHB4OkZ0ltZl7r61PFu/vXHrXeDcgSsFaI2fvUrQCLHLc/+BRzwl3s2zJVodCBFnWTfoykt5+DaMi0VmmcQUwOV/fTGercN0rJm9cemRG4l1ExYy85Rq3rWWYAI+tupmyB71YUjF/NwtqnFKgxQMWb3omU2VuXnBA0XEGBd/wnDWHHJswkL6mBYelH+7QZxli3FkkB0wcFRvojs8pOuY7YxN1SeYypZ9PKHbZ3xxDLwZ9+78GPX+TRt5e4iydtuJ+2QLIQJA4pVx+W6yP67HIwUW0WSj25VA9tCy78rdpwNKob0j2aLaQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=kernel.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=M9icqqq6gOnUjbija4Vs9MCWkqfX4oCnxW6yDk2+msY=; b=NrqWzQh7EDk9fgWy9Yo7rch/IGY6/KmdGuoIknjTHyKCYlMoBGXNOCsUZU0IvynNy4ORFMB+Oq8IJpO/7O7SbQunZuKJJ4hvAFIK096ToDQ9gfeNpHQIiCqCm7JH8TSVmMcqpxfD0cQVEhZ/EWWJ5iMEdXO741cUQ1cRYbp6/o0= Received: from BL0PR02CA0054.namprd02.prod.outlook.com (2603:10b6:207:3d::31) by IA1PR12MB9064.namprd12.prod.outlook.com (2603:10b6:208:3a8::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8026.20; Mon, 7 Oct 2024 08:53:51 +0000 Received: from BN2PEPF00004FC0.namprd04.prod.outlook.com (2603:10b6:207:3d:cafe::c3) by BL0PR02CA0054.outlook.office365.com (2603:10b6:207:3d::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8026.20 via Frontend Transport; Mon, 7 Oct 2024 08:53:51 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by BN2PEPF00004FC0.mail.protection.outlook.com (10.167.243.186) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.8048.13 via Frontend Transport; Mon, 7 Oct 2024 08:53:50 +0000 Received: from vijendar-X570-GAMING-X.amd.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Mon, 7 Oct 2024 03:53:46 -0500 From: Vijendar Mukunda To: CC: , , , , , , , , , , , "Vijendar Mukunda" Subject: [PATCH 2/3] ASoC: amd: acp: fix for cpu dai index logic Date: Mon, 7 Oct 2024 14:23:20 +0530 Message-ID: <20241007085321.3991149-3-Vijendar.Mukunda@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241007085321.3991149-1-Vijendar.Mukunda@amd.com> References: <20241007085321.3991149-1-Vijendar.Mukunda@amd.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: SATLEXMB03.amd.com (10.181.40.144) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BN2PEPF00004FC0:EE_|IA1PR12MB9064:EE_ X-MS-Office365-Filtering-Correlation-Id: 1be99b92-8acb-42ff-26c8-08dce6ad908a X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|82310400026|1800799024|376014|36860700013; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?lWUBHodxu9gIm6ut9vc0TnmP0kfLbLFQ9+GhCptAwC+W22KmPNF3qfAkiBew?= =?us-ascii?Q?0+NnNAoLpzyOV6zebLhQLVWVGHII9NU594r8FrJg3dZs7KxlnlU9XInorDAx?= =?us-ascii?Q?kJghpU+Q9dgzUHnvltj9oEyiNdNaRNBd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uIK/WW9sISPmF4O80UVYeFYSV7oU/mD9740tMkJcZ4xWQPWO4Y?= =?us-ascii?Q?+CEdc/F8edSA3LnrR6jJ4MWoi1Yj8vGdjyTLtwhy/bjVb+6an4uravO0Xz5C?= =?us-ascii?Q?5UWJBndNnxEHo5UFh9hNe+8OS/OGYfu5pvGtOXTAQ6SMehy2uvu6HEAj91u3?= =?us-ascii?Q?25p5EuHpGP00PAW96/afxvFxMtyotNAZheKrzy3H1cKve/8Uj59fOu5xoKF7?= =?us-ascii?Q?pHxzx5vhVqFjEW1dj/0CDwJS5yRJWltiaaNhfB2e9KEu7Ui71yG2qSxbRBSC?= =?us-ascii?Q?o8JHeH9Jhdaz1mtyAWybaL7yiB1tsX+ZMI7DR4SNlMqslpfeqO6Vju7JavMU?= =?us-ascii?Q?ORVuGhp1eS1ENCP80fPbGJ/40mxE?= X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(82310400026)(1800799024)(376014)(36860700013);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Oct 2024 08:53:50.7690 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 1be99b92-8acb-42ff-26c8-08dce6ad908a X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: BN2PEPF00004FC0.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA1PR12MB9064 Content-Type: text/plain; charset="utf-8" Multi link aggregation is not supported for acp6.3 platform. Below combinations are supported. - one sdw BE DAI <---> one-cpu DAI <---> one-codec DAI - one sdw BE DAI <---> one-cpu DAI <---> multi-codec DAIs As Single cpu dai is going to be created, In create_sdw_dailink() function cpu dai index won't be incremented. Refactor cpu dai index logic to fix below smatch static checker warning. sound/soc/amd/acp/acp-sdw-sof-mach.c:157 create_sdw_dailink() warn: iterator 'i' not incremented. Reported-by: Dan Carpenter Closes: https://lore.kernel.org/all/a201e871-375e-43eb-960d-5c048956c2ff@am= d.com/T/ Fixes: 6d8348ddc56e ("ASoC: amd: acp: refactor SoundWire machine driver cod= e") Signed-off-by: Vijendar Mukunda --- sound/soc/amd/acp/acp-sdw-sof-mach.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/sound/soc/amd/acp/acp-sdw-sof-mach.c b/sound/soc/amd/acp/acp-s= dw-sof-mach.c index acab2675d1f5..3be401c72270 100644 --- a/sound/soc/amd/acp/acp-sdw-sof-mach.c +++ b/sound/soc/amd/acp/acp-sdw-sof-mach.c @@ -154,7 +154,7 @@ static int create_sdw_dailink(struct snd_soc_card *card, int num_cpus =3D hweight32(sof_dai->link_mask[stream]); int num_codecs =3D sof_dai->num_devs[stream]; int playback, capture; - int i =3D 0, j =3D 0; + int j =3D 0; char *name; =20 if (!sof_dai->num_devs[stream]) @@ -213,14 +213,14 @@ static int create_sdw_dailink(struct snd_soc_card *ca= rd, =20 int link_num =3D ffs(sof_end->link_mask) - 1; =20 - cpus[i].dai_name =3D devm_kasprintf(dev, GFP_KERNEL, - "SDW%d Pin%d", - link_num, cpu_pin_id); - dev_dbg(dev, "cpu[%d].dai_name:%s\n", i, cpus[i].dai_name); - if (!cpus[i].dai_name) + cpus->dai_name =3D devm_kasprintf(dev, GFP_KERNEL, + "SDW%d Pin%d", + link_num, cpu_pin_id); + dev_dbg(dev, "cpu->dai_name:%s\n", cpus->dai_name); + if (!cpus->dai_name) return -ENOMEM; =20 - codec_maps[j].cpu =3D i; + codec_maps[j].cpu =3D 0; codec_maps[j].codec =3D j; =20 codecs[j].name =3D sof_end->codec_name; --=20 2.34.1