public inbox for kernel-janitors@vger.kernel.org
 help / color / mirror / Atom feed
* [patch] sound: oss: uart401: remove unneeded NULL check
@ 2014-11-22 18:29 Dan Carpenter
  2014-11-22 20:49 ` Takashi Iwai
  0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2014-11-22 18:29 UTC (permalink / raw)
  To: Jaroslav Kysela
  Cc: Takashi Iwai, Himangi Saraogi, alsa-devel, kernel-janitors

"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]);
 }

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [patch] sound: oss: uart401: remove unneeded NULL check
  2014-11-22 18:29 [patch] sound: oss: uart401: remove unneeded NULL check Dan Carpenter
@ 2014-11-22 20:49 ` Takashi Iwai
  0 siblings, 0 replies; 2+ messages in thread
From: Takashi Iwai @ 2014-11-22 20:49 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: Jaroslav Kysela, Himangi Saraogi, alsa-devel, kernel-janitors

At Sat, 22 Nov 2014 21:29:01 +0300,
Dan Carpenter wrote:
> 
> "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>

Thanks, applied.


Takashi

> 
> 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]);
>  }
> 

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-11-22 20:49 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-11-22 18:29 [patch] sound: oss: uart401: remove unneeded NULL check Dan Carpenter
2014-11-22 20:49 ` Takashi Iwai

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox