qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Philippe Mathieu-Daudé" <philmd@linaro.org>
To: qemu-devel@nongnu.org
Cc: "Gerd Hoffmann" <kraxel@redhat.com>,
	"Christian Schoenebeck" <qemu_oss@crudebyte.com>,
	"Marc-André Lureau" <marcandre.lureau@redhat.com>,
	"Thomas Huth" <huth@tuxfamily.org>,
	"Philippe Mathieu-Daudé" <philmd@linaro.org>
Subject: [PATCH v2 43/42] audio: Remove pointless local variables
Date: Wed, 22 Oct 2025 09:53:51 +0200	[thread overview]
Message-ID: <20251022075352.66756-1-philmd@linaro.org> (raw)
In-Reply-To: <20251022065640.1172785-1-marcandre.lureau@redhat.com>

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
 audio/ossaudio.c | 12 ++----------
 audio/sdlaudio.c | 12 ++----------
 2 files changed, 4 insertions(+), 20 deletions(-)

diff --git a/audio/ossaudio.c b/audio/ossaudio.c
index ab8791bece9..86c4805675e 100644
--- a/audio/ossaudio.c
+++ b/audio/ossaudio.c
@@ -493,10 +493,8 @@ static int oss_init_out(HWVoiceOut *hw, struct audsettings *as,
 {
     OSSVoiceOut *oss = (OSSVoiceOut *) hw;
     struct oss_params req, obt;
-    int endianness;
     int err;
     int fd;
-    AudioFormat effective_fmt;
     struct audsettings obt_as;
     Audiodev *dev = drv_opaque;
     AudiodevOssOptions *oopts = &dev->u.oss;
@@ -511,7 +509,7 @@ static int oss_init_out(HWVoiceOut *hw, struct audsettings *as,
         return -1;
     }
 
-    err = oss_to_audfmt (obt.fmt, &effective_fmt, &endianness);
+    err = oss_to_audfmt(obt.fmt, &obt_as.fmt, &obt_as.endianness);
     if (err) {
         oss_anal_close (&fd);
         return -1;
@@ -519,8 +517,6 @@ static int oss_init_out(HWVoiceOut *hw, struct audsettings *as,
 
     obt_as.freq = obt.freq;
     obt_as.nchannels = obt.nchannels;
-    obt_as.fmt = effective_fmt;
-    obt_as.endianness = endianness;
 
     audio_pcm_init_info (&hw->info, &obt_as);
     oss->nfrags = obt.nfrags;
@@ -628,10 +624,8 @@ static int oss_init_in(HWVoiceIn *hw, struct audsettings *as, void *drv_opaque)
 {
     OSSVoiceIn *oss = (OSSVoiceIn *) hw;
     struct oss_params req, obt;
-    int endianness;
     int err;
     int fd;
-    AudioFormat effective_fmt;
     struct audsettings obt_as;
     Audiodev *dev = drv_opaque;
 
@@ -644,7 +638,7 @@ static int oss_init_in(HWVoiceIn *hw, struct audsettings *as, void *drv_opaque)
         return -1;
     }
 
-    err = oss_to_audfmt (obt.fmt, &effective_fmt, &endianness);
+    err = oss_to_audfmt(obt.fmt, &obt_as.fmt, &obt_as.endianness);
     if (err) {
         oss_anal_close (&fd);
         return -1;
@@ -652,8 +646,6 @@ static int oss_init_in(HWVoiceIn *hw, struct audsettings *as, void *drv_opaque)
 
     obt_as.freq = obt.freq;
     obt_as.nchannels = obt.nchannels;
-    obt_as.fmt = effective_fmt;
-    obt_as.endianness = endianness;
 
     audio_pcm_init_info (&hw->info, &obt_as);
     oss->nfrags = obt.nfrags;
diff --git a/audio/sdlaudio.c b/audio/sdlaudio.c
index a7a9652d29d..707110973ac 100644
--- a/audio/sdlaudio.c
+++ b/audio/sdlaudio.c
@@ -338,9 +338,7 @@ static int sdl_init_out(HWVoiceOut *hw, struct audsettings *as,
 {
     SDLVoiceOut *sdl = (SDLVoiceOut *)hw;
     SDL_AudioSpec req, obt;
-    int endianness;
     int err;
-    AudioFormat effective_fmt;
     Audiodev *dev = drv_opaque;
     AudiodevSdlPerDirectionOptions *spdo = dev->u.sdl.out;
     struct audsettings obt_as;
@@ -360,7 +358,7 @@ static int sdl_init_out(HWVoiceOut *hw, struct audsettings *as,
         return -1;
     }
 
-    err = sdl_to_audfmt(obt.format, &effective_fmt, &endianness);
+    err = sdl_to_audfmt(obt.format, &obt_as.fmt, &obt_as.endianness);
     if (err) {
         sdl_close_out(sdl);
         return -1;
@@ -368,8 +366,6 @@ static int sdl_init_out(HWVoiceOut *hw, struct audsettings *as,
 
     obt_as.freq = obt.freq;
     obt_as.nchannels = obt.channels;
-    obt_as.fmt = effective_fmt;
-    obt_as.endianness = endianness;
 
     audio_pcm_init_info (&hw->info, &obt_as);
     hw->samples = (spdo->has_buffer_count ? spdo->buffer_count : 4) *
@@ -398,9 +394,7 @@ static int sdl_init_in(HWVoiceIn *hw, audsettings *as, void *drv_opaque)
 {
     SDLVoiceIn *sdl = (SDLVoiceIn *)hw;
     SDL_AudioSpec req, obt;
-    int endianness;
     int err;
-    AudioFormat effective_fmt;
     Audiodev *dev = drv_opaque;
     AudiodevSdlPerDirectionOptions *spdo = dev->u.sdl.in;
     struct audsettings obt_as;
@@ -420,7 +414,7 @@ static int sdl_init_in(HWVoiceIn *hw, audsettings *as, void *drv_opaque)
         return -1;
     }
 
-    err = sdl_to_audfmt(obt.format, &effective_fmt, &endianness);
+    err = sdl_to_audfmt(obt.format, &obt_as.fmt, &obt_as.endianness);
     if (err) {
         sdl_close_in(sdl);
         return -1;
@@ -428,8 +422,6 @@ static int sdl_init_in(HWVoiceIn *hw, audsettings *as, void *drv_opaque)
 
     obt_as.freq = obt.freq;
     obt_as.nchannels = obt.channels;
-    obt_as.fmt = effective_fmt;
-    obt_as.endianness = endianness;
 
     audio_pcm_init_info(&hw->info, &obt_as);
     hw->samples = (spdo->has_buffer_count ? spdo->buffer_count : 4) *
-- 
2.51.0



  parent reply	other threads:[~2025-10-22  7:54 UTC|newest]

Thread overview: 54+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-22  6:55 [PATCH v2 00/42] Audio clean-ups marcandre.lureau
2025-10-22  6:55 ` [PATCH v2 01/42] hw/audio: improve error reports marcandre.lureau
2025-10-22  6:55 ` [PATCH v2 02/42] hw/audio: rename model list function marcandre.lureau
2025-10-22  6:55 ` [PATCH v2 03/42] hw/audio: remove global pcspk marcandre.lureau
2025-10-22  6:55 ` [PATCH v2 04/42] hw/pcspk: use explicitly the required PIT types marcandre.lureau
2025-10-22  6:56 ` [PATCH v2 05/42] hw/pcspk: make 'pit' a class property marcandre.lureau
2025-10-22  6:56 ` [PATCH v2 06/42] hw/pcspk: check the "pit" is set marcandre.lureau
2025-10-22  6:56 ` [PATCH v2 07/42] docs: update -soundhw -> -device list marcandre.lureau
2025-10-22  6:56 ` [PATCH v2 08/42] qdev: add qdev_find_default_bus() marcandre.lureau
2025-10-22  6:56 ` [PATCH v2 09/42] hw/audio: look up the default bus from the device class marcandre.lureau
2025-10-22  6:56 ` [PATCH v2 10/42] audio: rename audio_define->audio_add_audiodev() marcandre.lureau
2025-10-22  6:56 ` [PATCH v2 11/42] hw/audio: use better naming for -audio model handling code marcandre.lureau
2025-10-22  8:04   ` Philippe Mathieu-Daudé
2025-10-22  6:56 ` [PATCH v2 12/42] hw/audio/virtio-snd-pci: remove custom model callback marcandre.lureau
2025-10-22  6:56 ` [PATCH v2 13/42] hw/audio: simplify 'hda' audio init code marcandre.lureau
2025-10-22 11:41   ` BALATON Zoltan
2025-10-22 11:49     ` Marc-André Lureau
2025-10-22  6:56 ` [PATCH v2 14/42] hw/audio: generalize audio_model.init() marcandre.lureau
2025-10-22  6:56 ` [PATCH v2 15/42] hw/audio: drop audio_model.isa marcandre.lureau
2025-10-22  6:56 ` [PATCH v2 16/42] audio: start making AudioState a QOM Object marcandre.lureau
2025-10-22  6:56 ` [PATCH v2 17/42] audio: register backends in /audiodevs container marcandre.lureau
2025-10-22  6:56 ` [PATCH v2 18/42] audio: use /audiodevs QOM container marcandre.lureau
2025-10-22  6:56 ` [PATCH v2 19/42] audio/paaudio: remove needless return value marcandre.lureau
2025-10-22  6:56 ` [PATCH v2 20/42] audio/dsound: simplify init() marcandre.lureau
2025-10-22  6:56 ` [PATCH v2 21/42] audio/dsound: report init error via **errp marcandre.lureau
2025-10-22  6:56 ` [PATCH v2 22/42] audio: simplify audio_driver_init() marcandre.lureau
2025-10-22  6:56 ` [PATCH v2 23/42] audio: move period tick initialization marcandre.lureau
2025-10-22  6:56 ` [PATCH v2 24/42] audio: drop needless error message marcandre.lureau
2025-10-22  6:56 ` [PATCH v2 25/42] audio: clean-up vmstate change handler on finalize marcandre.lureau
2025-10-22  6:56 ` [PATCH v2 26/42] audio: unregister vmstate description marcandre.lureau
2025-10-22  6:56 ` [PATCH v2 27/42] audio: initialize card_head during object init marcandre.lureau
2025-10-22  6:56 ` [PATCH v2 28/42] audio: remove some needless headers marcandre.lureau
2025-10-22  6:56 ` [PATCH v2 29/42] audio: remove AUDIO_HOST_ENDIANNESS marcandre.lureau
2025-10-22  7:11   ` Philippe Mathieu-Daudé
2025-10-22  6:56 ` [PATCH v2 30/42] audio: introduce AUD_set_volume_{in,out}_lr() marcandre.lureau
2025-10-22  6:56 ` [PATCH v2 31/42] hw/audio: replace AUD_log() usage marcandre.lureau
2025-10-22  6:56 ` [PATCH v2 32/42] audio/replay: fix type punning marcandre.lureau
2025-10-22  6:56 ` [PATCH v2 33/42] audio: move internal APIs to audio_int.h marcandre.lureau
2025-10-22  7:08   ` Philippe Mathieu-Daudé
2025-10-22  6:56 ` [PATCH v2 34/42] audio: rename AudioState -> AudioBackend marcandre.lureau
2025-10-22  6:56 ` [PATCH v2 35/42] audio: remove QEMUSoundCard marcandre.lureau
2025-10-22  6:56 ` [PATCH v2 36/42] audio/dbus: use a helper function to set the backend dbus server marcandre.lureau
2025-10-22  6:56 ` [PATCH v2 37/42] audio: move audio.h under include/qemu/ marcandre.lureau
2025-10-22  6:56 ` [PATCH v2 38/42] audio: remove dependency on spice header marcandre.lureau
2025-10-22  6:56 ` [PATCH v2 39/42] audio: cleanup, use bool for booleans marcandre.lureau
2025-10-22  7:05   ` Philippe Mathieu-Daudé
2025-10-22 12:01   ` BALATON Zoltan
2025-10-22  6:56 ` [PATCH v2 40/42] audio: move capture API to own header marcandre.lureau
2025-10-22  6:56 ` [PATCH v2 41/42] audio: drop needless audio_driver "descr" field marcandre.lureau
2025-10-22  6:56 ` [PATCH v2 42/42] docs: Update mentions of removed '-soundhw' command line option marcandre.lureau
2025-10-22  7:53 ` Philippe Mathieu-Daudé [this message]
2025-10-22  7:56   ` [PATCH v2 43/42] audio: Remove pointless local variables Marc-André Lureau
2025-10-22  7:53 ` [PATCH v2 44/42] audio: Rename @endianness argument as @big_endian for clarity Philippe Mathieu-Daudé
2025-10-22  7:59   ` Marc-André Lureau

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20251022075352.66756-1-philmd@linaro.org \
    --to=philmd@linaro.org \
    --cc=huth@tuxfamily.org \
    --cc=kraxel@redhat.com \
    --cc=marcandre.lureau@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu_oss@crudebyte.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).