From patchwork Sat Aug 26 08:29:38 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: anish kumar X-Patchwork-Id: 9923255 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 14EEC602BD for ; Sat, 26 Aug 2017 08:30:01 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F34D12856B for ; Sat, 26 Aug 2017 08:30:00 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E5F26285C6; Sat, 26 Aug 2017 08:30:00 +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 35BE82856B for ; Sat, 26 Aug 2017 08:30:00 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 979F52678C1; Sat, 26 Aug 2017 10:29:57 +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 460972678BD; Sat, 26 Aug 2017 10:29:56 +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 D221B26741F for ; Sat, 26 Aug 2017 10:29:45 +0200 (CEST) Received: by mail-pg0-f66.google.com with SMTP id 63so2432264pgc.1 for ; Sat, 26 Aug 2017 01:29:45 -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; bh=B5zjwgGGc8kgeJUSmaUMpV+iowhobwoEa//qDL/1XTY=; b=F+iAYdjuiDCQPnbdKHoU1SuoJ7V13kGA+3bFLFVPgknp7Bh/jK1Cf925oo3s+D/ouz gs3Mdrl809WIBJwAg0HTaAgpGd0vrNNpVQzFqOWAJg6LSAZTXKJBS3zZo0msERIi00+C B9F+WXEx52K/LH3H2HlrbChZ6PQTlyRChlDM+E3syzTwSpgTSyie90fXCTYWykz3+Ep5 Zg3Cezrl60Qdq5xkCytPGa5yt8HugFdHm/MiPeW8a/a504XRIdBhCqj+sEgiV38ht7yu g2Rszru7nZvsOJ0FDINVD9+gxJz8+XEIxqunRAkKF8wpzX0T8CvlIHTpQ5snIm3uPhdt AkAg== 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; bh=B5zjwgGGc8kgeJUSmaUMpV+iowhobwoEa//qDL/1XTY=; b=PLPuRdfpV9NV0jjb3yIvTUGN5kzbazTKZK9da1Nq/f9TdIyrELBJN7TrDVHpAwa8ra sC/1A1Aur+5kemvm/jDK0hgNh1j+hwoxCAB64eL1nMlzK/02rO9qWCFj2XxoNBEGYoh7 Fg38wD3FH724Ky5ThIZQhH1kFvRTDjf/DhkAiuXzAcHopti2d009p5UqmejxlpzZimCn AXbjCInL8yFsm6MpStmWwMhi759SAA238lAbHl8xPHoKdO1bwnORmiByGr5L8RCC7+yg TRtq4imAbygyqfr4bOZslzGUERbGpdvKiYJU4g6Sv2jta8lGH7vkdbI4KuVajBGQScCP MelA== X-Gm-Message-State: AHYfb5hjxznZMcEdvlEjZpKkhTDw8natD4wnVtr/OfRgBJI/Jp9jubTA HqxJ4AUY/yBEFA== X-Received: by 10.84.132.106 with SMTP id 97mr1233460ple.105.1503736182421; Sat, 26 Aug 2017 01:29:42 -0700 (PDT) Received: from AIKUMA-MBP.hsd1.ca.comcast.net. ([24.6.106.169]) by smtp.googlemail.com with ESMTPSA id r16sm14645054pgu.68.2017.08.26.01.29.41 (version=TLS1 cipher=AES128-SHA bits=128/128); Sat, 26 Aug 2017 01:29:41 -0700 (PDT) From: anish kumar To: broonie@kernel.org Date: Sat, 26 Aug 2017 01:29:38 -0700 Message-Id: <20170826082938.35516-1-yesanishhere@gmail.com> X-Mailer: git-send-email 2.10.1 (Apple Git-78) Cc: anish kumar , alsa-devel@alsa-project.org, tiwai@suse.com, lgirdwood@gmail.com Subject: [alsa-devel] [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 refactor snd_soc_dapm_new_pcm to reduce the size of this function to facilitate further refactoring. Signed-off-by: anish kumar --- 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 6e10a9a..1687c8a 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++; }