qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PULL 0/1] audio: Drop superfluous conditionals around g_free()
@ 2014-06-13 11:16 Gerd Hoffmann
  2014-06-13 11:16 ` [Qemu-devel] [PULL 1/1] " Gerd Hoffmann
  2014-06-13 13:15 ` [Qemu-devel] [PULL 0/1] " Peter Maydell
  0 siblings, 2 replies; 3+ messages in thread
From: Gerd Hoffmann @ 2014-06-13 11:16 UTC (permalink / raw)
  To: qemu-devel; +Cc: Gerd Hoffmann

  Hi,

Pretty short audio patch queue with a single cleanup.

please pull,
  Gerd

The following changes since commit 2a2c4830c0068d70443f3dddc4cc668f0c601b5c:

  Merge remote-tracking branch 'remotes/kraxel/tags/pull-gtk-20140611-1' into staging (2014-06-12 09:51:41 +0100)

are available in the git repository at:


  git://git.kraxel.org/qemu tags/pull-audio-20140613-1

for you to fetch changes up to fb7da626c0d178d687f439af2e19401f34bc901e:

  audio: Drop superfluous conditionals around g_free() (2014-06-13 12:34:54 +0200)

----------------------------------------------------------------
audio: Drop superfluous conditionals around g_free()

----------------------------------------------------------------
Markus Armbruster (1):
      audio: Drop superfluous conditionals around g_free()

 audio/alsaaudio.c      | 12 ++++--------
 audio/audio_template.h | 15 ++++-----------
 audio/ossaudio.c       |  6 ++----
 hw/audio/adlib.c       |  4 +---
 4 files changed, 11 insertions(+), 26 deletions(-)

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

* [Qemu-devel] [PULL 1/1] audio: Drop superfluous conditionals around g_free()
  2014-06-13 11:16 [Qemu-devel] [PULL 0/1] audio: Drop superfluous conditionals around g_free() Gerd Hoffmann
@ 2014-06-13 11:16 ` Gerd Hoffmann
  2014-06-13 13:15 ` [Qemu-devel] [PULL 0/1] " Peter Maydell
  1 sibling, 0 replies; 3+ messages in thread
From: Gerd Hoffmann @ 2014-06-13 11:16 UTC (permalink / raw)
  To: qemu-devel; +Cc: Vassili Karpov (malc), Markus Armbruster, Gerd Hoffmann

From: Markus Armbruster <armbru@redhat.com>

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
 audio/alsaaudio.c      | 12 ++++--------
 audio/audio_template.h | 15 ++++-----------
 audio/ossaudio.c       |  6 ++----
 hw/audio/adlib.c       |  4 +---
 4 files changed, 11 insertions(+), 26 deletions(-)

diff --git a/audio/alsaaudio.c b/audio/alsaaudio.c
index e4e5442..74ead97 100644
--- a/audio/alsaaudio.c
+++ b/audio/alsaaudio.c
@@ -815,10 +815,8 @@ static void alsa_fini_out (HWVoiceOut *hw)
     ldebug ("alsa_fini\n");
     alsa_anal_close (&alsa->handle, &alsa->pollhlp);
 
-    if (alsa->pcm_buf) {
-        g_free (alsa->pcm_buf);
-        alsa->pcm_buf = NULL;
-    }
+    g_free(alsa->pcm_buf);
+    alsa->pcm_buf = NULL;
 }
 
 static int alsa_init_out (HWVoiceOut *hw, struct audsettings *as)
@@ -978,10 +976,8 @@ static void alsa_fini_in (HWVoiceIn *hw)
 
     alsa_anal_close (&alsa->handle, &alsa->pollhlp);
 
-    if (alsa->pcm_buf) {
-        g_free (alsa->pcm_buf);
-        alsa->pcm_buf = NULL;
-    }
+    g_free(alsa->pcm_buf);
+    alsa->pcm_buf = NULL;
 }
 
 static int alsa_run_in (HWVoiceIn *hw)
diff --git a/audio/audio_template.h b/audio/audio_template.h
index 16f7880..8173188 100644
--- a/audio/audio_template.h
+++ b/audio/audio_template.h
@@ -71,10 +71,7 @@ static void glue (audio_init_nb_voices_, TYPE) (struct audio_driver *drv)
 
 static void glue (audio_pcm_hw_free_resources_, TYPE) (HW *hw)
 {
-    if (HWBUF) {
-        g_free (HWBUF);
-    }
-
+    g_free (HWBUF);
     HWBUF = NULL;
 }
 
