qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Philippe Mathieu-Daudé" <philmd@linaro.org>
To: marcandre.lureau@redhat.com, qemu-devel@nongnu.org
Cc: "Volker Rümelin" <vr_qemu@t-online.de>,
	"Paolo Bonzini" <pbonzini@redhat.com>,
	"BALATON Zoltan" <balaton@eik.bme.hu>,
	"Gerd Hoffmann" <kraxel@redhat.com>,
	"Laurent Vivier" <laurent@vivier.eu>
Subject: Re: [PATCH v2 29/42] audio: remove AUDIO_HOST_ENDIANNESS
Date: Wed, 22 Oct 2025 09:11:48 +0200	[thread overview]
Message-ID: <b14061db-3050-4a44-a351-46ae2ed0c30c@linaro.org> (raw)
In-Reply-To: <20251022065640.1172785-30-marcandre.lureau@redhat.com>

On 22/10/25 08:56, marcandre.lureau@redhat.com wrote:
> From: Marc-André Lureau <marcandre.lureau@redhat.com>
> 
> Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
> ---
>   audio/audio.h      | 6 ------
>   audio/audio.c      | 6 +++---
>   audio/spiceaudio.c | 4 ++--
>   hw/audio/adlib.c   | 2 +-
>   hw/audio/asc.c     | 2 +-
>   hw/audio/cs4231a.c | 2 +-
>   hw/audio/gus.c     | 2 +-
>   7 files changed, 9 insertions(+), 15 deletions(-)
> 
> diff --git a/audio/audio.h b/audio/audio.h
> index 3be0c4f24f..0af911fd9a 100644
> --- a/audio/audio.h
> +++ b/audio/audio.h
> @@ -31,12 +31,6 @@
>   
>   typedef void (*audio_callback_fn) (void *opaque, int avail);
>   
> -#if HOST_BIG_ENDIAN
> -#define AUDIO_HOST_ENDIANNESS 1
> -#else
> -#define AUDIO_HOST_ENDIANNESS 0
> -#endif
> -
>   typedef struct audsettings {
>       int freq;
>       int nchannels;
> diff --git a/audio/audio.c b/audio/audio.c
> index 0f3093ad59..284ea13289 100644
> --- a/audio/audio.c
> +++ b/audio/audio.c
> @@ -274,7 +274,7 @@ static int audio_pcm_info_eq (struct audio_pcm_info *info, struct audsettings *a
>           && info->is_signed == is_signed
>           && info->is_float == is_float
>           && info->bits == bits
> -        && info->swap_endianness == (as->endianness != AUDIO_HOST_ENDIANNESS);
> +        && info->swap_endianness == (as->endianness != HOST_BIG_ENDIAN);
>   }
>   
>   void audio_pcm_init_info (struct audio_pcm_info *info, struct audsettings *as)
> @@ -320,7 +320,7 @@ void audio_pcm_init_info (struct audio_pcm_info *info, struct audsettings *as)
>       info->nchannels = as->nchannels;
>       info->bytes_per_frame = as->nchannels * mul;
>       info->bytes_per_second = info->freq * info->bytes_per_frame;
> -    info->swap_endianness = (as->endianness != AUDIO_HOST_ENDIANNESS);
> +    info->swap_endianness = (as->endianness != HOST_BIG_ENDIAN);
>   }
>   
>   void audio_pcm_info_clear_buf (struct audio_pcm_info *info, void *buf, int len)
> @@ -2179,7 +2179,7 @@ audsettings audiodev_to_audsettings(AudiodevPerDirectionOptions *pdo)
>           .freq = pdo->frequency,
>           .nchannels = pdo->channels,
>           .fmt = pdo->format,
> -        .endianness = AUDIO_HOST_ENDIANNESS,
> +        .endianness = HOST_BIG_ENDIAN,
>       };
>   }

Nice. Even better would be to use QAPI EndianMode.

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>



  reply	other threads:[~2025-10-22  7:12 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é [this message]
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 ` [PATCH v2 43/42] audio: Remove pointless local variables Philippe Mathieu-Daudé
2025-10-22  7:56   ` 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=b14061db-3050-4a44-a351-46ae2ed0c30c@linaro.org \
    --to=philmd@linaro.org \
    --cc=balaton@eik.bme.hu \
    --cc=kraxel@redhat.com \
    --cc=laurent@vivier.eu \
    --cc=marcandre.lureau@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=vr_qemu@t-online.de \
    /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).