Figo.zhang | 7 Jun 07:37 2009
Picon

[PATCH]sgio2audio.c: clean up checking

vfree() does it's own 'NULL' check,so no need for check before
calling it.

Signed-off-by: Figo.zhang <figo1802 <at> gmail.com>
---  
 sound/mips/sgio2audio.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/sound/mips/sgio2audio.c b/sound/mips/sgio2audio.c
index 66f3b48..e497525 100644
--- a/sound/mips/sgio2audio.c
+++ b/sound/mips/sgio2audio.c
 <at>  <at>  -619,8 +619,7  <at>  <at>  static int snd_sgio2audio_pcm_hw_params(struct snd_pcm_substream *substream,
 /* hw_free callback */
 static int snd_sgio2audio_pcm_hw_free(struct snd_pcm_substream *substream)
 {
-	if (substream->runtime->dma_area)
-		vfree(substream->runtime->dma_area);
+	vfree(substream->runtime->dma_area);
 	substream->runtime->dma_area = NULL;
 	return 0;
 }

--
To unsubscribe from this list: send the line "unsubscribe linux-sound" in
the body of a message to majordomo <at> vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Takashi Iwai | 7 Jun 09:09 2009
Picon

Re: [PATCH]sgio2audio.c: clean up checking

At Sun, 07 Jun 2009 13:37:27 +0800,
Figo.zhang wrote:
> 
> vfree() does it's own 'NULL' check,so no need for check before
> calling it.
> 
> Signed-off-by: Figo.zhang <figo1802 <at> gmail.com>

Thanks, applied now.

Takashi

> ---  
>  sound/mips/sgio2audio.c |    3 +--
>  1 files changed, 1 insertions(+), 2 deletions(-)
> 
> diff --git a/sound/mips/sgio2audio.c b/sound/mips/sgio2audio.c
> index 66f3b48..e497525 100644
> --- a/sound/mips/sgio2audio.c
> +++ b/sound/mips/sgio2audio.c
>  <at>  <at>  -619,8 +619,7  <at>  <at>  static int snd_sgio2audio_pcm_hw_params(struct snd_pcm_substream *substream,
>  /* hw_free callback */
>  static int snd_sgio2audio_pcm_hw_free(struct snd_pcm_substream *substream)
>  {
> -	if (substream->runtime->dma_area)
> -		vfree(substream->runtime->dma_area);
> +	vfree(substream->runtime->dma_area);
>  	substream->runtime->dma_area = NULL;
>  	return 0;
>  }
(Continue reading)


Gmane