From patchwork Thu Jul 4 21:00:35 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Michael Tokarev X-Patchwork-Id: 809968 Delivered-To: patch@linaro.org Received: by 2002:adf:a199:0:b0:367:895a:4699 with SMTP id u25csp1334923wru; Thu, 4 Jul 2024 14:03:11 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVccktJN/Z6c8jFfFQDHU7rWrHGSZIeOXBxIUEEdwNlK7bRAAQJoriIvvPk9lO6N8xnmtzE2Q3w7Wj80eVB9fUs X-Google-Smtp-Source: AGHT+IGyCtQAMq9vbPpygE1ZBE12oQExhAqGVtXFQLTca9HDz8d13mM1Q5SKJ+KSgOMlmouQZUgo X-Received: by 2002:ac8:5a93:0:b0:445:229:3888 with SMTP id d75a77b69052e-447cce9c512mr38288601cf.4.1720126991456; Thu, 04 Jul 2024 14:03:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1720126991; cv=none; d=google.com; s=arc-20160816; b=apu50OQljdwz960SZVNFpdCtAIRew0XiK1o5aI/QGWUG+i5lxncx20rgKCDoXSsY4o siYKIEEX+Ug1H6WqdgZQBcLGOWjrpSjykLX488A/fuphRONkjxTpWvgE9x3xY/fH2SP/ KtGsg5cffCBMgnsVVkp3KKu9PX8mjtp6O06i5FEb+T0WQKE2dgkTCckNBET46FmLVNI3 gPAasgHQQgmhzSG4kdEw4h36dbcpFYu1T2+ez6lnCyOJP8PQ2YBe6j5M/SKj2ghA/bsM EltsXNrmVUhPQpHH1D+hzXfQLRD1RvyYGeFbCSSjrYzr1g+wcbSI1PGHqd4+Zny6h73t x7dA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from; bh=BVcwRG4S7go97zWG2/wkciHm+zfdscflwda6MmIA09U=; fh=RkVaduC9mSS2s8S4opwaBgxzh946Y+Bi0zKymkK8x08=; b=wx3M11cwAizowahL4smg9jSc0Z1ztrnCJDL3wja+YNJVevsm6s/yxTh7nn+Y0awYgu CxLzdqrmvTGHTUJp/030f4IaGQIzOXqv114FZDcD0SXggB1q8kBFo7PAHegbVTyfs4ra UV8AqVisMgd8vy/HnF93+JCu8uplk7XMI2yAi7r40uG1mHkRHkGNoVhyQ2N8QTNTEmUD hXKLhIR4ylyGhzM59sFc+uL+fComdrwHhLgLVfZeyLk9yJjxyc33M8gjRxL53dZ06GAm Xk9Kfuvr5fjyJ9+DIbR81xkpHIEcC8+wLg7+1JLA/uFRvB4pXR9g1iKybP9sgZIGYbho kOHg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org" Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id d75a77b69052e-4468beb94acsi65566471cf.49.2024.07.04.14.03.11 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 04 Jul 2024 14:03:11 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org" Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sPTZs-0006tG-NI; Thu, 04 Jul 2024 17:01:16 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sPTZp-0006lG-4t; Thu, 04 Jul 2024 17:01:13 -0400 Received: from isrv.corpit.ru ([86.62.121.231]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sPTZm-0004KY-Gh; Thu, 04 Jul 2024 17:01:12 -0400 Received: from tsrv.corpit.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id 9F5D077562; Fri, 5 Jul 2024 00:00:50 +0300 (MSK) Received: from tls.msk.ru (mjt.wg.tls.msk.ru [192.168.177.130]) by tsrv.corpit.ru (Postfix) with SMTP id B5E5DFEC9C; Fri, 5 Jul 2024 00:00:55 +0300 (MSK) Received: (nullmailer pid 1507727 invoked by uid 1000); Thu, 04 Jul 2024 21:00:55 -0000 From: Michael Tokarev To: qemu-devel@nongnu.org Cc: qemu-stable@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , "Michael S . Tsirkin" , Michael Tokarev Subject: [Stable-9.0.2 05/22] hw/audio/virtio-snd: Always use little endian audio format Date: Fri, 5 Jul 2024 00:00:35 +0300 Message-Id: <20240704210055.1507652-5-mjt@tls.msk.ru> X-Mailer: git-send-email 2.39.2 In-Reply-To: References: MIME-Version: 1.0 Received-SPF: pass client-ip=86.62.121.231; envelope-from=mjt@tls.msk.ru; helo=isrv.corpit.ru X-Spam_score_int: -68 X-Spam_score: -6.9 X-Spam_bar: ------ X-Spam_report: (-6.9 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_HI=-5, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Philippe Mathieu-Daudé 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 c80b58bf5d..4a56c00ec9 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. */ } /*