From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752722AbdIFKYH (ORCPT ); Wed, 6 Sep 2017 06:24:07 -0400 Received: from mout.web.de ([212.227.15.3]:58031 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752485AbdIFKYD (ORCPT ); Wed, 6 Sep 2017 06:24:03 -0400 Subject: [PATCH 2/3] ALSA: bebob: Adjust six checks for null pointers From: SF Markus Elfring To: alsa-devel@alsa-project.org, Clemens Ladisch , Jaroslav Kysela , Takashi Iwai Cc: LKML , kernel-janitors@vger.kernel.org References: <85f95150-9cec-7a53-7692-837ba543e1ec@users.sourceforge.net> Message-ID: <3ef7ccac-9bab-4030-da89-92f5c488e8bf@users.sourceforge.net> Date: Wed, 6 Sep 2017 12:23:22 +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: <85f95150-9cec-7a53-7692-837ba543e1ec@users.sourceforge.net> Content-Type: text/plain; charset=utf-8 Content-Language: en-GB Content-Transfer-Encoding: 8bit X-Provags-ID: V03:K0:Xx1qnybK+nB2U4I7UEMlGweMkqxuUvUgbzISxTqKFND0c784GKU S6WVTQN4RokDeKJ5Is129XTdlPgoi0mQGQl2b9hNA9UiGI5Xjuca6vbKzMbS2KzvyrLJPxJ Pa45mOM2qriFKS0iB48BV6oyBtOUsf2c+J1gbFdSQ6K8IAqN8Rj9Z6SUlPEVBn7xq5IbSar vjyRiLGUXFLHiK99RvO2w== X-UI-Out-Filterresults: notjunk:1;V01:K0:pz+jbfMNoQk=:05wNFXVTABJpE45XfD4EJ2 fAW9gQrAofZwzhgNyAXLUC6HFOL9sUgMojXyT6WN8AuW/NLbD6ayAGtGsYN/8F0abnrAymBsQ UJEFe275AXRkT480609ZaceYPxReULpeB+EXIVIlpfmb2nxxCSFXsLbaoJdwXtSGZrfmIxKfh qg3CORRo8+/OxjYGcu6b+no9Iirtl5HMKddQA4eCpAZRWhVuaz1zMfHbr18IwH9fR51lJdlnE ibdwj18hrp6OQNGsQsHEmgQRWI39Q3SkqmqfRqjLIKShfwutW4kVr5O62lyCdvl0m9XUV4ZDz VGbniymf46QGpBUN9nagT8zroirE6kwii0lt8OiA2qo2ZAbP8Uk7L9+HxBND0ESbNQGFiUjzk Gp4VU/Pphntu9ZIiCMFjrEMNRU5O5KjSvH5ur0jAdDYw5nD7YUgYrHMYf1/0x31Mj0hI5E5Mk KzfnkVNt7/pD8Oi9bcMhF0Jf4xm9HvMwuKj3mlCNUx5VlpZXMTTv0a7t0q5oWB5x4wZoG5rPd woy493oxTCJc5Bi8L/MkDvMS/Tdp+tvHJvrzZ4tWtypgb7DpFSHt/Y5KyNoGoMur2MDVRwdLr 6zSb9NpiEdIrmbK3pwK83lJd32GfJXHUEc4Pp96+P/qzLm8C4gJPomtOWNcJyHrWO2DrBgEcz Fkts8UcrXf069ISdv618m/aCAAEkdR4nLbaL+afp31OU8ZZ+4llbVwZHEIK9dUS9GRptSRBMS 3UPqN70F4uvjGdDl3Of8WhhB7xmPymtqxXZVAoGyNLeX000yonwYCjpHZW2gKh+FUfZLPDbi0 0hNU6ZBrauNgnv2GS2FSxLPx6XjKlGLvT8dj/e1kPlxhZ+m1Yg= Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Markus Elfring Date: Wed, 6 Sep 2017 11:48:44 +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/firewire/bebob/bebob_stream.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/sound/firewire/bebob/bebob_stream.c b/sound/firewire/bebob/bebob_stream.c index bc9e42b6368e..211ff43207d6 100644 --- a/sound/firewire/bebob/bebob_stream.c +++ b/sound/firewire/bebob/bebob_stream.c @@ -268,7 +268,7 @@ map_data_channels(struct snd_bebob *bebob, struct amdtp_stream *s) * use the maximum length of FCP. */ buf = kzalloc(256, GFP_KERNEL); - if (buf == NULL) + if (!buf) return -ENOMEM; if (s == &bebob->tx_stream) @@ -472,7 +472,7 @@ break_both_connections(struct snd_bebob *bebob) bebob->connected = false; /* These models seems to be in transition state for a longer time. */ - if (bebob->maudio_special_quirk != NULL) + if (bebob->maudio_special_quirk) msleep(200); } @@ -496,7 +496,7 @@ start_stream(struct snd_bebob *bebob, struct amdtp_stream *stream, conn = &bebob->out_conn; /* channel mapping */ - if (bebob->maudio_special_quirk == NULL) { + if (!bebob->maudio_special_quirk) { err = map_data_channels(bebob, stream); if (err < 0) goto end; @@ -611,7 +611,7 @@ int snd_bebob_stream_start_duplex(struct snd_bebob *bebob, unsigned int rate) * * For firmware customized by M-Audio, refer to next NOTE. */ - if (bebob->maudio_special_quirk == NULL) { + if (!bebob->maudio_special_quirk) { err = rate_spec->set(bebob, rate); if (err < 0) { dev_err(&bebob->unit->device, @@ -637,7 +637,7 @@ int snd_bebob_stream_start_duplex(struct snd_bebob *bebob, unsigned int rate) * The firmware customized by M-Audio uses these commands to * start transmitting stream. This is not usual way. */ - if (bebob->maudio_special_quirk != NULL) { + if (bebob->maudio_special_quirk) { err = rate_spec->set(bebob, rate); if (err < 0) { dev_err(&bebob->unit->device, @@ -794,7 +794,7 @@ fill_stream_formations(struct snd_bebob *bebob, enum avc_bridgeco_plug_dir dir, int err; buf = kmalloc(FORMAT_MAXIMUM_LENGTH, GFP_KERNEL); - if (buf == NULL) + if (!buf) return -ENOMEM; if (dir == AVC_BRIDGECO_PLUG_DIR_IN) -- 2.14.1