alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 23/26] ALSA: riptide: remove redundant NULL test before release_firmware()
       [not found] <alpine.LNX.2.00.1204092157340.13925@swampdragon.chaosbits.net>
@ 2012-04-09 20:52 ` Jesper Juhl
  2012-04-10  6:45   ` Takashi Iwai
  2012-04-09 20:52 ` [PATCH 24/26] ASoC: wm8994: Don't test for NULL " Jesper Juhl
  1 sibling, 1 reply; 4+ messages in thread
From: Jesper Juhl @ 2012-04-09 20:52 UTC (permalink / raw)
  To: linux-kernel
  Cc: alsa-devel, trivial, Takashi Iwai, Rusty Russell, Clemens Ladisch,
	Paul Gortmaker

release_firmware() deals gracefully with NULL pointers, no need to check first.

Signed-off-by: Jesper Juhl <jj@chaosbits.net>
---
 sound/pci/riptide/riptide.c |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/sound/pci/riptide/riptide.c b/sound/pci/riptide/riptide.c
index 0481d94..cbeb3f7 100644
--- a/sound/pci/riptide/riptide.c
+++ b/sound/pci/riptide/riptide.c
@@ -1837,8 +1837,7 @@ static int snd_riptide_free(struct snd_riptide *chip)
 	}
 	if (chip->irq >= 0)
 		free_irq(chip->irq, chip);
-	if (chip->fw_entry)
-		release_firmware(chip->fw_entry);
+	release_firmware(chip->fw_entry);
 	release_and_free_resource(chip->res_port);
 	kfree(chip);
 	return 0;
-- 
1.7.10


-- 
Jesper Juhl <jj@chaosbits.net>       http://www.chaosbits.net/
Don't top-post http://www.catb.org/jargon/html/T/top-post.html
Plain text mails only, please.

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

* [PATCH 24/26] ASoC: wm8994: Don't test for NULL before release_firmware()
       [not found] <alpine.LNX.2.00.1204092157340.13925@swampdragon.chaosbits.net>
  2012-04-09 20:52 ` [PATCH 23/26] ALSA: riptide: remove redundant NULL test before release_firmware() Jesper Juhl
@ 2012-04-09 20:52 ` Jesper Juhl
  2012-04-10 10:08   ` Mark Brown
  1 sibling, 1 reply; 4+ messages in thread
From: Jesper Juhl @ 2012-04-09 20:52 UTC (permalink / raw)
  To: linux-kernel
  Cc: Dimitris Papastamos, alsa-devel, trivial, Takashi Iwai,
	Mark Brown, Ian Lartey, Liam Girdwood

release_firmware() does its own NULL ptr testing, it's redundant to
also test before calling it.

Signed-off-by: Jesper Juhl <jj@chaosbits.net>
---
 sound/soc/codecs/wm8994.c |   12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)

diff --git a/sound/soc/codecs/wm8994.c b/sound/soc/codecs/wm8994.c
index 7c49642..cf7e5d2 100644
--- a/sound/soc/codecs/wm8994.c
+++ b/sound/soc/codecs/wm8994.c
@@ -3972,7 +3972,7 @@ err_irq:
 	return ret;
 }
 
-static int  wm8994_codec_remove(struct snd_soc_codec *codec)
+static int wm8994_codec_remove(struct snd_soc_codec *codec)
 {
 	struct wm8994_priv *wm8994 = snd_soc_codec_get_drvdata(codec);
 	struct wm8994 *control = wm8994->wm8994;
@@ -4013,14 +4013,10 @@ static int  wm8994_codec_remove(struct snd_soc_codec *codec)
 			free_irq(wm8994->micdet_irq, wm8994);
 		break;
 	}
-	if (wm8994->mbc)
-		release_firmware(wm8994->mbc);
-	if (wm8994->mbc_vss)
-		release_firmware(wm8994->mbc_vss);
-	if (wm8994->enh_eq)
-		release_firmware(wm8994->enh_eq);
+	release_firmware(wm8994->mbc);
+	release_firmware(wm8994->mbc_vss);
+	release_firmware(wm8994->enh_eq);
 	kfree(wm8994->retune_mobile_texts);
