All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: Jaroslav Kysela <perex@perex.cz>
Cc: Takashi Iwai <tiwai@suse.de>,
	Himangi Saraogi <himangi774@gmail.com>,
	alsa-devel@alsa-project.org, kernel-janitors@vger.kernel.org
Subject: [patch] sound: oss: uart401: remove unneeded NULL check
Date: Sat, 22 Nov 2014 21:29:01 +0300	[thread overview]
Message-ID: <20141122182901.GA6994@mwanda> (raw)

"devc" can't be NULL here so there is no need to check.  Also I removed
the "devc = NULL" assignment because devc is stored on stack so it's
a no-op.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

diff --git a/sound/oss/uart401.c b/sound/oss/uart401.c
index 279bc56..dae4d43 100644
--- a/sound/oss/uart401.c
+++ b/sound/oss/uart401.c
@@ -412,13 +412,10 @@ void unload_uart401(struct address_info *hw_config)
 
 	if (!devc->share_irq)
 		free_irq(devc->irq, devc);
-	if (devc)
-	{
-		kfree(midi_devs[devc->my_dev]->converter);
-		kfree(midi_devs[devc->my_dev]);
-		kfree(devc);
-		devc = NULL;
-	}
+	kfree(midi_devs[devc->my_dev]->converter);
+	kfree(midi_devs[devc->my_dev]);
+	kfree(devc);
+
 	/* This kills midi_devs[x] */
 	sound_unload_mididev(hw_config->slots[4]);
 }

WARNING: multiple messages have this Message-ID (diff)
From: Dan Carpenter <dan.carpenter@oracle.com>
To: Jaroslav Kysela <perex@perex.cz>
Cc: Takashi Iwai <tiwai@suse.de>,
	Himangi Saraogi <himangi774@gmail.com>,
	alsa-devel@alsa-project.org, kernel-janitors@vger.kernel.org
Subject: [patch] sound: oss: uart401: remove unneeded NULL check
Date: Sat, 22 Nov 2014 18:29:01 +0000	[thread overview]
Message-ID: <20141122182901.GA6994@mwanda> (raw)

"devc" can't be NULL here so there is no need to check.  Also I removed
the "devc = NULL" assignment because devc is stored on stack so it's
a no-op.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

diff --git a/sound/oss/uart401.c b/sound/oss/uart401.c
index 279bc56..dae4d43 100644
--- a/sound/oss/uart401.c
+++ b/sound/oss/uart401.c
@@ -412,13 +412,10 @@ void unload_uart401(struct address_info *hw_config)
 
 	if (!devc->share_irq)
 		free_irq(devc->irq, devc);
-	if (devc)
-	{
-		kfree(midi_devs[devc->my_dev]->converter);
-		kfree(midi_devs[devc->my_dev]);
-		kfree(devc);
-		devc = NULL;
-	}
+	kfree(midi_devs[devc->my_dev]->converter);
+	kfree(midi_devs[devc->my_dev]);
+	kfree(devc);
+
 	/* This kills midi_devs[x] */
 	sound_unload_mididev(hw_config->slots[4]);
 }

             reply	other threads:[~2014-11-22 18:29 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-22 18:29 Dan Carpenter [this message]
2014-11-22 18:29 ` [patch] sound: oss: uart401: remove unneeded NULL check Dan Carpenter
2014-11-22 20:49 ` Takashi Iwai
2014-11-22 20:49   ` Takashi Iwai

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=20141122182901.GA6994@mwanda \
    --to=dan.carpenter@oracle.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=himangi774@gmail.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=perex@perex.cz \
    --cc=tiwai@suse.de \
    /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.