From patchwork Tue Sep 11 18:22:14 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Brown X-Patchwork-Id: 146480 Delivered-To: patch@linaro.org Received: by 2002:a2e:1648:0:0:0:0:0 with SMTP id 8-v6csp3934713ljw; Tue, 11 Sep 2018 11:22:21 -0700 (PDT) X-Google-Smtp-Source: ANB0VdbJ0tx+dADOfbIS7nrYXRTo1MmdXgXj+ewIyvFgnr+bUx9RdnKNL01memJBBNRQL6GTpKdF X-Received: by 2002:adf:9e06:: with SMTP id u6-v6mr5703214wre.51.1536690141587; Tue, 11 Sep 2018 11:22:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536690141; cv=none; d=google.com; s=arc-20160816; b=oJe/K6FkhnFhitTi099Uv/iFGYeXfVrjNpwG8DN8bcLJduc1I81D/Sx2zt7MT8mp5t 2UZNx+jPztQd8fkMHsfBA/uFHPK9UhuMOlzGg+K/wb1xZRVgbIq2T5ymGKsxvIw6qDzK LI92yL9XTNDuTe1H1n/+ZAu/X8Vx3VxTrJ3QUXwnwiv6Z5ErZQU7/PKSRlU4asOeICyH UHkupgU00oo6VAAL+AhGfRuSazrynGQuTj+0EF4x2U3OPtcwX8OqAqUOIj9Cxq8T1yQd MzCR/kq1XFZEjdN9ZqX1rgpYsB5rP2iYSHR3Wn6Cyht5V/AeHys7TI5RYh1zT95Yao/C ES6A== 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=pvT4uaw9OL1NCtuv/zFqCtgnIchLC9eVzNSOd+33XBw=; b=PU+it34iXVt7seDTlUZ95AtMB14YEOLm+FN/W8j2TV8YzSrtC52ToDQEnHP+zdKI8q UCf6A3YFlnQS/tD61E5coZ0z5TOQbqUgji5h4SiuOQFu2kT3oqW8+A+e9Tuh/NE66JAS DbIYBQO20DJBsfZwaHEBtRlx2qBNl2d2SHskuxA052YxcAxHEemLznoAf6f86Y19pijD rlRGOr6hKW+SCMiUIgEfghWm6M52nIH9WwR6mXxASIi+UltG31W6KbTF8l+EdcNam6wz 6OmFEfnbREdaZ0HUJ3d4hdO9+lDla7WEBL/LSHpiB0YWLahDCbfBN41wvWvpJIRUjz3f DWjA== 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=nujjZi9k; 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 s5-v6si18888363wrm.364.2018.09.11.11.22.21; Tue, 11 Sep 2018 11:22:21 -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=nujjZi9k; 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 EB56E26787A; Tue, 11 Sep 2018 20:22:19 +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 7518F267877; Tue, 11 Sep 2018 20:22:17 +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 3EFEC26787A for ; Tue, 11 Sep 2018 20:22:15 +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=49lXkHFaeKLd+K28en9ZoTbzURXlds3RwTEKwBY62Fc=; b=nujjZi9kJm2C Jzf47UCG71FcjvpmyEqJyEf9sfgn/DZeoYkOg1XFirKe2enIoevJtDV0Maf6iUWpx1sL1xgFl3mzC Gz7saWow/mQ7CuFVtsIclIJuqFqM45i4y5/vVUh6nocx5vgYIZ4IebS8HJAzHOURmw043X9z1mO7T vgp8c=; Received: from cpc102320-sgyl38-2-0-cust46.18-2.cable.virginm.net ([82.37.168.47] helo=debutante.sirena.org.uk) by heliosphere.sirena.org.uk with esmtpa (Exim 4.89) (envelope-from ) id 1fznIl-00058b-3K; Tue, 11 Sep 2018 18:22:15 +0000 Received: by debutante.sirena.org.uk (Postfix, from userid 1000) id D4B3A1121B1F; Tue, 11 Sep 2018 19:22:14 +0100 (BST) From: Mark Brown To: Kuninori Morimoto In-Reply-To: <87y3c84jka.wl-kuninori.morimoto.gx@renesas.com> Message-Id: <20180911182214.D4B3A1121B1F@debutante.sirena.org.uk> Date: Tue, 11 Sep 2018 19:22:14 +0100 (BST) Cc: alsa-devel@alsa-project.org, Mark Brown Subject: [alsa-devel] Applied "ASoC: soc-core: avoid nested code on soc_remove_dai()" 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: soc-core: avoid nested code on soc_remove_dai() 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 2eda3cb108b699a6ff78a87e25143c153bc88e41 Mon Sep 17 00:00:00 2001 From: Kuninori Morimoto Date: Tue, 11 Sep 2018 06:54:26 +0000 Subject: [PATCH] ASoC: soc-core: avoid nested code on soc_remove_dai() Nested code is not readable. This patch avoid it on soc_remove_dai(). Signed-off-by: Kuninori Morimoto Signed-off-by: Mark Brown --- sound/soc/soc-core.c | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) -- 2.19.0.rc2 _______________________________________________ Alsa-devel mailing list Alsa-devel@alsa-project.org http://mailman.alsa-project.org/mailman/listinfo/alsa-devel diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c index 4e9367aacc0c..dde9b70b58b5 100644 --- a/sound/soc/soc-core.c +++ b/sound/soc/soc-core.c @@ -942,17 +942,18 @@ static void soc_remove_dai(struct snd_soc_dai *dai, int order) { int err; - if (dai && dai->probed && - dai->driver->remove_order == order) { - if (dai->driver->remove) { - err = dai->driver->remove(dai); - if (err < 0) - dev_err(dai->dev, - "ASoC: failed to remove %s: %d\n", - dai->name, err); - } - dai->probed = 0; + if (!dai || !dai->probed || + dai->driver->remove_order != order) + return; + + if (dai->driver->remove) { + err = dai->driver->remove(dai); + if (err < 0) + dev_err(dai->dev, + "ASoC: failed to remove %s: %d\n", + dai->name, err); } + dai->probed = 0; } static void soc_remove_link_dais(struct snd_soc_card *card,