From patchwork Sat Aug 12 15:35:41 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: SF Markus Elfring X-Patchwork-Id: 9897377 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 7CCA860325 for ; Sat, 12 Aug 2017 15:38:25 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6E3AF287C0 for ; Sat, 12 Aug 2017 15:38:25 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 62E1F288F7; Sat, 12 Aug 2017 15:38: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.9 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_NONE autolearn=ham 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 A62BE287C0 for ; Sat, 12 Aug 2017 15:38:24 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 8D5FD26726A; Sat, 12 Aug 2017 17:38:12 +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 779292672C1; Sat, 12 Aug 2017 17:38:11 +0200 (CEST) Received: from mout.web.de (mout.web.de [212.227.17.11]) by alsa0.perex.cz (Postfix) with ESMTP id 3904326726B for ; Sat, 12 Aug 2017 17:36:19 +0200 (CEST) Received: from [192.168.1.2] ([77.181.183.107]) by smtp.web.de (mrweb101 [213.165.67.124]) with ESMTPSA (Nemesis) id 0LzK61-1dc4R42fp3-014U0e; Sat, 12 Aug 2017 17:35:43 +0200 From: SF Markus Elfring To: alsa-devel@alsa-project.org, Arnd Bergmann , Colin Ian King , Jaroslav Kysela , Julia Lawall , Takashi Iwai , Takashi Sakamoto References: Message-ID: <10358741-a748-1e48-7508-2aff911bbee5@users.sourceforge.net> Date: Sat, 12 Aug 2017 17:35:41 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 In-Reply-To: Content-Language: en-GB X-Provags-ID: V03:K0:DvsEitWXwlKld92kktzHO0hmSQGuop015voSb6SYJ7AhxgcVNew 6E4TC+uggMLOLguhvnf79hz7nPpj1byqvKvS7Jh8H8bkG2fFIsY5Y5ayMEikaGBgqOkPQbk +tA2RqkjHiyMgdy8r/4QRN841aiVdf4CChoaKzfYR5OICr7912y1pdV+fL6sbEgtAGQL8vo NKX6Hmld2jNUYG7KJdYlA== X-UI-Out-Filterresults: notjunk:1; V01:K0:m6qOFdx63eU=:144361ASaaUICbV2Ffd4SB ErlFC/URW6hEFcYVWs6MHawJ+oQeXpo0mRF9OeGM7cXDoR5IdJ43TkAClTi+wpcPRErAcj4nN TjLwd7nI5XGWv05FjpVXVWwp59TRJ6yu7fMsIb8F+lLu3gGzFjQ56DiO0PStNgS04LbNXnwT/ o69+c56CTISg85fmYvhDqVIUdA1u8pJuTY1uEkipAdxg46onD8bkw7A9+C9v1lTAEJh/g65bo dKgsAZXtJrtFN4scX3sF3kTemHil0t2sF0eir18ayLH5jv+h8wjgpK9mQI3/ujbirgVxHeIRv NjacNQH2Z+Z1ynZ82cgxhSjQoApU0MYPSNb0w7EjvTDqYd3XkwnUUtp2yqQP9PoyvJvwUFyZQ Zsmt0ugf8y6tjnAcvTVNCzYy0PPKaCGC+5TFcG9YTAXXy0FPL+m3r3HS3lfBHYZ5iF2DE3S2e N2DqwJvJi4Dlp0JsnVR+cjAzGI1O1biqRrpUVcqsozd+MQHpC6FsYu7fipZWw+vM/cMfxOxhZ 5WbUhT/71+cbuBOBWrmBjy+m3BlhBq7tsJxF3T9/RcrCtGN3EwQMHUcRwDR3X/jgZEao/tX8O ymEoCN+F9hJADV3ts+vabiRmuh6A1SK3V0SglOLPaQysnjGT16r/3ImTvTuLNDcOowzo8pPt8 HujJGa9qWhzhij297tQn0rfQMhslcs3m7YT4wtLR7+l7iFk4H5Rkaoj8TgXP8LJzVmpKSo9D9 i5uqJvkAi7hKj89WpOTKSEbY96CQx1uSUejvthHos7uScgs4JniM8DguVbzWnEehoYqqRKCPY GiClQzITTSiW/piDgv43SR2Dp9hG11H6uNVLZLvxYUMp04JCF0= Cc: kernel-janitors@vger.kernel.org, LKML Subject: [alsa-devel] [PATCH 3/3] ALSA: rme9652: Adjust seven checks for null pointers 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: Sat, 12 Aug 2017 17:07:09 +0200 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The script “checkpatch.pl” pointed information out like the following. Comparison to NULL could be written … Thus fix the affected source code places. Signed-off-by: Markus Elfring --- sound/pci/rme9652/hdspm.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/sound/pci/rme9652/hdspm.c b/sound/pci/rme9652/hdspm.c index 8d339fb7c24b..25284d8d9758 100644 --- a/sound/pci/rme9652/hdspm.c +++ b/sound/pci/rme9652/hdspm.c @@ -1521,7 +1521,7 @@ static void hdspm_silence_playback(struct hdspm *hdspm) int n = hdspm->period_bytes; void *buf = hdspm->playback_buffer; - if (buf == NULL) + if (!buf) return; for (i = 0; i < HDSPM_MAX_CHANNELS; i++) { @@ -4706,7 +4706,7 @@ static int snd_hdspm_create_controls(struct snd_card *card, break; } - if (NULL != list) { + if (list) { for (idx = 0; idx < limit; idx++) { err = snd_ctl_add(card, snd_ctl_new1(&list[idx], hdspm)); @@ -6069,13 +6069,13 @@ static int snd_hdspm_open(struct snd_pcm_substream *substream) snd_hdspm_capture_subinfo; if (playback) { - if (hdspm->capture_substream == NULL) + if (!hdspm->capture_substream) hdspm_stop_audio(hdspm); hdspm->playback_pid = current->pid; hdspm->playback_substream = substream; } else { - if (hdspm->playback_substream == NULL) + if (!hdspm->playback_substream) hdspm_stop_audio(hdspm); hdspm->capture_pid = current->pid; @@ -6775,9 +6775,9 @@ static int snd_hdspm_create(struct snd_card *card, HDSPM_s2_tco_detect) { hdspm->midiPorts++; hdspm->tco = kzalloc(sizeof(*hdspm->tco), GFP_KERNEL); - if (NULL != hdspm->tco) { + if (hdspm->tco) hdspm_tco_write(hdspm); - } + dev_info(card->dev, "AIO/RayDAT TCO module found\n"); } else { hdspm->tco = NULL; @@ -6789,9 +6789,9 @@ static int snd_hdspm_create(struct snd_card *card, if (hdspm_read(hdspm, HDSPM_statusRegister) & HDSPM_tco_detect) { hdspm->midiPorts++; hdspm->tco = kzalloc(sizeof(*hdspm->tco), GFP_KERNEL); - if (NULL != hdspm->tco) { + if (hdspm->tco) hdspm_tco_write(hdspm); - } + dev_info(card->dev, "MADI/AES TCO module found\n"); } else { hdspm->tco = NULL; @@ -6868,7 +6868,7 @@ static int snd_hdspm_create(struct snd_card *card, * this case, we don't set card->id to avoid collisions * when running with multiple cards. */ - if (NULL == id[hdspm->dev] && hdspm->serial != 0xFFFFFF) { + if (!id[hdspm->dev] && hdspm->serial != 0xFFFFFF) { snprintf(card->id, sizeof(card->id), "HDSPMx%06x", hdspm->serial); snd_card_set_id(card, card->id);