All of lore.kernel.org
 help / color / mirror / Atom feed
From: SF Markus Elfring <elfring@users.sourceforge.net>
To: alsa-devel@alsa-project.org,
	Arvind Yadav <arvind.yadav.cs@gmail.com>,
	Bhumika Goyal <bhumirks@gmail.com>,
	Jaroslav Kysela <perex@perex.cz>, Mark Brown <broonie@kernel.org>,
	Takashi Iwai <tiwai@suse.com>
Cc: LKML <linux-kernel@vger.kernel.org>, kernel-janitors@vger.kernel.org
Subject: [PATCH 3/3] ALSA: sgio2audio: Adjust two null pointer checks in snd_sgio2audio_create()
Date: Sat, 11 Nov 2017 20:23:31 +0100	[thread overview]
Message-ID: <249efc55-0688-6772-fc70-526a1bfa2603@users.sourceforge.net> (raw)
In-Reply-To: <eb375101-03bd-37bb-67ef-e261eeca206e@users.sourceforge.net>

From: Markus Elfring <elfring@users.sourceforge.net>
Date: Sat, 11 Nov 2017 20:10:22 +0100
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/mips/sgio2audio.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/sound/mips/sgio2audio.c b/sound/mips/sgio2audio.c
index 9e175a184b66..4027f0fc8db6 100644
--- a/sound/mips/sgio2audio.c
+++ b/sound/mips/sgio2audio.c
@@ -841,14 +841,14 @@ static int snd_sgio2audio_create(struct snd_card *card,
 		return -ENOENT;
 
 	chip = kzalloc(sizeof(*chip), GFP_KERNEL);
-	if (chip == NULL)
+	if (!chip)
 		return -ENOMEM;
 
 	chip->card = card;
 
 	chip->ring_base = dma_alloc_coherent(NULL, MACEISA_RINGBUFFERS_SIZE,
 					     &chip->ring_base_dma, GFP_USER);
-	if (chip->ring_base == NULL) {
+	if (!chip->ring_base) {
 		printk(KERN_ERR
 		       "sgio2audio: could not allocate ring buffers\n");
 		kfree(chip);
-- 
2.15.0

WARNING: multiple messages have this Message-ID (diff)
From: SF Markus Elfring <elfring@users.sourceforge.net>
To: alsa-devel@alsa-project.org,
	Arvind Yadav <arvind.yadav.cs@gmail.com>,
	Bhumika Goyal <bhumirks@gmail.com>,
	Jaroslav Kysela <perex@perex.cz>, Mark Brown <broonie@kernel.org>,
	Takashi Iwai <tiwai@suse.com>
Cc: kernel-janitors@vger.kernel.org, LKML <linux-kernel@vger.kernel.org>
Subject: [PATCH 3/3] ALSA: sgio2audio: Adjust two null pointer checks in snd_sgio2audio_create()
Date: Sat, 11 Nov 2017 19:23:31 +0000	[thread overview]
Message-ID: <249efc55-0688-6772-fc70-526a1bfa2603@users.sourceforge.net> (raw)
In-Reply-To: <eb375101-03bd-37bb-67ef-e261eeca206e@users.sourceforge.net>

From: Markus Elfring <elfring@users.sourceforge.net>
Date: Sat, 11 Nov 2017 20:10:22 +0100
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/mips/sgio2audio.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/sound/mips/sgio2audio.c b/sound/mips/sgio2audio.c
index 9e175a184b66..4027f0fc8db6 100644
--- a/sound/mips/sgio2audio.c
+++ b/sound/mips/sgio2audio.c
@@ -841,14 +841,14 @@ static int snd_sgio2audio_create(struct snd_card *card,
 		return -ENOENT;
 
 	chip = kzalloc(sizeof(*chip), GFP_KERNEL);
-	if (chip = NULL)
+	if (!chip)
 		return -ENOMEM;
 
 	chip->card = card;
 
 	chip->ring_base = dma_alloc_coherent(NULL, MACEISA_RINGBUFFERS_SIZE,
 					     &chip->ring_base_dma, GFP_USER);
-	if (chip->ring_base = NULL) {
+	if (!chip->ring_base) {
 		printk(KERN_ERR
 		       "sgio2audio: could not allocate ring buffers\n");
 		kfree(chip);
-- 
2.15.0


WARNING: multiple messages have this Message-ID (diff)
From: SF Markus Elfring <elfring@users.sourceforge.net>
To: alsa-devel@alsa-project.org,
	Arvind Yadav <arvind.yadav.cs@gmail.com>,
	Bhumika Goyal <bhumirks@gmail.com>,
	Jaroslav Kysela <perex@perex.cz>, Mark Brown <broonie@kernel.org>,
	Takashi Iwai <tiwai@suse.com>
Cc: kernel-janitors@vger.kernel.org, LKML <linux-kernel@vger.kernel.org>
Subject: [PATCH 3/3] ALSA: sgio2audio: Adjust two null pointer checks in snd_sgio2audio_create()
Date: Sat, 11 Nov 2017 20:23:31 +0100	[thread overview]
Message-ID: <249efc55-0688-6772-fc70-526a1bfa2603@users.sourceforge.net> (raw)
In-Reply-To: <eb375101-03bd-37bb-67ef-e261eeca206e@users.sourceforge.net>

From: Markus Elfring <elfring@users.sourceforge.net>
Date: Sat, 11 Nov 2017 20:10:22 +0100
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/mips/sgio2audio.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/sound/mips/sgio2audio.c b/sound/mips/sgio2audio.c
index 9e175a184b66..4027f0fc8db6 100644
--- a/sound/mips/sgio2audio.c
+++ b/sound/mips/sgio2audio.c
@@ -841,14 +841,14 @@ static int snd_sgio2audio_create(struct snd_card *card,
 		return -ENOENT;
 
 	chip = kzalloc(sizeof(*chip), GFP_KERNEL);
-	if (chip == NULL)
+	if (!chip)
 		return -ENOMEM;
 
 	chip->card = card;
 
 	chip->ring_base = dma_alloc_coherent(NULL, MACEISA_RINGBUFFERS_SIZE,
 					     &chip->ring_base_dma, GFP_USER);
-	if (chip->ring_base == NULL) {
+	if (!chip->ring_base) {
 		printk(KERN_ERR
 		       "sgio2audio: could not allocate ring buffers\n");
 		kfree(chip);
-- 
2.15.0

_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

  parent reply	other threads:[~2017-11-11 19:24 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-11 19:20 [PATCH 0/3] ALSA: sgio2audio: Fine-tuning for two function implementations SF Markus Elfring
2017-11-11 19:20 ` SF Markus Elfring
2017-11-11 19:20 ` SF Markus Elfring
2017-11-11 19:21 ` [PATCH 1/3] ALSA: sgio2audio: Use common error handling code in two functions SF Markus Elfring
2017-11-11 19:21   ` SF Markus Elfring
2017-11-11 19:21   ` SF Markus Elfring
2017-11-11 19:22 ` [PATCH 2/3] ALSA: sgio2audio: Improve a size determination in snd_sgio2audio_create() SF Markus Elfring
2017-11-11 19:22   ` SF Markus Elfring
2017-11-11 19:22   ` SF Markus Elfring
2017-11-28  6:50   ` Takashi Iwai
2017-11-28  6:50     ` Takashi Iwai
2017-11-28  6:50     ` Takashi Iwai
2017-11-11 19:23 ` SF Markus Elfring [this message]
2017-11-11 19:23   ` [PATCH 3/3] ALSA: sgio2audio: Adjust two null pointer checks " SF Markus Elfring
2017-11-11 19:23   ` SF Markus Elfring

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=249efc55-0688-6772-fc70-526a1bfa2603@users.sourceforge.net \
    --to=elfring@users.sourceforge.net \
    --cc=alsa-devel@alsa-project.org \
    --cc=arvind.yadav.cs@gmail.com \
    --cc=bhumirks@gmail.com \
    --cc=broonie@kernel.org \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=perex@perex.cz \
    --cc=tiwai@suse.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.