Skip to contentSkip to conversation

sgio2audio.c: clean up checking

PATCH Applied Figo.zhang 2 participants 2 messages Jun 7, 2009 Sound

lore
Share & tools
lore

Figo.zhang

author
#0 lore raw

PATCH 1/1 sgio2audio.c: clean up checking

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

---

 sound/mips/sgio2audio.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)
sound/mips/sgio2audio.c +1 -2
index 66f3b48..e497525 100644
@@ -619,8 +619,7 @@ 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;
 }
Applied
#1 lore raw

At Sun, 07 Jun 2009 13:37:27 +0800,

Quoted 5 lines · Figo.zhang

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

Thanks, applied now.

Takashi

Quoted 20 lines

---

 sound/mips/sgio2audio.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)
sound/mips/sgio2audio.c +1 -2
index 66f3b48..e497525 100644
@@ -619,8 +619,7 @@ 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;
 }