From nobody Wed Nov 27 04:31:18 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1700128102; cv=none; d=zohomail.com; s=zohoarc; b=RL+0DC6cfoXaptBjNpVXYtRNb0w54d8Zj6d0o4pMpkE2DnQw96Q/ZIikqFvXn+IzTqUXb5yWpvlUowK3+XF6Y9Pgduzqsc+z/+UopTdvQYR7UvNT2BW0QYaUBqWJhS6IGxYYVRa7D8nZt009L5Ke4WQNIOAoIazmlf8mVxGsg/s= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1700128102; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Reply-To:Sender:Subject:Subject:To:To:Message-Id; bh=+O+Cy5RbhUgJPWukuJ/DORTy9iLFk39b1XP9TOjW1Pw=; b=AjQjqzzPwQDdjOLklE07vA4JWvkm2GZOJJ+roXhWpKYnz+JIXU2g7E4liAlURi/Ce99/3AzMMw4P1vogL6ZaGix3kKkIHCbYTs5VGJTAeuY/KXgFhHCf+qLxYm0sEcPiOK67di9S3gCt6clEYGgF9D2s4L4qIIJVg2AcgXWzNuk= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 170012810235722.79408986154715; Thu, 16 Nov 2023 01:48:22 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1r3Yyn-000070-Py; Thu, 16 Nov 2023 04:48:10 -0500 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 1r3XFX-0001iD-NR for qemu-devel@nongnu.org; Thu, 16 Nov 2023 02:57:19 -0500 Received: from [1.202.162.39] (helo=zhouyang-HP-Pro-Tower-480-G9-PCI-Desktop-PC.mioffice.cn) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1r3XFT-0004P0-Sr for qemu-devel@nongnu.org; Thu, 16 Nov 2023 02:57:19 -0500 Received: by zhouyang-HP-Pro-Tower-480-G9-PCI-Desktop-PC.mioffice.cn (Postfix, from userid 1000) id DC74DCC0C36; Thu, 16 Nov 2023 15:50:20 +0800 (CST) To: qemu-devel@nongnu.org Cc: kraxel@redhat.com, zhouyang23 Subject: [PATCH] hw/audio: Fix logic error in hda audio Date: Thu, 16 Nov 2023 15:50:19 +0800 Message-Id: <20231116075019.296115-1-zhouyang23@xiaomi.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Host-Lookup-Failed: Reverse DNS lookup failed for 1.202.162.39 (failed) Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: none client-ip=1.202.162.39; envelope-from=zhouyang@zhouyang-HP-Pro-Tower-480-G9-PCI-Desktop-PC.mioffice.cn; helo=zhouyang-HP-Pro-Tower-480-G9-PCI-Desktop-PC.mioffice.cn X-Spam_score_int: -8 X-Spam_score: -0.9 X-Spam_bar: / X-Spam_report: (-0.9 / 5.0 requ) BAYES_00=-1.9, HEADER_FROM_DIFFERENT_DOMAINS=0.249, NO_DNS_FOR_FROM=0.001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_NONE=0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Thu, 16 Nov 2023 04:48:08 -0500 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: , Reply-to: zhouyang23 From: zhouyang23 via Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZM-MESSAGEID: 1700128105621100003 Content-Type: text/plain; charset="utf-8" Commit b7639b7dd0 introduced a logic error about mixer and nomixer. Cause use micro_mixemu when there is no mixer in HDAAudioState, but use micro_nomixemu wehen there has a mixer in HDAAuditState. Signed-off-by: zhouyang23 Reviewed-by: Marc-Andr=C3=A9 Lureau --- hw/audio/hda-codec.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/hw/audio/hda-codec.c b/hw/audio/hda-codec.c index b9ad1f4c39..87bacb3bee 100644 --- a/hw/audio/hda-codec.c +++ b/hw/audio/hda-codec.c @@ -857,7 +857,7 @@ static void hda_audio_init_output(HDACodecDevice *hda, = Error **errp) HDAAudioState *a =3D HDA_AUDIO(hda); const struct desc_codec *desc =3D &output_nomixemu; =20 - if (!a->mixer) { + if (a->mixer) { desc =3D &output_mixemu; } =20 @@ -869,7 +869,7 @@ static void hda_audio_init_duplex(HDACodecDevice *hda, = Error **errp) HDAAudioState *a =3D HDA_AUDIO(hda); const struct desc_codec *desc =3D &duplex_nomixemu; =20 - if (!a->mixer) { + if (a->mixer) { desc =3D &duplex_mixemu; } =20 @@ -881,7 +881,7 @@ static void hda_audio_init_micro(HDACodecDevice *hda, E= rror **errp) HDAAudioState *a =3D HDA_AUDIO(hda); const struct desc_codec *desc =3D µ_nomixemu; =20 - if (!a->mixer) { + if (a->mixer) { desc =3D µ_mixemu; } =20 --=20 2.34.1