From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753688AbdHWIZc (ORCPT ); Wed, 23 Aug 2017 04:25:32 -0400 Received: from mout.web.de ([212.227.15.3]:61874 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753538AbdHWIZ1 (ORCPT ); Wed, 23 Aug 2017 04:25:27 -0400 Subject: [PATCH 2/6] ALSA: pcm: Adjust nine function calls together with a variable assignment 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 Cc: kernel-janitors@vger.kernel.org, LKML 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-Type: text/plain; charset=utf-8 Content-Language: en-GB Content-Transfer-Encoding: 8bit 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= Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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); -- 2.14.0