From patchwork Tue Aug 30 03:17:19 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 601088 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 1803BECAAD2 for ; Tue, 30 Aug 2022 03:18:34 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id C027E1670; Tue, 30 Aug 2022 05:17:42 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz C027E1670 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1661829512; bh=5ltHZgsni5pTlv6L85mYrzGoFsXyeliSosUVXHQjQgY=; h=From:Subject:To:In-Reply-To:References:Date:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=a5Cj7g+Ckze10i28zEcXcOz7HHqb6r68U/6m43FRI+K927abKuoTP9Jhy9HpJ5c0l 0iWnY+9nqik0KOld/Xz0xQxUwDdAP13wugcFTXbwv5iZD1pe/t8n9GxM+PO4J14v4t 247Cu0Kps7WB5iy20uA86PRkiz5FX+KVxI1vUPJc= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 64DB5F800AA; Tue, 30 Aug 2022 05:17:32 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 0724CF80529; Tue, 30 Aug 2022 05:17:31 +0200 (CEST) Received: from JPN01-TYC-obe.outbound.protection.outlook.com (mail-tycjpn01on2091.outbound.protection.outlook.com [40.107.114.91]) (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 714BEF800AA for ; Tue, 30 Aug 2022 05:17:26 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 714BEF800AA Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key) header.d=renesas.com header.i=@renesas.com header.b="nWMyxFRS" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=KnY33wqJ12QzNPWdOxBL3ycB8zNa6P2C9z8JR+irrg0civQthjfYMn7i8brDDM5RGPagE2mir5WFAEpPBHXpkLZJG1BYwfosJpgLU4aanByt3pH2xRicdJCYWCxDSzXA0zLlkwEK78KSacyPhMqv5d5B97AuiFlJwT0nWl6SsnphtIPLH2p3kepeoedvvbqwnjJj8+m7hLvyr4Flj0jbOecTWf0oJ9OZzMrl25Brr7sGGS1iXij2s3TeVLaI2Vckz2yQ+CQ0mOSmhDyKsg5QK/gSBLtCXFnuCHFOxUdpmPuSSvXtGYkEK6yhGrnrJALM/GGArh9sA4d/UJL439cgdw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=MrUUbZyaM5jjPHEZLLwEjXAXY1BtFAVWM/FH9HZkS9U=; b=JRUSk0fyFlILiPiADzNPvEH8SWTkNBOJYYNv3zJ6iiH2EKezNQaWxd5btjA9rjk8LWIutKGBPqyetttzB7qBdUSv72FspR3Keb7PEZp9pCKe61ZZt13O1jZO9pKItxwN1YjdtvffKk8d6bkHH6i++qy+HEo4z4aemBPykVQmAVSjKRvTqB3uHxAYkkE1KsULVsTBKSupvi88o+aUVOKG4f9IreldazE7lJ58hLq1olySkNlbU/NlsiZ/pCFFcfvwTVbScVd/PJutDnzf5uWT68WkglDjqCubsxDg6bwaA+4vZBvBLQsenS9+iEQ4E/eZE6Ynkikqx/YAwIQa5LvbYA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=renesas.com; dmarc=pass action=none header.from=renesas.com; dkim=pass header.d=renesas.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=renesas.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=MrUUbZyaM5jjPHEZLLwEjXAXY1BtFAVWM/FH9HZkS9U=; b=nWMyxFRSgle9KjdqxDr+9H0ry2ft/ifMwe8Q40RcOfJMJearOvsVs1QtQR0/0u1zjW9jAP+nvTnD8V38AXFm6EziUq0vVFcZ2C1P5njIUE3Mx9dPkuu4kIUIbBTvngUF/dmfgN/EsDQEottq6Ns0NHPOFIWRIqP+8NK9DRwfUnQ= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=renesas.com; Received: from OS3PR01MB8426.jpnprd01.prod.outlook.com (2603:1096:604:194::10) by OSAPR01MB2675.jpnprd01.prod.outlook.com (2603:1096:604:8::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5566.15; Tue, 30 Aug 2022 03:17:20 +0000 Received: from OS3PR01MB8426.jpnprd01.prod.outlook.com ([fe80::bdab:be26:6e36:88c6]) by OS3PR01MB8426.jpnprd01.prod.outlook.com ([fe80::bdab:be26:6e36:88c6%3]) with mapi id 15.20.5566.021; Tue, 30 Aug 2022 03:17:20 +0000 Message-ID: <87pmgi4dz4.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 3/3] ASoC: soc-pcm.c: check fe condition at out of loop User-Agent: Wanderlust/2.15.9 Emacs/26.3 Mule/6.0 To: Mark Brown In-Reply-To: <87tu5u4e0c.wl-kuninori.morimoto.gx@renesas.com> References: <87tu5u4e0c.wl-kuninori.morimoto.gx@renesas.com> Date: Tue, 30 Aug 2022 03:17:19 +0000 X-ClientProxiedBy: TYAPR01CA0188.jpnprd01.prod.outlook.com (2603:1096:404:ba::32) To OS3PR01MB8426.jpnprd01.prod.outlook.com (2603:1096:604:194::10) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 13efb0ab-0e62-4729-4949-08da8a36260b X-MS-TrafficTypeDiagnostic: OSAPR01MB2675:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: V+z5hu+cKMKZ+sLS1qFiYQ9k14OV9TACJxwopnA+XBdGz2DPXs9XzrYaOgs3sqyNbEEuUz7wBfX+GHAqJf2AVF+rmRtox98Azo1HyxX0mBQoCqCF5nhYJk/kf89LthD0Mj07jl1oqBlk2K9az4akBV0XFYWWumZ/juduYo0rYdT/jY5Fc6Df196lhptBPJLP4ptQOwrQCmucHRJXGJHdS+Uccpkhe/A1IkgoDkireqxM+hJSH5EWALahI7/WSKkp3xRHvfrKOW3eCAbTTQk1xB8YqTXfhChPNiDINfYU2OHigMgYf5Sw/1qPQfL3cc+1YW1u/HbJ01k0H1vONpH/XcoOjT9qLTmaHBWOhhcORUpleh2CBoDfmdD27JoHH1e1PQk230XAPdfUb6YGpc9oDLP9yw0IygN7Q/Umik9E3/QkAvOMHswGkkq2x5qLrVLUFXoGtCei1pnSp5VbuLZGZ62nPYM2CNiysR8BREJxWR6dUj46srlOlySro+vgaku+fPfhEM8e+Dx3l/K+7fB/w4VxCTLV2/D6Xe+l6wVKWwtyF2Z2zZG0Z9YBpSx7ahoX410gx3qeES6wx14AP/vdOE6isblKy6WjkhOjWxrUC5dPpdekujNNWf4mDbJodi7wJTnp6Eu2HsciOf9EJcCApcax/PJdlMFI0WD0Uhq8c7UVK0v3Zwf4ZDrIYoTMfCrOwazAm0SIsvxFdGjH+/cYhTCaf7LqmSLIzUfjwDXKuijW284TEGFLImjPTlR7RC7XrI8fsgg+ebPvow3KDikjTw== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:OS3PR01MB8426.jpnprd01.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230016)(4636009)(136003)(39860400002)(346002)(376002)(396003)(366004)(316002)(38100700002)(38350700002)(6512007)(26005)(8936002)(41300700001)(5660300002)(478600001)(86362001)(4326008)(8676002)(2906002)(66946007)(52116002)(6486002)(6506007)(66556008)(66476007)(2616005)(83380400001)(186003)(36756003)(6916009); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: OGxsNsiw7WOZyf9EiDQCNxTU9IVWX+sdg7lEzIaalEWO72L/n5cF12QRCAQIWPRYoX4BcCOodHKRmK7lJs+/dQqNjAHUoCtyxlki6rW8oEG27Q0GVjxeMMMogjBTbvvRlNItzw5gsknLsqzuYsT86SxLVav8TmxRVZvHntxC4u8S7TrXveb/yLZp0WoAzkYoIWZuXNGvlJsSFH2bk86pLF6nsqpsTcJlosWQTTrVKAbAGaUY2KP4Irna2w4Q3ocOyeSrDiDp5tAYlQWQTbjGVsK5vFHboQ47HR4IctaIlSld4qh2CJZ7J+WP7oIHVdCI41uVReC7ZueUW+lnILRaNSsX8aPZTUDXFieLzLZQ/5/DEqimylnGfpZYhMUh0Mxllqha8/STaNzRW80BCWX/zb1wPGTYjw2kMBM74cSbAzSKLfL9C0O3+5L4Wdx29kMfA8yzenkCv0WhZusVZra2a9hyGAwAUOQQPVC9175qD9wwunUxnzCcMIZRQoQhOknuJKS9XqmPnLDPbW5ot0zTEdVuWL5bqyWHC67j+xJOXEFWaDkZ8onM4U2KxuL8LM62rNNwM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-CrossTenant-Network-Message-Id: 13efb0ab-0e62-4729-4949-08da8a36260b X-MS-Exchange-CrossTenant-AuthSource: OS3PR01MB8426.jpnprd01.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Aug 2022 03:17:20.0299 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 53d82571-da19-47e4-9cb4-625a166a4a2a X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: KzIa3WKs4hsUEHJotgzZ27hdzMrbXtFouV6u6dAJwaCtPbRcrAmMJB05En3YrjTKDUPWz5dZ2h2nJslGCJZjZbbGOzt9+0eZ8mqNYh3/KTuurxHwWhkF4SKnh2op+Fp6 X-MS-Exchange-Transport-CrossTenantHeadersStamped: OSAPR01MB2675 Cc: Linux-ALSA X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" From: Kuninori Morimoto Current dpcm_add_paths() is checking fe condition in loop (= A), but fe condition (X) is not related to the loop (B). (X) static int dpcm_add_paths(fe, stream, ...) { ... (B) for_each_dapm_widgets(list, i, widget) { ... (A) if (!fe->dpcm[stream].runtime && !fe->fe_compr) continue; ... } ... } This patch checks fe condition at out of loop Signed-off-by: Kuninori Morimoto --- sound/soc/soc-pcm.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sound/soc/soc-pcm.c b/sound/soc/soc-pcm.c index 1f55f8d40d5e..1dae758bc4aa 100644 --- a/sound/soc/soc-pcm.c +++ b/sound/soc/soc-pcm.c @@ -1458,6 +1458,10 @@ static int dpcm_add_paths(struct snd_soc_pcm_runtime *fe, int stream, struct snd_soc_dapm_widget *widget; int i, new = 0, err; + /* don't connect if FE is not running */ + if (!fe->dpcm[stream].runtime && !fe->fe_compr) + return new; + /* Create any new FE <--> BE connections */ for_each_dapm_widgets(list, i, widget) { @@ -1482,10 +1486,6 @@ static int dpcm_add_paths(struct snd_soc_pcm_runtime *fe, int stream, continue; } - /* don't connect if FE is not running */ - if (!fe->dpcm[stream].runtime && !fe->fe_compr) - continue; - /* * Filter for systems with 'component_chaining' enabled. * This helps to avoid unnecessary re-configuration of an