From patchwork Thu Sep 20 17:35:53 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Brown X-Patchwork-Id: 147116 Delivered-To: patch@linaro.org Received: by 2002:a2e:1648:0:0:0:0:0 with SMTP id 8-v6csp2280001ljw; Thu, 20 Sep 2018 10:36:10 -0700 (PDT) X-Google-Smtp-Source: ANB0Vdb2nIaEhA3b/OLfd5Q96PpF3Ty+vR1fnyZyTeUZW0mZ912/ZOwx0timtJCiXlT6LuwkDi0c X-Received: by 2002:a1c:a941:: with SMTP id s62-v6mr3662707wme.76.1537464970308; Thu, 20 Sep 2018 10:36:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537464970; cv=none; d=google.com; s=arc-20160816; b=k5bH98hgVRALa9d443w5rH+QK320kCC0g4xbnOTZ6nkGHiHyB4yLVXL09Mf/SYyGVp u5WDFLw505R9a7DbeNrVcZEXz0tksKP02AUCBdMbCOxQbwqCivATf7d4PaKpCIK6TTTz Mtvk8HYSxqdQso7Zr+p20T59Cp60Y/VhXbHRQyhu2PovZNEqseZFtAEBFi+qtyvAaqFY KNR3gPnUKlSuC7veriuZV6CxOrz/D1KJodyCWXno49b4/Ff/CKzGijMtT6YbPP5mg2Ic K2du4TfNrEqYmKV61MKfFCkmIgRmXHf9kDjTFoupACnFkZx8JDqFurrAlefor/cPKDnX BQyg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:cc:date:message-id:in-reply-to:to:from :dkim-signature:delivered-to; bh=tYjB2NOfXwk1XU1cD6egI8+crurvd79Fm8Nil7QS6vE=; b=In7t1kfutqPZnxEgTzmt3zmK0bCYT7VW2DI+DV3pxh8FSLcatllycIQwwUuhmdEQx0 0A2qG6ezof01gb74qx1Ob9uSMVbS+PhV6YYAB4eaZGfvUu8efy4ZZHLkE3jDHvDuWMdX lIuZPLc6p815IK4jFV4vhz2XHzynUBAPt+1nJc7pmFW3PHoPaA7W5DbP8LUEvIdBNVpY ZFxeEmsF23zBxfs2zLUPv1cTyGOO2PQWfFKHxzGOXoWI3bXGmEzP57UaM2MvC3KRbSfu kzx8tNhHg1miSQCRw65XXWjuDGK1hAAP/DT4cjN4KioHI37i9ljzlgbNtK9ceeBF2eP/ mFvw== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@sirena.org.uk header.s=20170815-heliosphere header.b=c+FUWS8c; spf=pass (google.com: domain of alsa-devel-bounces@alsa-project.org designates 77.48.224.243 as permitted sender) smtp.mailfrom=alsa-devel-bounces@alsa-project.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from alsa0.perex.cz (alsa0.perex.cz. [77.48.224.243]) by mx.google.com with ESMTP id c197-v6si2773156wme.65.2018.09.20.10.36.09; Thu, 20 Sep 2018 10:36:10 -0700 (PDT) Received-SPF: pass (google.com: domain of alsa-devel-bounces@alsa-project.org designates 77.48.224.243 as permitted sender) client-ip=77.48.224.243; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@sirena.org.uk header.s=20170815-heliosphere header.b=c+FUWS8c; spf=pass (google.com: domain of alsa-devel-bounces@alsa-project.org designates 77.48.224.243 as permitted sender) smtp.mailfrom=alsa-devel-bounces@alsa-project.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 0227D2678C4; Thu, 20 Sep 2018 19:36:05 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id 149D32678C2; Thu, 20 Sep 2018 19:36:03 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mail1.perex.cz X-Spam-Level: X-Spam-Status: No, score=0.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=disabled version=3.4.0 Received: from heliosphere.sirena.org.uk (heliosphere.sirena.org.uk [172.104.155.198]) by alsa0.perex.cz (Postfix) with ESMTP id 9A1D026789F for ; Thu, 20 Sep 2018 19:35:56 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sirena.org.uk; s=20170815-heliosphere; h=Date:Message-Id:In-Reply-To: Subject:Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:References: List-Id:List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner: List-Archive; bh=1bnzRDa1Afz1PobYXsRJHGwtYNVJX6THbY59F8gr0GU=; b=c+FUWS8cEjVC XMgIIFkdbLQhm2X4WhTct6oYEpC3j8ZtdU2870HvWTMn+TmOVREruGS0gJgjYvL/oSdcCIuIbpK0U vAVRthCuHm/oSFuKF1UHhckih5J/h3CU65ZiY6H6zHfdopye1z4pWaTcqxOa3MLUjRK83RqmSz4cL Ad8ss=; Received: from [209.121.128.187] (helo=finisterre.ee.mobilebroadband) by heliosphere.sirena.org.uk with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1g32rs-0007EC-Av; Thu, 20 Sep 2018 17:35:56 +0000 Received: by finisterre.ee.mobilebroadband (Postfix, from userid 1000) id 725EE440078; Thu, 20 Sep 2018 18:35:53 +0100 (BST) From: Mark Brown To: Kuninori Morimoto In-Reply-To: <87va73ppl8.wl-kuninori.morimoto.gx@renesas.com> Message-Id: <20180920173553.725EE440078@finisterre.ee.mobilebroadband> Date: Thu, 20 Sep 2018 18:35:53 +0100 (BST) Cc: alsa-devel@alsa-project.org, Mark Brown Subject: [alsa-devel] Applied "ASoC: add for_each_card_links() macro" to the asoc tree X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 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: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org The patch ASoC: add for_each_card_links() macro has been applied to the asoc tree at https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted. You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed. If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced. Please add any relevant lists and maintainers to the CCs when replying to this mail. Thanks, Mark >From 98061fdbfccc02aa0fd6637c67a0524aab385b8d Mon Sep 17 00:00:00 2001 From: Kuninori Morimoto Date: Tue, 18 Sep 2018 01:29:16 +0000 Subject: [PATCH] ASoC: add for_each_card_links() macro To be more readable code, this patch adds new for_each_card_links() macro, and replace existing code to it. Signed-off-by: Kuninori Morimoto Signed-off-by: Mark Brown --- include/sound/soc.h | 6 ++++++ sound/soc/soc-core.c | 8 ++++---- 2 files changed, 10 insertions(+), 4 deletions(-) -- 2.19.0 _______________________________________________ Alsa-devel mailing list Alsa-devel@alsa-project.org http://mailman.alsa-project.org/mailman/listinfo/alsa-devel diff --git a/include/sound/soc.h b/include/sound/soc.h index f94b989e7a1a..1fffbaa819d9 100644 --- a/include/sound/soc.h +++ b/include/sound/soc.h @@ -1125,6 +1125,12 @@ struct snd_soc_card { ((i) < (card)->num_links) && ((link) = &(card)->dai_link[i]); \ (i)++) +#define for_each_card_links(card, link) \ + list_for_each_entry(dai_link, &(card)->dai_link_list, list) +#define for_each_card_links_safe(card, link, _link) \ + list_for_each_entry_safe(link, _link, &(card)->dai_link_list, list) + + /* SoC machine DAI configuration, glues a codec and cpu DAI together */ struct snd_soc_pcm_runtime { struct device *dev; diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c index 532d8c59ed1e..495173635642 100644 --- a/sound/soc/soc-core.c +++ b/sound/soc/soc-core.c @@ -816,7 +816,7 @@ struct snd_soc_dai_link *snd_soc_find_dai_link(struct snd_soc_card *card, lockdep_assert_held(&client_mutex); - list_for_each_entry_safe(link, _link, &card->dai_link_list, list) { + for_each_card_links_safe(card, link, _link) { if (link->id != id) continue; @@ -1004,7 +1004,7 @@ static void soc_remove_dai_links(struct snd_soc_card *card) soc_remove_link_components(card, rtd, order); } - list_for_each_entry_safe(link, _link, &card->dai_link_list, list) { + for_each_card_links_safe(card, link, _link) { if (link->dobj.type == SND_SOC_DOBJ_DAI_LINK) dev_warn(card->dev, "Topology forgot to remove link %s?\n", link->name); @@ -1219,7 +1219,7 @@ void snd_soc_remove_dai_link(struct snd_soc_card *card, if (dai_link->dobj.type && card->remove_dai_link) card->remove_dai_link(card, dai_link); - list_for_each_entry_safe(link, _link, &card->dai_link_list, list) { + for_each_card_links_safe(card, link, _link) { if (link == dai_link) { list_del(&link->list); return; @@ -2033,7 +2033,7 @@ static int snd_soc_instantiate_card(struct snd_soc_card *card) /* Find new DAI links added during probing components and bind them. * Components with topology may bring new DAIs and DAI links. */ - list_for_each_entry(dai_link, &card->dai_link_list, list) { + for_each_card_links(card, dai_link) { if (soc_is_dai_link_bound(card, dai_link)) continue;