From: Philippe Mathieu-Daudé Date: Mon, 22 Apr 2024 12:47:23 +0000 (+0200) Subject: hw/audio/virtio-snd: Always use little endian audio format X-Git-Tag: v9.0.2~23 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=1608a7f81f0e220cba16b351349f6af0f8957b15;p=thirdparty%2Fqemu.git hw/audio/virtio-snd: Always use little endian audio format The VIRTIO Sound Device conforms with the Virtio spec v1.2, thus only use little endianness. Remove the suspicious target_words_bigendian() noticed during code review. Cc: qemu-stable@nongnu.org Fixes: eb9ad377bb ("virtio-sound: handle control messages and streams") Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Michael S. Tsirkin Message-Id: <20240422211830.25606-1-philmd@linaro.org> (cherry picked from commit a276ec8e2632c9015d0f9b4e47194e4e91dfa8bb) Signed-off-by: Michael Tokarev --- diff --git a/hw/audio/virtio-snd.c b/hw/audio/virtio-snd.c index c80b58bf5dc..4a56c00ec94 100644 --- a/hw/audio/virtio-snd.c +++ b/hw/audio/virtio-snd.c @@ -401,7 +401,7 @@ static void virtio_snd_get_qemu_audsettings(audsettings *as, as->nchannels = MIN(AUDIO_MAX_CHANNELS, params->channels); as->fmt = virtio_snd_get_qemu_format(params->format); as->freq = virtio_snd_get_qemu_freq(params->rate); - as->endianness = target_words_bigendian() ? 1 : 0; + as->endianness = 0; /* Conforming to VIRTIO 1.0: always little endian. */ } /*