linux-kernel.vger.kernel.org archive mirror
 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>, Takashi Iwai <tiwai@suse.com>
Cc: LKML <linux-kernel@vger.kernel.org>, kernel-janitors@vger.kernel.org
Subject: [PATCH 3/3] ALSA: ml403-ac97cr: Adjust four checks for null pointers
Date: Sat, 11 Nov 2017 14:19:28 +0100	[thread overview]
Message-ID: <71f0710a-c884-4b3e-7e8e-6033a9142e3e@users.sourceforge.net> (raw)
In-Reply-To: <4c38a970-2407-3559-060d-501b8259b3fc@users.sourceforge.net>

From: Markus Elfring <elfring@users.sourceforge.net>
Date: Sat, 11 Nov 2017 14:04:04 +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/drivers/ml403-ac97cr.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/sound/drivers/ml403-ac97cr.c b/sound/drivers/ml403-ac97cr.c
index 4cf964ea2802..d897175a63b2 100644
--- a/sound/drivers/ml403-ac97cr.c
+++ b/sound/drivers/ml403-ac97cr.c
@@ -533,7 +533,7 @@ snd_ml403_ac97cr_pcm_pointer(struct snd_pcm_substream *substream)
 	if (substream == ml403_ac97cr->capture_substream)
 		ind2_rec = &ml403_ac97cr->capture_ind2_rec;
 
-	if (ind2_rec != NULL)
+	if (ind2_rec)
 		return snd_pcm_indirect2_pointer(substream, ind2_rec);
 	return (snd_pcm_uframes_t) 0;
 }
@@ -788,7 +788,7 @@ static irqreturn_t snd_ml403_ac97cr_irq(int irq, void *dev_id)
 	int cmp_irq;
 
 	ml403_ac97cr = (struct snd_ml403_ac97cr *)dev_id;
-	if (ml403_ac97cr == NULL)
+	if (!ml403_ac97cr)
 		return IRQ_NONE;
 
 	pfdev = ml403_ac97cr->pfdev;
@@ -1120,7 +1120,7 @@ snd_ml403_ac97cr_create(struct snd_card *card, struct platform_device *pfdev,
 
 	*rml403_ac97cr = NULL;
 	ml403_ac97cr = kzalloc(sizeof(*ml403_ac97cr), GFP_KERNEL);
-	if (ml403_ac97cr == NULL)
+	if (!ml403_ac97cr)
 		return -ENOMEM;
 	spin_lock_init(&ml403_ac97cr->reg_lock);
 	mutex_init(&ml403_ac97cr->cdc_mutex);
@@ -1139,7 +1139,7 @@ snd_ml403_ac97cr_create(struct snd_card *card, struct platform_device *pfdev,
 	ml403_ac97cr->port = ioremap_nocache(resource->start,
 					     (resource->end) -
 					     (resource->start) + 1);
-	if (ml403_ac97cr->port == NULL) {
+	if (!ml403_ac97cr->port) {
 		snd_printk(KERN_ERR SND_ML403_AC97CR_DRIVER ": "
 			   "unable to remap memory region (%pR)\n",
 			   resource);
-- 
2.15.0

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

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-11 13:16 [PATCH 0/3] ALSA: ml403-ac97cr: Fine-tuning for five function implementations SF Markus Elfring
2017-11-11 13:17 ` [PATCH 1/3] ALSA: ml403-ac97cr: Use common error handling code in two functions SF Markus Elfring
2017-11-11 13:18 ` [PATCH 2/3] ALSA: ml403-ac97cr: Delete an unnecessary return statement in snd_ml403_ac97cr_codec_write() SF Markus Elfring
2017-11-11 13:19 ` SF Markus Elfring [this message]

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=71f0710a-c884-4b3e-7e8e-6033a9142e3e@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=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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).