From patchwork Mon Feb 20 13:18:33 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 1745085 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=w9iha3w2; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4PL31b37P9z240n for ; Tue, 21 Feb 2023 00:20:03 +1100 (AEDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pU64C-0002AH-3v; Mon, 20 Feb 2023 08:18:52 -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 1pU64B-0002A3-CW for qemu-devel@nongnu.org; Mon, 20 Feb 2023 08:18:51 -0500 Received: from mail-wr1-x42d.google.com ([2a00:1450:4864:20::42d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pU649-000721-P3 for qemu-devel@nongnu.org; Mon, 20 Feb 2023 08:18:51 -0500 Received: by mail-wr1-x42d.google.com with SMTP id o4so1182809wrs.4 for ; Mon, 20 Feb 2023 05:18:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=21ktG0r6ccIgO6rViL7/7XzafhkLlNAgvQ5PiKs4PAs=; b=w9iha3w2Mw3E1cCUYu3HPBZP+zQQvqUtY5mJKNz/gHDXRaUfXDWkADWiiJsWRfFitT 9eGJhi2RJVoLlEUw1MTo7HiZPqx76SoiVA26v/BpXB0hLN8SgvUIXFcfMONgDMWeatB4 sig8XvDbzhAgyQJXeZ3yupBx4Kyk2jRTyzH/iTZZxaX+WKg/AuZXeMS84CIGFDARtJ5L ABVHezRjyIConMSyVjLWbm2wIsxlZiQy93uFjEW3NSifa8jZJQhvtedspKnWKy+dhTcl /gOi2RbjydGBvJ+uYys9Gs2TjOtHL4gC6KGYabdxJFkcr929cvZjPSS3lgj0PHKLxb9Q RsEQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=21ktG0r6ccIgO6rViL7/7XzafhkLlNAgvQ5PiKs4PAs=; b=Rwi2oaPeraYyi5G8EOBj8W4pmF+E8JJnnpgQVdaKQR8+SzFARo19IUDdfudJgoPjUy d7ynOoD1aGCok8nXC619v/PvAKYQeMOcHVA/4HRM7C18HweldzAgJ5fPhGb0RiEhwpiW 0IXrX3kwNpqMVUherJEwxruwrN0qV6qZ52PPnt3ho/zjZubHOL8gzBQF5+7NMGFw8i/0 H4YG/P3HfBu6yIbpMStvVV1kI6A/U6y1AUI2kKPu3VTHh7Boq8kGp+u7EurvI5nSyTRp THwlvsuvv/I5yq6l5vR/bOu4a5HHR1AVA1ffHILGIL36/dztO+qM2HE6gvswM8sRZu0W kkSA== X-Gm-Message-State: AO0yUKXTfYjWkF+lDDhGNNdZcVj80J4kFpw4Ybq+UPJXTTsfbbVSPFvf XnzgO8Y6CIMq5b+g+5qf0yjiLaaURPu9x4Q5 X-Google-Smtp-Source: AK7set/El0e90cPczE+OSFq7PKIGT3K+CQeQKvJBtK118m+1Cb8HVps9NA4zF8gG5skv+exWsjvVFA== X-Received: by 2002:adf:d086:0:b0:2c5:7c7a:78fb with SMTP id y6-20020adfd086000000b002c57c7a78fbmr498650wrh.40.1676899128235; Mon, 20 Feb 2023 05:18:48 -0800 (PST) Received: from localhost.localdomain ([81.0.6.76]) by smtp.gmail.com with ESMTPSA id i10-20020a1c3b0a000000b003e21f01c426sm329546wma.9.2023.02.20.05.18.47 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 20 Feb 2023 05:18:47 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Eduardo Habkost , qemu-ppc@nongnu.org, Paolo Bonzini , "Michael S. Tsirkin" , =?utf-8?q?Herv=C3=A9_Poussineau?= , Richard Henderson , Markus Armbruster , Gerd Hoffmann , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PATCH 1/5] hw/audio/hda-codec: Avoid forward-declaring HDAAudioState Date: Mon, 20 Feb 2023 14:18:33 +0100 Message-Id: <20230220131837.26292-2-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230220131837.26292-1-philmd@linaro.org> References: <20230220131837.26292-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42d; envelope-from=philmd@linaro.org; helo=mail-wr1-x42d.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable 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+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org To avoid forward-declaring HDAAudioState, declare HDA_AUDIO QOM definitions before its use in the HDAAudioStream structure. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson --- hw/audio/hda-codec.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/hw/audio/hda-codec.c b/hw/audio/hda-codec.c index feb8f9e2bb..c51d8ba617 100644 --- a/hw/audio/hda-codec.c +++ b/hw/audio/hda-codec.c @@ -145,7 +145,9 @@ static const char *fmt2name[] = { [ AUDIO_FORMAT_S32 ] = "PCM-S32", }; -typedef struct HDAAudioState HDAAudioState; +#define TYPE_HDA_AUDIO "hda-audio" +OBJECT_DECLARE_SIMPLE_TYPE(HDAAudioState, HDA_AUDIO) + typedef struct HDAAudioStream HDAAudioStream; struct HDAAudioStream { @@ -171,9 +173,6 @@ struct HDAAudioStream { int64_t buft_start; }; -#define TYPE_HDA_AUDIO "hda-audio" -OBJECT_DECLARE_SIMPLE_TYPE(HDAAudioState, HDA_AUDIO) - struct HDAAudioState { HDACodecDevice hda; const char *name; From patchwork Mon Feb 20 13:18:34 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 1745086 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=o3H45KjQ; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4PL31d5fvfz240n for ; Tue, 21 Feb 2023 00:20:05 +1100 (AEDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pU64I-0002Bo-Aj; Mon, 20 Feb 2023 08:18:58 -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 1pU64G-0002Ax-KA for qemu-devel@nongnu.org; Mon, 20 Feb 2023 08:18:56 -0500 Received: from mail-wm1-x32b.google.com ([2a00:1450:4864:20::32b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pU64F-00073G-4W for qemu-devel@nongnu.org; Mon, 20 Feb 2023 08:18:56 -0500 Received: by mail-wm1-x32b.google.com with SMTP id p3-20020a05600c358300b003e206711347so883033wmq.0 for ; Mon, 20 Feb 2023 05:18:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=31e2czA0rOGt43Bpx9OSiR8m8XfJzcMSVoea56a8oA0=; b=o3H45KjQi33YhrADQ3PSYhHFTq3lQ/v8Na7lQAOfMfXgMyBCNyUqWAwFXFv4560l3I xp+9Ixk97yl+KCqxAbSxTsKOYkKdY6M4hPZPmpClW9qoYcoEKjvIRV16Wg3s8Nw42qPC 4K+PP0y3jghfaEAsX8xeBplbLX9L1IKPebrSIH3TRpXaUxEKNO7je6N6MfQTV5b6N4OI EMu269sS86o+/YPUF7MCllsX4+2PX93j2/Xq0H2IT/gMrQZ2GfONwpUHhWdV5k1/sPTy bYNCYTHXW8RU0S15o+//ZcldYMFC+rUy6lmrxf5cdHd4m8bMtccTICnGupcMpQSQGdT4 VZlw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=31e2czA0rOGt43Bpx9OSiR8m8XfJzcMSVoea56a8oA0=; b=JLp6DpBjvbHU8Iokix2qdCw7cLJ9RtKCHcVvR3KaP3Qw/re3XcZXdsHLyFSD2f1/LM xiJkvm+jixys2B63191N6+lgZNdGv/BFUyyi71npU02zkX5w5z7KqX6VnusGBOLW5WFa 0+p+C9/dZZgrK/dv7P1XLpwAaLRnIvh3Q9nQqQEAZXU/671UbmN/F/ERFym+323gb/42 GrnqwKxYh7rmF8Ynamyw4PE3yr411CqXXmTp91GMozmM3x6yanUho3McnWZm18O3FlgK pd4r7jL2Oj64M0mFKIG01f7rOy/fkmmcqC8IjdEy5iM3tbYbJuZzwn6DKKWByrSTvIUb PUxA== X-Gm-Message-State: AO0yUKURsRdVTmZCvQ5hbJ3zXFJzlMBNR1jLOA2gbMN5hK3nNVsmtIkF Be+FtcokZyV23FdWycx6y+ds9ePWeKIi9WQp X-Google-Smtp-Source: AK7set/qiWeNcECGnwKpvd8pbVV1yB5mlV2OUss0IoHS9II/Nzbn4Uq8/oUQgdwlJqP/uB8npm+UOA== X-Received: by 2002:a05:600c:a294:b0:3d9:fb59:c16b with SMTP id hu20-20020a05600ca29400b003d9fb59c16bmr661015wmb.36.1676899133320; Mon, 20 Feb 2023 05:18:53 -0800 (PST) Received: from localhost.localdomain ([81.0.6.76]) by smtp.gmail.com with ESMTPSA id f4-20020a7bcd04000000b003e00c9888besm9315268wmj.30.2023.02.20.05.18.52 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 20 Feb 2023 05:18:52 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Eduardo Habkost , qemu-ppc@nongnu.org, Paolo Bonzini , "Michael S. Tsirkin" , =?utf-8?q?Herv=C3=A9_Poussineau?= , Richard Henderson , Markus Armbruster , Gerd Hoffmann , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PATCH 2/5] hw/audio/es1370: Avoid forward-declaring ES1370State Date: Mon, 20 Feb 2023 14:18:34 +0100 Message-Id: <20230220131837.26292-3-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230220131837.26292-1-philmd@linaro.org> References: <20230220131837.26292-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32b; envelope-from=philmd@linaro.org; helo=mail-wm1-x32b.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable 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+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org To avoid forward-declaring ES1370State, declare ES1370 QOM definitions before its use in the chan_bits structure. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson --- hw/audio/es1370.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/hw/audio/es1370.c b/hw/audio/es1370.c index 54cc19a637..ea76c9a734 100644 --- a/hw/audio/es1370.c +++ b/hw/audio/es1370.c @@ -256,6 +256,9 @@ static void print_sctl (uint32_t val) #define lwarn(...) #endif +#define TYPE_ES1370 "ES1370" +OBJECT_DECLARE_SIMPLE_TYPE(ES1370State, ES1370) + struct chan { uint32_t shift; uint32_t leftover; @@ -278,7 +281,6 @@ struct ES1370State { uint32_t codec; uint32_t sctl; }; -typedef struct ES1370State ES1370State; struct chan_bits { uint32_t ctl_en; @@ -292,9 +294,6 @@ struct chan_bits { uint32_t *old_freq, uint32_t *new_freq); }; -#define TYPE_ES1370 "ES1370" -OBJECT_DECLARE_SIMPLE_TYPE(ES1370State, ES1370) - static void es1370_dac1_calc_freq (ES1370State *s, uint32_t ctl, uint32_t *old_freq, uint32_t *new_freq); static void es1370_dac2_and_adc_calc_freq (ES1370State *s, uint32_t ctl, From patchwork Mon Feb 20 13:18:35 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 1745090 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=Cbc/reFe; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4PL3206W55z245j for ; Tue, 21 Feb 2023 00:20:24 +1100 (AEDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pU64O-0002Dq-7w; Mon, 20 Feb 2023 08:19:04 -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 1pU64N-0002DZ-7K for qemu-devel@nongnu.org; Mon, 20 Feb 2023 08:19:03 -0500 Received: from mail-wm1-x333.google.com ([2a00:1450:4864:20::333]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pU64K-00073w-6I for qemu-devel@nongnu.org; Mon, 20 Feb 2023 08:19:02 -0500 Received: by mail-wm1-x333.google.com with SMTP id o14so1260049wms.1 for ; Mon, 20 Feb 2023 05:18:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=IN0WAsB9L5CFqp3vtKSX1KHSdW1kdU+eQCKL82nmG4w=; b=Cbc/reFexjbdSsRLAjHHhGGkImZERRqiQJl8SZ3EcLskeFj4+286UXKUpEX4ebq1dS UNyxbwM1vURGydatiX2yZf9EsxcoerHHj6UEqsUY3Chtp7iJflIW/BsGQo+AGekcIzQ0 4jvnun1IAg5aFqkrdrJWqPLi1Dx0scXiaxAnLZrx9So3al++2YoklM0IZ3df6Pu5yO2m UyzVhTnNLYdplrPyNbDZwk6HfW/tN4vkeb7InvajlqMqWboDEv/bBH0ziMvKnyvKbftW BP1zOZKozLrBpH4ms/8hjxpdvGTDwNMCNINv8z/X727Yskth8Swr/EQNvwcSeP0hpL2X Pj+Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=IN0WAsB9L5CFqp3vtKSX1KHSdW1kdU+eQCKL82nmG4w=; b=2Mr/4EcWQy15OUBFbrbjYu8N3PkpXlO2jh50zkbuvF9rbmRb+vSPIAzZX1UPeopN6M tFOaOEeqRSIBXa8Vfm/Ws/4MUTw+6MvXkyA6X9+axj9JKzj+eK4Kd5IpD7Og57nHVpSE V49VE5sffL/kxHB9RPmOR+KqBjcXXEom9wI5TDxPxNCCFs+y2gv3/k/KC25WIQeLX6sU PVy7On2Cw59Q1myAhOeb3XJhu/SY/IsmOIksrHYOGJxajaHb/luFxTYftiPAJXhUeQNG C1cQelbOoM33P+Y+CPdMocfCDnbhzkPvswATqSjUZ82ofEDbvDAhMZZ5T7YNcR6Ohc/4 CdlA== X-Gm-Message-State: AO0yUKWsKU6berIZWXGn7+dBbD8QqXFfSHLIAQWJh1HS9u+6tNjK3NgG Wa64Gfjul6d1ardqkme7oQ/fokIxvtxu7qgU X-Google-Smtp-Source: AK7set9QSwlMEARWrr+B73cGZ+LO9x5VUYIP9nSL+Y+4Vpc8AzpCBkPhHrbwqErz2I9+XpeAjKt+Fg== X-Received: by 2002:a05:600c:708:b0:3dc:1687:9ba2 with SMTP id i8-20020a05600c070800b003dc16879ba2mr5547678wmn.35.1676899138305; Mon, 20 Feb 2023 05:18:58 -0800 (PST) Received: from localhost.localdomain ([81.0.6.76]) by smtp.gmail.com with ESMTPSA id c6-20020a05600c0ac600b003dc434b39c7sm1241768wmr.0.2023.02.20.05.18.57 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 20 Feb 2023 05:18:57 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Eduardo Habkost , qemu-ppc@nongnu.org, Paolo Bonzini , "Michael S. Tsirkin" , =?utf-8?q?Herv=C3=A9_Poussineau?= , Richard Henderson , Markus Armbruster , Gerd Hoffmann , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PATCH 3/5] hw/audio/es1370: Replace container_of() by ES1370() QOM cast macro Date: Mon, 20 Feb 2023 14:18:35 +0100 Message-Id: <20230220131837.26292-4-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230220131837.26292-1-philmd@linaro.org> References: <20230220131837.26292-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::333; envelope-from=philmd@linaro.org; helo=mail-wm1-x333.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, 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+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson --- hw/audio/es1370.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hw/audio/es1370.c b/hw/audio/es1370.c index ea76c9a734..4f738a0ad8 100644 --- a/hw/audio/es1370.c +++ b/hw/audio/es1370.c @@ -843,7 +843,8 @@ static const VMStateDescription vmstate_es1370 = { static void es1370_on_reset(DeviceState *dev) { - ES1370State *s = container_of(dev, ES1370State, dev.qdev); + ES1370State *s = ES1370(dev); + es1370_reset (s); } From patchwork Mon Feb 20 13:18:36 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 1745084 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=jFx7aHok; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4PL31T5C42z240n for ; Tue, 21 Feb 2023 00:19:57 +1100 (AEDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pU64S-0002FI-1F; Mon, 20 Feb 2023 08:19:08 -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 1pU64Q-0002EY-Fq for qemu-devel@nongnu.org; Mon, 20 Feb 2023 08:19:06 -0500 Received: from mail-wr1-x434.google.com ([2a00:1450:4864:20::434]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pU64P-000760-31 for qemu-devel@nongnu.org; Mon, 20 Feb 2023 08:19:06 -0500 Received: by mail-wr1-x434.google.com with SMTP id p8so1314992wrt.12 for ; Mon, 20 Feb 2023 05:19:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=x9XssOvydBlHwVUUwEi4liJFlLTsO0m5yxHdZTbs0B0=; b=jFx7aHokSKT+vYwg5OCzw1ID6zR/OxDluPjO5Lx/SRqIWuKxybgKEcEOdFLR430np6 fTNq7hwm5jR5fO2a/iEzs6jb5JQfgG0lQ5Qe/qbvjaVZUU3gPCJ8fnHG6vGcE68efdav ibUxhWE4n1eleijXaB7Mei3vBS6+UCx5wJqdRglLNF8oGxKy7eH9DJqFOkNFyk6nZLqr xnFFKkgMIRbrokRsLmn9ebKB8pkV9Yuh99aPsYhsDXPQvRgxumeWnYexRFEl1spMGm3B T7ZjeV1kZG2bRFLS/7QV6vbrhN1mOgE1Oz7J3tkDbANlwW5iq05bxLsKOhVtnAXdMow6 zdRA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=x9XssOvydBlHwVUUwEi4liJFlLTsO0m5yxHdZTbs0B0=; b=RtGHetbGLzBInyzSKpXLTnRVLEbvVlDBSt50BTnXyKGgUU7YyiSEBDRsE7cAbY3+Nh qbo/o400Rgr62zmvgf0oejjWTg9WfFMZcoP79+D1cqgXjCdJqBNVmaCi03PQhF/lZfJf HDI5HAC6k3xPI6SWacAU2hTw54zm1EbbPfqZVIMm269JDVtRiPAvrAGHmEyt51kVd+hr S2tWyE/Go5lF/jNnfXfeN/8kSzTnzRWUE5qMaMzDxmnq4j7IFDK1p1pDZDKg7NrpeEm9 3DOV/Cl0/z+M+nH+bSL7E7/JjgLvTw51p6tApE4PR8j4ldDqZcNAzWTd1yzJeMbPo/QQ GP7A== X-Gm-Message-State: AO0yUKUoDDXJZI69p6PX1nPZwewKqv9KGSZmoMNoaouueeE25eIXDyT3 ZwWNCZ2Ja9nM1R95zEuTG5wjndrhRl54c/Qu X-Google-Smtp-Source: AK7set9QFhyP6DYHPe1g5BZ9zhUGKz/IG+QO+y/5g0M0zJoodvgKKlSLwUGxtg7UeSXGGOgOkEdaJA== X-Received: by 2002:a5d:5046:0:b0:2c5:594b:10d6 with SMTP id h6-20020a5d5046000000b002c5594b10d6mr2320706wrt.29.1676899143372; Mon, 20 Feb 2023 05:19:03 -0800 (PST) Received: from localhost.localdomain ([81.0.6.76]) by smtp.gmail.com with ESMTPSA id y16-20020a5d4710000000b002c553509db7sm5846815wrq.52.2023.02.20.05.19.02 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 20 Feb 2023 05:19:03 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Eduardo Habkost , qemu-ppc@nongnu.org, Paolo Bonzini , "Michael S. Tsirkin" , =?utf-8?q?Herv=C3=A9_Poussineau?= , Richard Henderson , Markus Armbruster , Gerd Hoffmann , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PATCH 4/5] hw/audio/ac97: Replace container_of() by AC97() QOM cast macro Date: Mon, 20 Feb 2023 14:18:36 +0100 Message-Id: <20230220131837.26292-5-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230220131837.26292-1-philmd@linaro.org> References: <20230220131837.26292-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::434; envelope-from=philmd@linaro.org; helo=mail-wr1-x434.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable 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+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson --- hw/audio/ac97.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/audio/ac97.c b/hw/audio/ac97.c index 364cdfa733..b3a45bb49f 100644 --- a/hw/audio/ac97.c +++ b/hw/audio/ac97.c @@ -1295,7 +1295,7 @@ static const MemoryRegionOps ac97_io_nabm_ops = { static void ac97_on_reset(DeviceState *dev) { - AC97LinkState *s = container_of(dev, AC97LinkState, dev.qdev); + AC97LinkState *s = AC97(dev); reset_bm_regs(s, &s->bm_regs[0]); reset_bm_regs(s, &s->bm_regs[1]); From patchwork Mon Feb 20 13:18:37 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 1745091 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=WTXkfJK1; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4PL32B3XGxz23j7 for ; Tue, 21 Feb 2023 00:20:34 +1100 (AEDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pU64X-0002Gg-3D; Mon, 20 Feb 2023 08:19:13 -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 1pU64V-0002Fk-3D for qemu-devel@nongnu.org; Mon, 20 Feb 2023 08:19:11 -0500 Received: from mail-wr1-x434.google.com ([2a00:1450:4864:20::434]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pU64T-000760-DG for qemu-devel@nongnu.org; Mon, 20 Feb 2023 08:19:10 -0500 Received: by mail-wr1-x434.google.com with SMTP id p8so1315234wrt.12 for ; Mon, 20 Feb 2023 05:19:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=7QWW26zXAXrkV/pg8r+DTRtljT9tVsN1Ste5FUqYSr0=; b=WTXkfJK1Jj6vPQWUWO5JAdoWpxSdPRhMQof6MYlN4Dywl/X+re0BwNTf/3fQBgSlzG WQKiFm/AKzflq35HvzB7FIt5KHduxx/VnvwIK7XNbiPdl61q8sJslo/hVqfMlDaIUusH ZlpriSnlmRUSiftMmQ5KiskArMJvnOPWrgU8ShywM3jHttnUxcLlH9LyCLG9ooA36Inf aiNCgCtxhWuDloaqGRO4roS3NDelg9v+vxrf0zE2WE1EbR1vF/4q4VyqcGdJWKydomfI f7LTA/uJvikXP5XtJiiRB//lzK38ZtNOTfohItfQh06+25VMf7DnNJXOP4YZbeA32zr/ 2dQg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=7QWW26zXAXrkV/pg8r+DTRtljT9tVsN1Ste5FUqYSr0=; b=gU/oZoY6KNxhBCMksiQa2n+4USYj1MhNCG1+PB8Ql4zJIipCW3Ls0xDeSZuZWUPRKx q7sP4fhpiu7rh6APBujYyC/B3Cre3ddER/SkcgJYIxiUg74k8p2IX/8ghJBl0I3HePVg 7tfvd9QjgexNI7I7Il7EnHjPWSAAb4I3aTSPBd9Hh3VMu4wo7Nh4GAtVdbO9A6O3DtLI MoFdAdJD2kZn+3g+7hxLRepw9DWks1uHCwp8qzhke8MUR6zVCKwnuyZEdv8v76ogqDlw Ibep1ebKTsgI6ZafV9r5C4oROKna4zdGMc+3OsTruueYpXwi8ZpmAgPrIY8odD31sqTk bz4w== X-Gm-Message-State: AO0yUKXy5tbflYq/cgRRRssYafsC6IV8xpkCJARKl8jEkPqPyQWDJoik PzQwV4Amce8WEjlvodPOQ1ZMgzmIzkHp0ily X-Google-Smtp-Source: AK7set+6JN1gfJ0akOx19NleM4fvSRrAgGjY6RCrG1vN7om+ixr7LZOsdHz4UjZxpEZH72H6BlRufQ== X-Received: by 2002:adf:e301:0:b0:2c5:46d1:69e1 with SMTP id b1-20020adfe301000000b002c546d169e1mr1444651wrj.36.1676899148515; Mon, 20 Feb 2023 05:19:08 -0800 (PST) Received: from localhost.localdomain ([81.0.6.76]) by smtp.gmail.com with ESMTPSA id z3-20020adff1c3000000b002c559def236sm118731wro.57.2023.02.20.05.19.07 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 20 Feb 2023 05:19:08 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Eduardo Habkost , qemu-ppc@nongnu.org, Paolo Bonzini , "Michael S. Tsirkin" , =?utf-8?q?Herv=C3=A9_Poussineau?= , Richard Henderson , Markus Armbruster , Gerd Hoffmann , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Marcel Apfelbaum , Aleksandar Rikalo Subject: [PATCH 5/5] hw/audio/pcspk: Open-code pcspk_init() Date: Mon, 20 Feb 2023 14:18:37 +0100 Message-Id: <20230220131837.26292-6-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230220131837.26292-1-philmd@linaro.org> References: <20230220131837.26292-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::434; envelope-from=philmd@linaro.org; helo=mail-wr1-x434.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, 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+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org pcspk_init() is used in 3 places and is 2-lines of code. Signed-off-by: Philippe Mathieu-Daudé --- hw/i386/pc.c | 3 ++- hw/isa/i82378.c | 5 ++++- hw/mips/jazz.c | 5 ++++- include/hw/audio/pcspk.h | 10 ---------- 4 files changed, 10 insertions(+), 13 deletions(-) diff --git a/hw/i386/pc.c b/hw/i386/pc.c index 6e592bd969..73bd98997f 100644 --- a/hw/i386/pc.c +++ b/hw/i386/pc.c @@ -1319,7 +1319,8 @@ void pc_basic_device_init(struct PCMachineState *pcms, /* connect PIT to output control line of the HPET */ qdev_connect_gpio_out(hpet, 0, qdev_get_gpio_in(DEVICE(pit), 0)); } - pcspk_init(pcms->pcspk, isa_bus, pit); + object_property_set_link(OBJECT(pcms->pcspk), "pit", OBJECT(pit), NULL); + isa_realize_and_unref(pcms->pcspk, isa_bus, &error_fatal); } /* Super I/O */ diff --git a/hw/isa/i82378.c b/hw/isa/i82378.c index e3322e03bf..f0964cdcd9 100644 --- a/hw/isa/i82378.c +++ b/hw/isa/i82378.c @@ -68,6 +68,7 @@ static void i82378_realize(PCIDevice *pci, Error **errp) uint8_t *pci_conf; ISABus *isabus; ISADevice *pit; + ISADevice *snd; pci_conf = pci->config; pci_set_word(pci_conf + PCI_COMMAND, @@ -102,7 +103,9 @@ static void i82378_realize(PCIDevice *pci, Error **errp) pit = i8254_pit_init(isabus, 0x40, 0, NULL); /* speaker */ - pcspk_init(isa_new(TYPE_PC_SPEAKER), isabus, pit); + snd = isa_new(TYPE_PC_SPEAKER); + object_property_set_link(OBJECT(snd), "pit", OBJECT(pit), NULL); + isa_realize_and_unref(snd, isabus, &error_fatal); /* 2 82C37 (dma) */ isa_create_simple(isabus, "i82374"); diff --git a/hw/mips/jazz.c b/hw/mips/jazz.c index 6aefe9a61b..a4e035cd66 100644 --- a/hw/mips/jazz.c +++ b/hw/mips/jazz.c @@ -144,6 +144,7 @@ static void mips_jazz_init(MachineState *machine, SysBusDevice *sysbus; ISABus *isa_bus; ISADevice *pit; + ISADevice *snd; DriveInfo *fds[MAX_FD]; MemoryRegion *bios = g_new(MemoryRegion, 1); MemoryRegion *bios2 = g_new(MemoryRegion, 1); @@ -252,7 +253,9 @@ static void mips_jazz_init(MachineState *machine, isa_bus_irqs(isa_bus, i8259); i8257_dma_init(isa_bus, 0); pit = i8254_pit_init(isa_bus, 0x40, 0, NULL); - pcspk_init(isa_new(TYPE_PC_SPEAKER), isa_bus, pit); + snd = isa_new(TYPE_PC_SPEAKER); + object_property_set_link(OBJECT(snd), "pit", OBJECT(pit), NULL); + isa_realize_and_unref(snd, isa_bus, &error_fatal); /* Video card */ switch (jazz_model) { diff --git a/include/hw/audio/pcspk.h b/include/hw/audio/pcspk.h index 9506179587..6be75a6b86 100644 --- a/include/hw/audio/pcspk.h +++ b/include/hw/audio/pcspk.h @@ -25,16 +25,6 @@ #ifndef HW_PCSPK_H #define HW_PCSPK_H -#include "hw/isa/isa.h" -#include "hw/qdev-properties.h" -#include "qapi/error.h" - #define TYPE_PC_SPEAKER "isa-pcspk" -static inline void pcspk_init(ISADevice *isadev, ISABus *bus, ISADevice *pit) -{ - object_property_set_link(OBJECT(isadev), "pit", OBJECT(pit), NULL); - isa_realize_and_unref(isadev, bus, &error_fatal); -} - #endif /* HW_PCSPK_H */