Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1727317 > unrolled thread

[PATCH 2/3] ALSA: bebob: Adjust six checks for null pointers

Started bySF Markus Elfring <elfring@users.sourceforge.net>
First post2017-09-06 12:30 +0200
Last post2017-09-06 12:30 +0200
Articles 1 — 1 participant

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH 2/3] ALSA: bebob: Adjust six checks for null pointers SF Markus Elfring <elfring@users.sourceforge.net> - 2017-09-06 12:30 +0200

#1727317 — [PATCH 2/3] ALSA: bebob: Adjust six checks for null pointers

FromSF Markus Elfring <elfring@users.sourceforge.net>
Date2017-09-06 12:30 +0200
Subject[PATCH 2/3] ALSA: bebob: Adjust six checks for null pointers
Message-ID<umFKO-lj-3@gated-at.bofh.it>
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

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web