From patchwork Wed Sep 20 08:28:34 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anish Kumar X-Patchwork-Id: 9961097 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id E3432600C5 for ; Wed, 20 Sep 2017 08:30:25 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D07882901B for ; Wed, 20 Sep 2017 08:30:25 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BDECA29029; Wed, 20 Sep 2017 08:30:25 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.3 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,RCVD_IN_SORBS_SPAM, T_DKIM_INVALID autolearn=no version=3.3.1 Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0EECE29024 for ; Wed, 20 Sep 2017 08:30:24 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 4DF2A267299; Wed, 20 Sep 2017 10:28:56 +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 3789826727D; Wed, 20 Sep 2017 10:28:54 +0200 (CEST) Received: from mail-pg0-f66.google.com (mail-pg0-f66.google.com [74.125.83.66]) by alsa0.perex.cz (Postfix) with ESMTP id A0EA0267277 for ; Wed, 20 Sep 2017 10:28:51 +0200 (CEST) Received: by mail-pg0-f66.google.com with SMTP id j16so1272676pga.2 for ; Wed, 20 Sep 2017 01:28:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=A/cVPD++L+02bvSwrgh1NdszYMXpZDhe+6GJRYPYtwY=; b=B0TKyLZMPx6NPenNWfQYR7BjlK+Tcr1+GZwQ58Vcxh+7rjiSWcqpnY6BBuzvy81zBA jspPmBJAiiUbJ1AiTX/NjXI8LWQbpdPSGzUZ0l/ACbVXXF7GktIkFWbDRo1mOM2zccDF KX7g2jrCpGB2bR7Loauu9i1c/Zh6s0NEckntl65S8ILYwL2aJkkWBDdQURJVc/0J8rKX Me2gdWuaxIOXeANveHiKCE/KY1ZfDgLFVbT+04fPisipUGmAqyrx5gzN3Ec+5drGx/3r J4DjNlKLIP4jR4RXNqEzRaP6qzvpscyGXVJGEmE1v1Ln0u4XddGLHGubk358JS5HwgGc KLLg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=A/cVPD++L+02bvSwrgh1NdszYMXpZDhe+6GJRYPYtwY=; b=SwNaZPBxnaTm5argYqK8fJ3e0vRhZo+rU4bIeANIvw2CDighsdePg1xhA+Zbd+8UwA OwavXb7tNmdZ+VXG5+rS9xtoRgjf9IpUtkdLaVDuHTaYPJaws1zXoKssn3caPEnO+sxv Qb2hnKayo9wWTjheQh/uqhx45FnPQjVvm9+3hNrkqa1oTe8O4vOCyIG1KmUjTi9Ip7pQ ukrWAxq8WPDv6MOi1d7fwXjFHv0pUIdV49EUGb5RXXdppLafZuMo/vHdixqXT4oJ+Hwz lWAvRX/YVIHiAWIcKOBHp3fUnQ1qpoFy6bxh1bgi/qDqNPLt9mgo9bknFRMWdkB7zJDK E9ww== X-Gm-Message-State: AHPjjUj5OQ/3fjsgUcwCdceW4pryDtSH4qufnGNV0FtPNO9jGFOVE7MV mZZ2+AojpuZQ78LAB/uJhuQ= X-Google-Smtp-Source: AOwi7QAEEvqbmaWZZQWA0p0HdtTmkWiejGMUEHk3jK0qnSxlcvUKaL4f9unoWVEK3SYnnNl3ztp/YA== X-Received: by 10.99.121.135 with SMTP id u129mr1385281pgc.250.1505896130151; Wed, 20 Sep 2017 01:28:50 -0700 (PDT) Received: from anishs-MacBook-Pro.local.net ([24.6.106.169]) by smtp.gmail.com with ESMTPSA id z83sm6229607pfd.10.2017.09.20.01.28.49 (version=TLS1 cipher=AES128-SHA bits=128/128); Wed, 20 Sep 2017 01:28:49 -0700 (PDT) From: yesanishhere@gmail.com To: ckeepax@opensource.cirrus.com, broonie@kernel.org, lgirdwood@gmail.com, perex@perex.cz, alsa-devel@alsa-project.org, tiwai@suse.com Date: Wed, 20 Sep 2017 01:28:34 -0700 Message-Id: <1505896116-43310-3-git-send-email-yesanishhere@gmail.com> X-Mailer: git-send-email 2.5.4 (Apple Git-61) In-Reply-To: <1505896116-43310-1-git-send-email-yesanishhere@gmail.com> References: <1505896116-43310-1-git-send-email-yesanishhere@gmail.com> Cc: anish kumar Subject: [alsa-devel] [Resend] [PATCH 2/4] ASoC: dapm: Refactor the code in snd_soc_dapm_new_pcm 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 X-Virus-Scanned: ClamAV using ClamSMTP From: anish kumar refactor snd_soc_dapm_new_pcm to reduce the size of this function to facilitate further refactoring. Signed-off-by: anish kumar Reviewed-by: Charles Keepax --- sound/soc/soc-dapm.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/sound/soc/soc-dapm.c b/sound/soc/soc-dapm.c index f51f613..d55cac6 100644 --- a/sound/soc/soc-dapm.c +++ b/sound/soc/soc-dapm.c @@ -3821,19 +3821,15 @@ int snd_soc_dapm_new_pcm(struct snd_soc_card *card, devm_kasprintf(card->dev, GFP_KERNEL, "Anonymous Configuration %d", count); - if (!w_param_text[count]) { - ret = -ENOMEM; - goto outfree_link_name; - } } else { w_param_text[count] = devm_kmemdup(card->dev, config->stream_name, strlen(config->stream_name) + 1, GFP_KERNEL); - if (!w_param_text[count]) { - ret = -ENOMEM; - goto outfree_link_name; - } + } + if (!w_param_text[count]) { + ret = -ENOMEM; + goto outfree_link_name; } config++; }