@@ -92,9 +89,7 @@ static int glue (audio_pcm_hw_alloc_resources_, TYPE) (HW *hw)
 
 static void glue (audio_pcm_sw_free_resources_, TYPE) (SW *sw)
 {
-    if (sw->buf) {
-        g_free (sw->buf);
-    }
+    g_free (sw->buf);
 
     if (sw->rate) {
         st_rate_stop (sw->rate);
@@ -172,10 +167,8 @@ static int glue (audio_pcm_sw_init_, TYPE) (
 static void glue (audio_pcm_sw_fini_, TYPE) (SW *sw)
 {
     glue (audio_pcm_sw_free_resources_, TYPE) (sw);
-    if (sw->name) {
-        g_free (sw->name);
-        sw->name = NULL;
-    }
+    g_free (sw->name);
+    sw->name = NULL;
 }
 
 static void glue (audio_pcm_hw_add_sw_, TYPE) (HW *hw, SW *sw)
diff --git a/audio/ossaudio.c b/audio/ossaudio.c
index 5a73716..4db2ca6 100644
--- a/audio/ossaudio.c
+++ b/audio/ossaudio.c
@@ -736,10 +736,8 @@ static void oss_fini_in (HWVoiceIn *hw)
 
     oss_anal_close (&oss->fd);
 
-    if (oss->pcm_buf) {
-        g_free (oss->pcm_buf);
-        oss->pcm_buf = NULL;
-    }
+    g_free(oss->pcm_buf);
+    oss->pcm_buf = NULL;
 }
 
 static int oss_run_in (HWVoiceIn *hw)
diff --git a/hw/audio/adlib.c b/hw/audio/adlib.c
index 5dd739e..656eb37 100644
--- a/hw/audio/adlib.c
+++ b/hw/audio/adlib.c
@@ -275,9 +275,7 @@ static void Adlib_fini (AdlibState *s)
     }
 #endif
 
-    if (s->mixbuf) {
-        g_free (s->mixbuf);
-    }
+    g_free(s->mixbuf);
 
     s->active = 0;
     s->enabled = 0;
-- 
1.8.3.1

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

* Re: [Qemu-devel] [PULL 0/1] audio: Drop superfluous conditionals around g_free()
  2014-06-13 11:16 [Qemu-devel] [PULL 0/1] audio: Drop superfluous conditionals around g_free() Gerd Hoffmann
  2014-06-13 11:16 ` [Qemu-devel] [PULL 1/1] " Gerd Hoffmann
@ 2014-06-13 13:15 ` Peter Maydell
  1 sibling, 0 replies; 3+ messages in thread
From: Peter Maydell @ 2014-06-13 13:15 UTC (permalink / raw)
  To: Gerd Hoffmann; +Cc: QEMU Developers

On 13 June 2014 12:16, Gerd Hoffmann <kraxel@redhat.com> wrote:
>   Hi,
>
> Pretty short audio patch queue with a single cleanup.
>
> please pull,
>   Gerd
>
> The following changes since commit 2a2c4830c0068d70443f3dddc4cc668f0c601b5c:
>
>   Merge remote-tracking branch 'remotes/kraxel/tags/pull-gtk-20140611-1' into staging (2014-06-12 09:51:41 +0100)
>
> are available in the git repository at:
>
>
>   git://git.kraxel.org/qemu tags/pull-audio-20140613-1
>
> for you to fetch changes up to fb7da626c0d178d687f439af2e19401f34bc901e:
>
>   audio: Drop superfluous conditionals around g_free() (2014-06-13 12:34:54 +0200)
>
> ----------------------------------------------------------------
> audio: Drop superfluous conditionals around g_free()
>
> ----------------------------------------------------------------


Applied, thanks.

-- PMM

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

end of thread, other threads:[~2014-06-13 13:16 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-06-13 11:16 [Qemu-devel] [PULL 0/1] audio: Drop superfluous conditionals around g_free() Gerd Hoffmann
2014-06-13 11:16 ` [Qemu-devel] [PULL 1/1] " Gerd Hoffmann
2014-06-13 13:15 ` [Qemu-devel] [PULL 0/1] " Peter Maydell

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