lkml.org 
[lkml]   [2017]   [Sep]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Subject[PATCH 2/3] ALSA: bebob: Adjust six checks for null pointers
From
Date
From: Markus Elfring <elfring@users.sourceforge.net>
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 <elfring@users.sourceforge.net>
---
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
\
 
 \ /
  Last update: 2017-09-06 12:24    [W:0.658 / U:0.092 seconds]
©2003-2017 Jasper Spaans. hosted at Digital OceanAdvertise on this site