-
 	return 0;
 }
 
-- 
1.7.10


-- 
Jesper Juhl <jj@chaosbits.net>       http://www.chaosbits.net/
Don't top-post http://www.catb.org/jargon/html/T/top-post.html
Plain text mails only, please.

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

* Re: [PATCH 23/26] ALSA: riptide: remove redundant NULL test before release_firmware()
  2012-04-09 20:52 ` [PATCH 23/26] ALSA: riptide: remove redundant NULL test before release_firmware() Jesper Juhl
@ 2012-04-10  6:45   ` Takashi Iwai
  0 siblings, 0 replies; 4+ messages in thread
From: Takashi Iwai @ 2012-04-10  6:45 UTC (permalink / raw)
  To: Jesper Juhl
  Cc: alsa-devel, trivial, Rusty Russell, Clemens Ladisch, linux-kernel,
	Paul Gortmaker

At Mon, 9 Apr 2012 22:52:10 +0200 (CEST),
Jesper Juhl wrote:
> 
> release_firmware() deals gracefully with NULL pointers, no need to check first.
> 
> Signed-off-by: Jesper Juhl <jj@chaosbits.net>

Applied now.  Thanks.


Takashi

> ---
>  sound/pci/riptide/riptide.c |    3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/sound/pci/riptide/riptide.c b/sound/pci/riptide/riptide.c
> index 0481d94..cbeb3f7 100644
> --- a/sound/pci/riptide/riptide.c
> +++ b/sound/pci/riptide/riptide.c
> @@ -1837,8 +1837,7 @@ static int snd_riptide_free(struct snd_riptide *chip)
>  	}
>  	if (chip->irq >= 0)
>  		free_irq(chip->irq, chip);
> -	if (chip->fw_entry)
> -		release_firmware(chip->fw_entry);
> +	release_firmware(chip->fw_entry);
>  	release_and_free_resource(chip->res_port);
>  	kfree(chip);
>  	return 0;
> -- 
> 1.7.10
> 
> 
> -- 
> Jesper Juhl <jj@chaosbits.net>       http://www.chaosbits.net/
> Don't top-post http://www.catb.org/jargon/html/T/top-post.html
> Plain text mails only, please.
> 

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

* Re: [PATCH 24/26] ASoC: wm8994: Don't test for NULL before release_firmware()
  2012-04-09 20:52 ` [PATCH 24/26] ASoC: wm8994: Don't test for NULL " Jesper Juhl
@ 2012-04-10 10:08   ` Mark Brown
  0 siblings, 0 replies; 4+ messages in thread
From: Mark Brown @ 2012-04-10 10:08 UTC (permalink / raw)
  To: Jesper Juhl
  Cc: Dimitris Papastamos, alsa-devel, trivial, Takashi Iwai,
	linux-kernel, Ian Lartey, Liam Girdwood


[-- Attachment #1.1: Type: text/plain, Size: 180 bytes --]

On Mon, Apr 09, 2012 at 10:52:19PM +0200, Jesper Juhl wrote:
> release_firmware() does its own NULL ptr testing, it's redundant to
> also test before calling it.

Applied, thanks.

[-- Attachment #1.2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

[-- Attachment #2: Type: text/plain, Size: 0 bytes --]



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

end of thread, other threads:[~2012-04-10 10:08 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <alpine.LNX.2.00.1204092157340.13925@swampdragon.chaosbits.net>
2012-04-09 20:52 ` [PATCH 23/26] ALSA: riptide: remove redundant NULL test before release_firmware() Jesper Juhl
2012-04-10  6:45   ` Takashi Iwai
2012-04-09 20:52 ` [PATCH 24/26] ASoC: wm8994: Don't test for NULL " Jesper Juhl
2012-04-10 10:08   ` Mark Brown

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).