From patchwork Wed Aug 9 08:03:51 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: 9889805 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 59B29602D7 for ; Wed, 9 Aug 2017 08:04:02 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4BF20285F7 for ; Wed, 9 Aug 2017 08:04:02 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3EEEC285D4; Wed, 9 Aug 2017 08:04:02 +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 63B0B285D4 for ; Wed, 9 Aug 2017 08:04:01 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 0AE112673E9; Wed, 9 Aug 2017 10:04:00 +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 2068A2673EF; Wed, 9 Aug 2017 10:03:58 +0200 (CEST) Received: from mout.web.de (mout.web.de [212.227.17.11]) by alsa0.perex.cz (Postfix) with ESMTP id 80E082673DD for ; Wed, 9 Aug 2017 10:03:56 +0200 (CEST) Received: from [192.168.1.2] ([77.182.172.151]) by smtp.web.de (mrweb103 [213.165.67.124]) with ESMTPSA (Nemesis) id 0MFLB2-1dthy73RzQ-00EOBd; Wed, 09 Aug 2017 10:03:51 +0200 From: SF Markus Elfring To: alsa-devel@alsa-project.org, Jaroslav Kysela , Kees Cook , Takashi Iwai , Takashi Sakamoto References: <412aa3a5-c8b6-c1fe-febb-0d62927dacc2@users.sourceforge.net> Message-ID: Date: Wed, 9 Aug 2017 10:03:51 +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: <412aa3a5-c8b6-c1fe-febb-0d62927dacc2@users.sourceforge.net> Content-Language: en-GB X-Provags-ID: V03:K0:/XTFWOI0o+Nh8LISsYvlqNp56jkF63pgAZ8j1owrVWfu6FNm2kK o6cSCfOJg6nzj1NLQFlvVoCGbJx3oFo99xHXoGay/B4nMAi+NFTGPl4MJlmPnlXHG+WGSo+ btFctsv4X+PZUJbJVjYuWVfcrpJliJ6n9IB5Z8dlnyxWpB1vtMeijGUbhHmjGa4GtX2l/6s s0CYT7+hG6QXqPsw7Q5RA== X-UI-Out-Filterresults: notjunk:1; V01:K0:S8Vbr63JkXk=:jnN4z3LhiImkc92kgnKZcN 4ZhO8zUmgS3U6M+QtbzTR3zuHziXzxZCHWk0OfpUAB6+7C0zyQMt7wKY0pFSRMyDyTLQm+DB9 2NgRF2KbuxqBVtTX3if74MKYLFpVQmh5TcO83UPII0xce27jaewTm01nukJWKEtpFG2bdx6Uy EQJYIkjII+j5viitrOtzZhGXtDQGD4QNoRfh/8FiDHaRCF6r5R32Gb4fZjQyQgYp3VKIsUnsC JBJNGfW/1H1+8eTImTzh8QyZ0gXCol15CAKw1tg91RMZwziK9gKQz5/AaUXqcgttE/3hoisAo 2e8CWu4F+FnRE29C3iUTYDJBxDjLJmG1+0b+lBQHkypdK0n4xmp2eyd/2hZT3OQS4wKmcAT/2 xzrkY97vIzHFC8ZUOcJ1Xs1TAuKkQHJwM72iVqDKfSG9wy1KsVn4PsnTb9aq/yJBBEvkSgnil J9xkULZQF5K4+loEflQ+C4ytRVJLWamV4WosiWK4QLCsU+pZ+pVqpaWbUSgqSVVGN1niOimzd ZlFpWXF2QhohFYDnXzgHPFNRlNhJxmei/niOSWT9ozFv2VjGrmXKuWSeY7eGvFg2INYjDUFXJ TXh7KlUUnt22mRhc1oGHJn0fHfGT7lBwlnxbez9y/sdSJe2tQIRcOm2tql0fB3AkPFsBpesGw X7SkeXw6p2+5K/eWasVvAREHACU7CoU1WAXdOyUG5FXqL87RyCV7mFzOzhddABrzo4+hBgjUa yW67wDcsPLYJq8aWFAxi+sqdwpCyGJT9YGu1CXzhXcznSa/H8RCp1Enw2zt/4C/fSFesccM77 yG1BGRLa9fL07Ne3whkmv1QuDghYnavBx02velbDrm6ceM0RyE= Cc: kernel-janitors@vger.kernel.org, LKML Subject: [alsa-devel] [PATCH 3/4] ALSA: emux: Adjust four 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: Wed, 9 Aug 2017 09:22:42 +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 affected source code places. Signed-off-by: Markus Elfring --- sound/synth/emux/emux_seq.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sound/synth/emux/emux_seq.c b/sound/synth/emux/emux_seq.c index 12acf18c5be4..fd6cbd439511 100644 --- a/sound/synth/emux/emux_seq.c +++ b/sound/synth/emux/emux_seq.c @@ -99,7 +99,7 @@ snd_emux_init_seq(struct snd_emux *emu, struct snd_card *card, int index) sprintf(tmpname, "%s Port %d", emu->name, i); p = snd_emux_create_port(emu, tmpname, MIDI_CHANNELS, 0, &pinfo); - if (p == NULL) { + if (!p) { snd_printk(KERN_ERR "can't create port\n"); return -ENOMEM; } @@ -151,7 +151,7 @@ snd_emux_create_port(struct snd_emux *emu, char *name, } p->chset.channels = kcalloc(max_channels, sizeof(*p->chset.channels), GFP_KERNEL); - if (p->chset.channels == NULL) { + if (!p->chset.channels) { snd_printk(KERN_ERR "no memory\n"); kfree(p); return NULL; @@ -373,7 +373,7 @@ int snd_emux_init_virmidi(struct snd_emux *emu, struct snd_card *card) return 0; emu->vmidi = kcalloc(emu->midi_ports, sizeof(*emu->vmidi), GFP_KERNEL); - if (emu->vmidi == NULL) + if (!emu->vmidi) return -ENOMEM; for (i = 0; i < emu->midi_ports; i++) { @@ -405,7 +405,7 @@ int snd_emux_delete_virmidi(struct snd_emux *emu) { int i; - if (emu->vmidi == NULL) + if (!emu->vmidi) return 0; for (i = 0; i < emu->midi_ports; i++) {