From patchwork Wed Aug 23 08:24:34 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: SF Markus Elfring X-Patchwork-Id: 9916843 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 DB3F8603FF for ; Wed, 23 Aug 2017 08:31:26 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CD2C128565 for ; Wed, 23 Aug 2017 08:31:26 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C222B2896E; Wed, 23 Aug 2017 08:31:26 +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.9 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_NONE autolearn=unavailable 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 E7DDD28565 for ; Wed, 23 Aug 2017 08:31:25 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 4F335266CB8; Wed, 23 Aug 2017 10:24:47 +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 74423266CC3; Wed, 23 Aug 2017 10:24:45 +0200 (CEST) Received: from mout.web.de (mout.web.de [212.227.15.3]) by alsa0.perex.cz (Postfix) with ESMTP id D2BE62665D5 for ; Wed, 23 Aug 2017 10:24:43 +0200 (CEST) Received: from [192.168.1.2] ([77.182.78.200]) by smtp.web.de (mrweb002 [213.165.67.108]) with ESMTPSA (Nemesis) id 0MeSYJ-1dueUd0vUt-00QAkB; Wed, 23 Aug 2017 10:24:36 +0200 From: SF Markus Elfring To: alsa-devel@alsa-project.org, Arnd Bergmann , Arvind Yadav , Dan Carpenter , Ingo Molnar , Jaroslav Kysela , Takashi Iwai , Takashi Sakamoto , Vegard Nossum References: <800d7aa6-d8f2-cbf5-caaa-7e4006976e68@users.sourceforge.net> Message-ID: <9fcdbe5a-b17a-dfb8-f4af-a1261da93a38@users.sourceforge.net> Date: Wed, 23 Aug 2017 10:24:34 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 MIME-Version: 1.0 In-Reply-To: <800d7aa6-d8f2-cbf5-caaa-7e4006976e68@users.sourceforge.net> Content-Language: en-GB X-Provags-ID: V03:K0:lffTiGNIIaYsd/mcr141v0mWJ63yoqHv6d8ANYOYprloanlv4Gs fKJjMAnj4KMZ0Y7IuxFy/+1aa6m5SmykXou0TGzcVofb0hM8SL7NnxUnnjJTbhSZEVJcn08 1RAA+oUinq7XiYeDD7jaZltmhPFvkhMBn95CKSxf7Jqx7FHFKPUdnmoDYhA1Zj3PkHVcaKH S3ZTHnOgxjoiYZFKFet9Q== X-UI-Out-Filterresults: notjunk:1; V01:K0:weRalWhhUf4=:2G4N2LmUJx4zRr0liXo4Zv E6VMHh5LD0jqWrKm8Jyk7gMZVEy7/RjkS/kTXTF98xWseyYY/q1TohyjJ2du00lZhuu3OQ7ew oC4PC++jwN4W1283nmshM3Ode6dD40Vj2AjM8LwM4fqKOFRA3h1Rz1IDlqtwg1mWSI5/b7EMQ MsNfTgrtZZHBZVU10OvqvVlnWugeaJZoEoiyhXvn/rmTVNY8QkrMdyv5Boa0a9lH6E7JyaRU4 XLF2zK+RXnj1HdiDMWnLTFhbiGszsxZpsGHomt+337EPz5iZXl5yAU5o0IvtnODfSoCw830O6 ND9xHjFrcVN1fEOge6Bc+iiIsep7FMCffaWhHWKR7Ev1YxaSIYb6uF/80IjxOkqopG8N+tdpa PxKXrqp1rFOh88w7IhHnY5JbjrfEwQ+RuUhpZAPT18hquNNA2oVthIZknwJD6uzPebv/n1tBq apQ9OsHgRQigJuISYUoHBg3dVF8tfyxvE9/qBwYUo5KwQOyFbDOBZpfSLjiKhf6qUUUHA5cAL gGKitQ9C/lsVLRPq0Y/HRfQH14WM8zBPcwp62HAMQTIVZH/NUNwpz81zeo4TJsx3A0aNRngYb CzBPePIGsON1sRE0ceMcRzanEqo7dfbIXNvrccGyhCitxGLQDQXf/Uj8WNaKcSNRSYJJ3ov4K w1CKEjT33IyM6tLXZVWQicdKrN5vZQ7vH5wzRlSK2cLvdnKhCsDepYrFS4tjEFnoMQxBU42rA 3zJ1gSeXp1/xe+Ip6wAMzwjywsYpa1bdwrjdI7eCobvvAfDUPklIdDVnX1RgQZI9o8TVH5Kil re6e+7cm7i76+RyGNCEAnXwqWuKu/hCmjCMzbKcfqPu9InCiKU= Cc: kernel-janitors@vger.kernel.org, LKML Subject: [alsa-devel] [PATCH 2/6] ALSA: pcm: Adjust nine function calls together with a variable assignment 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: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP From: Markus Elfring Date: Wed, 23 Aug 2017 09:20:29 +0200 The script "checkpatch.pl" pointed information out like the following. ERROR: do not use assignment in if condition Thus fix the affected source code places. Signed-off-by: Markus Elfring --- sound/core/pcm.c | 38 +++++++++++++++++++++++--------------- 1 file changed, 23 insertions(+), 15 deletions(-) diff --git a/sound/core/pcm.c b/sound/core/pcm.c index 048df9658f50..c790f79e45ae 100644 --- a/sound/core/pcm.c +++ b/sound/core/pcm.c @@ -523,7 +523,9 @@ static int snd_pcm_stream_proc_init(struct snd_pcm_str *pstr) sprintf(name, "pcm%i%c", pcm->device, pstr->stream == SNDRV_PCM_STREAM_PLAYBACK ? 'p' : 'c'); - if ((entry = snd_info_create_card_entry(pcm->card, name, pcm->card->proc_root)) == NULL) + entry = snd_info_create_card_entry(pcm->card, name, + pcm->card->proc_root); + if (!entry) return -ENOMEM; entry->mode = S_IFDIR | S_IRUGO | S_IXUGO; if (snd_info_register(entry) < 0) { @@ -531,8 +533,8 @@ static int snd_pcm_stream_proc_init(struct snd_pcm_str *pstr) return -ENOMEM; } pstr->proc_root = entry; - - if ((entry = snd_info_create_card_entry(pcm->card, "info", pstr->proc_root)) != NULL) { + entry = snd_info_create_card_entry(pcm->card, "info", pstr->proc_root); + if (entry) { snd_info_set_text_ops(entry, pstr, snd_pcm_stream_proc_info_read); if (snd_info_register(entry) < 0) { snd_info_free_entry(entry); @@ -542,8 +544,9 @@ static int snd_pcm_stream_proc_init(struct snd_pcm_str *pstr) pstr->proc_info_entry = entry; #ifdef CONFIG_SND_PCM_XRUN_DEBUG - if ((entry = snd_info_create_card_entry(pcm->card, "xrun_debug", - pstr->proc_root)) != NULL) { + entry = snd_info_create_card_entry(pcm->card, "xrun_debug", + pstr->proc_root); + if (entry) { entry->c.text.read = snd_pcm_xrun_debug_read; entry->c.text.write = snd_pcm_xrun_debug_write; entry->mode |= S_IWUSR; @@ -580,7 +583,9 @@ static int snd_pcm_substream_proc_init(struct snd_pcm_substream *substream) card = substream->pcm->card; sprintf(name, "sub%i", substream->number); - if ((entry = snd_info_create_card_entry(card, name, substream->pstr->proc_root)) == NULL) + entry = snd_info_create_card_entry(card, name, + substream->pstr->proc_root); + if (!entry) return -ENOMEM; entry->mode = S_IFDIR | S_IRUGO | S_IXUGO; if (snd_info_register(entry) < 0) { @@ -588,8 +593,8 @@ static int snd_pcm_substream_proc_init(struct snd_pcm_substream *substream) return -ENOMEM; } substream->proc_root = entry; - - if ((entry = snd_info_create_card_entry(card, "info", substream->proc_root)) != NULL) { + entry = snd_info_create_card_entry(card, "info", substream->proc_root); + if (entry) { snd_info_set_text_ops(entry, substream, snd_pcm_substream_proc_info_read); if (snd_info_register(entry) < 0) { @@ -598,8 +603,9 @@ static int snd_pcm_substream_proc_init(struct snd_pcm_substream *substream) } } substream->proc_info_entry = entry; - - if ((entry = snd_info_create_card_entry(card, "hw_params", substream->proc_root)) != NULL) { + entry = snd_info_create_card_entry(card, "hw_params", + substream->proc_root); + if (entry) { snd_info_set_text_ops(entry, substream, snd_pcm_substream_proc_hw_params_read); if (snd_info_register(entry) < 0) { @@ -608,8 +614,9 @@ static int snd_pcm_substream_proc_init(struct snd_pcm_substream *substream) } } substream->proc_hw_params_entry = entry; - - if ((entry = snd_info_create_card_entry(card, "sw_params", substream->proc_root)) != NULL) { + entry = snd_info_create_card_entry(card, "sw_params", + substream->proc_root); + if (entry) { snd_info_set_text_ops(entry, substream, snd_pcm_substream_proc_sw_params_read); if (snd_info_register(entry) < 0) { @@ -618,8 +625,8 @@ static int snd_pcm_substream_proc_init(struct snd_pcm_substream *substream) } } substream->proc_sw_params_entry = entry; - - if ((entry = snd_info_create_card_entry(card, "status", substream->proc_root)) != NULL) { + entry = snd_info_create_module_entry(THIS_MODULE, "pcm", NULL); + if (entry) { snd_info_set_text_ops(entry, substream, snd_pcm_substream_proc_status_read); if (snd_info_register(entry) < 0) { @@ -1230,7 +1237,8 @@ static void snd_pcm_proc_init(void) { struct snd_info_entry *entry; - if ((entry = snd_info_create_module_entry(THIS_MODULE, "pcm", NULL)) != NULL) { + entry = snd_info_create_module_entry(THIS_MODULE, "pcm", NULL); + if (entry) { snd_info_set_text_ops(entry, NULL, snd_pcm_proc_read); if (snd_info_register(entry) < 0) { snd_info_free_entry(entry);