From nobody Wed May 15 15:40:33 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1676905631; cv=none; d=zohomail.com; s=zohoarc; b=c9YbxVDn9ZYhJTHx+aaxgpR3cDV0vBWRzY1N3csZfsRUxkHsKjlSZny5/rjXwl9aE/pK3slpfkKrncD+6i28akZp8BACr7vmUymwfWcx5BOg7yCobo9qyg5GjkXdPR7r69mXMlxnmJzh71favFifBH4+p1moXi9Eal9gRaOiH9c= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1676905631; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=alpgVL4TtkFnvxglkaFOS7JafAYOgPwJn2AublwKwWs=; b=Jsc2fG6dRiJJDSdyHZ/3++iquZEtnmJyBzmxgCTTBcmFBrlD1l9rTas7NKaY7N+ymK67euWHrUDTc+bUoctFt45Vn1dbre5qpS6xhT7A0Yw4dhpmbS4A4DnO6p8HTAXSeLwzrkD2LyJwsNYK7Ww84Np8tO5fzfS/XUrmQUbHcnw= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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 1676905631132723.4495218310138; Mon, 20 Feb 2023 07:07:11 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pU7jL-0001Ri-DS; Mon, 20 Feb 2023 10:05:27 -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 1pU7jK-0001Ra-53 for qemu-devel@nongnu.org; Mon, 20 Feb 2023 10:05:26 -0500 Received: from mail-wm1-x32c.google.com ([2a00:1450:4864:20::32c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pU7jI-0008Mc-ER for qemu-devel@nongnu.org; Mon, 20 Feb 2023 10:05:25 -0500 Received: by mail-wm1-x32c.google.com with SMTP id bg37-20020a05600c3ca500b003e21e018039so2126555wmb.3 for ; Mon, 20 Feb 2023 07:05:24 -0800 (PST) Received: from localhost.localdomain ([81.0.6.76]) by smtp.gmail.com with ESMTPSA id q6-20020a05600c46c600b003dc47d458cdsm1370643wmo.15.2023.02.20.07.05.22 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 20 Feb 2023 07:05:22 -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=alpgVL4TtkFnvxglkaFOS7JafAYOgPwJn2AublwKwWs=; b=ASchb6AsemQJip8loRYisB7hEyV3yfrzaLMvvDJY1aJ/cJ3LAXXz48FtKkQbY3ckBs kWZbJjVVs2RZez2+tr/3EvLyINbeF5wsIM++U7qV6XuzOG7pKDqC/dvua0g1vZHz562B guKLHgtFb1OBBNROHoD3UIVPwDjYxaNCcIdzx+pmKPeEEV7AAR+OwRj+5VmEsUFLbW8I BGUc/9gylvWpt3Kim0uAboScpaWW8fAc+9Pqn6eDhnCPWSynfe0Vb5bvFOJjMR6jjdQi K17X6+aWIbBqu5g2pg8BVzYh2H61DFq5H0+lO0oO2gc/EgxD4f54P+wTD0AhoBhNtQMr enHQ== 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=alpgVL4TtkFnvxglkaFOS7JafAYOgPwJn2AublwKwWs=; b=PVc3+Q8ILBMSwBc5zN+QQAS9H37fbpbC6g4S42kk2o+h5Lrr/D3ZF+ncI3WvHNi/qC 2V0WYUdRsgxkXMxBWylj/+MV9MWiX67h4+zs/SjJdedj4DEsLO2GEw+uhfBbHWkYzLrm rS5/8/peQBgBqFIo0TXw56OAFY1TWYaRbCO2CmqdHtjdSkUhhXKuSDEfC7O3jvniHiHF PVJo1/K0y/dyC1CET/qjAoSZoMWsm2Q4k/3LFapJJGoY4luTjPB5KeAwJpOvdFDDhlvR tjfSl0kjN2T3KjSaFo6gv8YFAhnc+FV+UEX6Df+/AUFzzuguWP7UnOHAt91YLpnzQB3Z eRyw== X-Gm-Message-State: AO0yUKWeC0CUWZ/3X/N5zCbzlMhKi/tn3W5OSAR2FwKg3JJR79fycWIU LTkXnfUgmPFWgaG01H9jDY9cHN/YhkZERJEf X-Google-Smtp-Source: AK7set8K2Q5CNWjg2gQD4DALKpuAKJ/rvI/9nVNu9r5ZfCu5VrtKTuicUeC/2X7mdrQmrt3ZkE8Mrw== X-Received: by 2002:a05:600c:164a:b0:3e2:668:3ed6 with SMTP id o10-20020a05600c164a00b003e206683ed6mr267883wmn.2.1676905522896; Mon, 20 Feb 2023 07:05:22 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Gerd Hoffmann , Markus Armbruster , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH 1/9] hw/usb/dev-smartcard-reader: Avoid forward-declaring CCIDBus Date: Mon, 20 Feb 2023 16:05:07 +0100 Message-Id: <20230220150515.32549-2-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230220150515.32549-1-philmd@linaro.org> References: <20230220150515.32549-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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: pass client-ip=2a00:1450:4864:20::32c; envelope-from=philmd@linaro.org; helo=mail-wm1-x32c.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1676905632444100002 To avoid forward-declaring CCIDBus, declare CCID_BUS QOM definitions before its use in the USBCCIDState structure. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson --- hw/usb/dev-smartcard-reader.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/hw/usb/dev-smartcard-reader.c b/hw/usb/dev-smartcard-reader.c index 28164d89be..be0a4fc3bc 100644 --- a/hw/usb/dev-smartcard-reader.c +++ b/hw/usb/dev-smartcard-reader.c @@ -278,7 +278,9 @@ typedef struct BulkIn { struct CCIDBus { BusState qbus; }; -typedef struct CCIDBus CCIDBus; + +#define TYPE_CCID_BUS "ccid-bus" +OBJECT_DECLARE_SIMPLE_TYPE(CCIDBus, CCID_BUS) =20 /* * powered - defaults to true, changed by PowerOn/PowerOff messages @@ -1174,9 +1176,6 @@ static Property ccid_props[] =3D { DEFINE_PROP_END_OF_LIST(), }; =20 -#define TYPE_CCID_BUS "ccid-bus" -OBJECT_DECLARE_SIMPLE_TYPE(CCIDBus, CCID_BUS) - static const TypeInfo ccid_bus_info =3D { .name =3D TYPE_CCID_BUS, .parent =3D TYPE_BUS, --=20 2.38.1 From nobody Wed May 15 15:40:33 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1676905546; cv=none; d=zohomail.com; s=zohoarc; b=Fxu3s9l3Tpng9BZ5XGtllKVLmyjR1I4F2C9tqzOT3siaArqruJnUje1tPmYg5MzV4PN/Iwk3lo7BEEoXAWvuwnUhJTYd9xGhPmCQ46e8tyk5mfVLA+QX2DmS/jw68KUNskgpirBOWfyuBvMVtQGhDHbf7CunJwtBLV3YjhGNo5I= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1676905546; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=WvQXFHkymgCugjl5w0M5Pkt74ouZE927KClvNUr2f1I=; b=kqoVAcdtx4wUeQQifDDqspHahtLhn7l3qA2bZ2HLL0LATIo2GEnYIx4alkBlVPsT5jaU0WKOhXrtAFPZv8Lu1rFcm74btgX52lOyvE7VgAWG1t2KRprnDJWgXnuoMf4ILeHMRki8XWkq2cTlxIZN28lnLl+wEp5wm770T56E6qk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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 1676905546342532.037789428182; Mon, 20 Feb 2023 07:05:46 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pU7jV-0001UG-Nu; Mon, 20 Feb 2023 10:05:37 -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 1pU7jP-0001S9-Vy for qemu-devel@nongnu.org; Mon, 20 Feb 2023 10:05:32 -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 1pU7jN-0008Pc-Rm for qemu-devel@nongnu.org; Mon, 20 Feb 2023 10:05:31 -0500 Received: by mail-wr1-x434.google.com with SMTP id c5so2229783wrr.5 for ; Mon, 20 Feb 2023 07:05:29 -0800 (PST) Received: from localhost.localdomain ([81.0.6.76]) by smtp.gmail.com with ESMTPSA id t20-20020a1c7714000000b003dc3f3d77e3sm1437266wmi.7.2023.02.20.07.05.27 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 20 Feb 2023 07:05:27 -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=WvQXFHkymgCugjl5w0M5Pkt74ouZE927KClvNUr2f1I=; b=oNbyK5bmWx489XuCKxFfaXarv7cwfVphOyQH3WvLtfsWk5rp2/H2tCe15B+Gw82YOi BM9lsmBHxu5uTDzHEcdgA4ygYFkD18nJ4++SNEiNoNEynJP4X54mOdQdtQeZiM9tIiTU 1+NygPMdKY35KGvLc9QDcSUxa7Ldi/J0dzf/f+AdsQOzgYs3L2sFcpMt8nTAl4wzCgW3 OdAsDjdyDwJc4diwmlJcnWgxVXxRTMrwVC8lJgmDzk/LCmH0EyG6XK5vmUJVs0pAE/Ky hPNbC08/vo1TpsR8D0H3Xcg5KgCAP9/pFVXg+isZ9UaxWs1244vdEQPtasCMl11daFb1 0Fmg== 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=WvQXFHkymgCugjl5w0M5Pkt74ouZE927KClvNUr2f1I=; b=n0cW7ZjGXqyGH9NSWE7LGfed49MWMa8VYZsUhRL6gWjWhwspa0UJF71mGaQ0AhjJ03 DlaCRbebTLEWqxkOuHvLBrNnPVjt6+rVxVuLw8bLOVvjBefx5nfueYYCgj1Zs1tO7Kef keJoYF0yhVX1Dog+PITjTZtWwS47RHHyOmOTqgCgbLnoClbSr27HoqESrxgM0r/Rahe6 WY1xIbE4FkU8Lah3ME2yGGUcyxBSQWufCBmzEpVga1TbUfYqdSpuiaJ4sooCB3jyNZYR NpxZReU/8Q9kH0FoTyQMlpbmpAlEWGn2f4kWAXKiWS6BXcbAaftCbDfTWOC8n5EQ4dp8 Ynuw== X-Gm-Message-State: AO0yUKX6hbVoHdwGHaVswXKATLXvGnDftjViNtHw6Il6UN6LG8bs/4XU OAa0NzYNC16YtkRAjlpQHeYHkMrnb77NhgOS X-Google-Smtp-Source: AK7set9wOPJyT/SXml6PHb6eRhI1d7QfpYWhO1coMcPLrn8JB9m6DzsY6wADJnXSE1OeKhAQcTNaoQ== X-Received: by 2002:a5d:4f87:0:b0:2c5:8d06:75c2 with SMTP id d7-20020a5d4f87000000b002c58d0675c2mr2981896wru.35.1676905528225; Mon, 20 Feb 2023 07:05:28 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Gerd Hoffmann , Markus Armbruster , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH 2/9] hw/usb/hcd-ohci: Use OHCIState type definition Date: Mon, 20 Feb 2023 16:05:08 +0100 Message-Id: <20230220150515.32549-3-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230220150515.32549-1-philmd@linaro.org> References: <20230220150515.32549-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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: 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1676905547951100003 Forward-define the type first, then use it for the ohci_die() handler. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson --- hw/usb/hcd-ohci.c | 2 +- hw/usb/hcd-ohci.h | 10 ++++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/hw/usb/hcd-ohci.c b/hw/usb/hcd-ohci.c index 9d68036d23..7ecf9b15b7 100644 --- a/hw/usb/hcd-ohci.c +++ b/hw/usb/hcd-ohci.c @@ -1827,7 +1827,7 @@ static USBBusOps ohci_bus_ops =3D { void usb_ohci_init(OHCIState *ohci, DeviceState *dev, uint32_t num_ports, dma_addr_t localmem_base, char *masterbus, uint32_t firstport, AddressSpace *as, - void (*ohci_die_fn)(struct OHCIState *), Error **errp) + void (*ohci_die_fn)(OHCIState *), Error **errp) { Error *err =3D NULL; int i; diff --git a/hw/usb/hcd-ohci.h b/hw/usb/hcd-ohci.h index 11ac57058d..8a9ba8b959 100644 --- a/hw/usb/hcd-ohci.h +++ b/hw/usb/hcd-ohci.h @@ -33,7 +33,9 @@ typedef struct OHCIPort { uint32_t ctrl; } OHCIPort; =20 -typedef struct OHCIState { +typedef struct OHCIState OHCIState; + +struct OHCIState { USBBus bus; qemu_irq irq; MemoryRegion mem; @@ -89,8 +91,8 @@ typedef struct OHCIState { uint32_t async_td; bool async_complete; =20 - void (*ohci_die)(struct OHCIState *ohci); -} OHCIState; + void (*ohci_die)(OHCIState *ohci); +}; =20 #define TYPE_SYSBUS_OHCI "sysbus-ohci" OBJECT_DECLARE_SIMPLE_TYPE(OHCISysBusState, SYSBUS_OHCI) @@ -112,7 +114,7 @@ extern const VMStateDescription vmstate_ohci_state; void usb_ohci_init(OHCIState *ohci, DeviceState *dev, uint32_t num_ports, dma_addr_t localmem_base, char *masterbus, uint32_t firstport, AddressSpace *as, - void (*ohci_die_fn)(struct OHCIState *), Error **errp); + void (*ohci_die_fn)(OHCIState *), Error **errp); void ohci_bus_stop(OHCIState *ohci); void ohci_stop_endpoints(OHCIState *ohci); void ohci_hard_reset(OHCIState *ohci); --=20 2.38.1 From nobody Wed May 15 15:40:33 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1676905619; cv=none; d=zohomail.com; s=zohoarc; b=g6KokJabY9vklSD7g5y8qpTLOTY64XogXaMvB0sVwUweeehEI5Ax/11gk4JlGo1b4fG/zH0ZFVO1xDCQ6TmDYWaRaPiuxuZex5QxVXUr66v9/UntggnQ5BpnL3STm2JHMqpzk7y5+68xWO927dhJp6sPdYLNs1/rCehB8Pdy8cE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1676905619; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=7fg6HCxs6YpFo/+46boIzya1hKfktdzojAtH+afSJyQ=; b=jj9B72gcPwlZPkJ9RqVtq+97hZ4RhPN63lAQp1ZQCB1sz0ryZILutTIUuyjne6NKK9rrL2GKOhXN3wrwepOU+Xp9jHJ2M/IsbTkE8v0KkdXjaW7XugmTlLxsn6HLbtVScLSdn8dK5NiHCg9hdRoPoUZPxDHReoDNTXE1ifFJs08= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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 1676905619141424.901191783969; Mon, 20 Feb 2023 07:06:59 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pU7jY-0001ZD-TI; Mon, 20 Feb 2023 10:05:41 -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 1pU7jV-0001Ud-Sv for qemu-devel@nongnu.org; Mon, 20 Feb 2023 10:05:37 -0500 Received: from mail-wr1-x433.google.com ([2a00:1450:4864:20::433]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pU7jS-0008Q8-Hm for qemu-devel@nongnu.org; Mon, 20 Feb 2023 10:05:35 -0500 Received: by mail-wr1-x433.google.com with SMTP id l1so1265211wry.10 for ; Mon, 20 Feb 2023 07:05:34 -0800 (PST) Received: from localhost.localdomain ([81.0.6.76]) by smtp.gmail.com with ESMTPSA id v6-20020adfedc6000000b002c5544b3a69sm12652486wro.89.2023.02.20.07.05.32 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 20 Feb 2023 07:05:32 -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=7fg6HCxs6YpFo/+46boIzya1hKfktdzojAtH+afSJyQ=; b=r9D8/sZ57wMWYURio6MgHiplYoREPPP5ECnZWbkTvd1XGr+lIeT0nApvdJUXrTD4Pv ts4EtFGdrza8Q8Dqlk6QFEBiTByaEbH1raEoXSSXCcpgyEGQaj0DcPVLFf8ke3uBply7 tGnmcx1rIAPnGajolZyE1zTcQPwoecPbJtelOpmVI8nRo0ZN+R34kpSmpgjoDeQYZESH rqVdBFEZl1lxwmc+RmvOHBlLgTPfYJMuQUEgqRe2gOX03gIpGunW0T3IPuS5QR6Vca7c iXh7ZxIakDuDlYXQHpg1b+DwnLDiSJ95M2AWNbhKxU8ytXuf9SaNh9DNqnX0pBIC2miN Oykw== 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=7fg6HCxs6YpFo/+46boIzya1hKfktdzojAtH+afSJyQ=; b=8SJxntMib3BmIJlMvAxqi36tYYP/Uuoj/JlrnAYBIO0TY6P3R+wfW0O8dEyhIrYjhG y2gcZyBhXgLkVC3iEujzYB/mYcfGKnK4yhnd86flaqjepY6UqcrIrq8bHoVUPMI0fM3w M4RohKLeuOeo/gJU6txXezV4bDWo80q1Rq1mHnJQxnbC97i3WtfwY4ycmqdipunX9UO1 P+j7T8BwvfwRWTBq90G17psaLGF/8gEPSVulFO6TGGn/2kQ7dxVEccijzEVW6FalEPLK EePu0nNmpELIAuDQKOFFN/4pqKuiam76D//Au8M196YdivGZ/PQ+QBsR02/UP6P777jz azAQ== X-Gm-Message-State: AO0yUKVIrmElAwhYrPqFzPYAYiSq2doVaX6KaJ6XuhvIBinxJxmOHT2I sgg0sTlCSpV0zg1E3JQj5DkjKkaithcTwNgg X-Google-Smtp-Source: AK7set+nPjQc+NySf/0HGsmAmLPQNFM8i/rDFL997S2BPuimChtlBhe2FWqr5/1lmfm5E5OagoblyQ== X-Received: by 2002:a05:6000:188b:b0:2c5:4e06:b689 with SMTP id a11-20020a056000188b00b002c54e06b689mr641490wri.28.1676905532987; Mon, 20 Feb 2023 07:05:32 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Gerd Hoffmann , Markus Armbruster , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH 3/9] hw/usb/hcd-ohci-pci: Use QOM type-safe cast conversion macro Date: Mon, 20 Feb 2023 16:05:09 +0100 Message-Id: <20230220150515.32549-4-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230220150515.32549-1-philmd@linaro.org> References: <20230220150515.32549-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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: pass client-ip=2a00:1450:4864:20::433; envelope-from=philmd@linaro.org; helo=mail-wr1-x433.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1676905620244100002 Use the PCI_DEVICE() QOM cast macros to avoid accessing internal fields. Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- hw/usb/hcd-ohci-pci.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/usb/hcd-ohci-pci.c b/hw/usb/hcd-ohci-pci.c index 6b630d35a7..3234408f1a 100644 --- a/hw/usb/hcd-ohci-pci.c +++ b/hw/usb/hcd-ohci-pci.c @@ -52,11 +52,11 @@ struct OHCIPCIState { static void ohci_pci_die(struct OHCIState *ohci) { OHCIPCIState *dev =3D container_of(ohci, OHCIPCIState, state); + PCIDevice *pdev =3D PCI_DEVICE(dev); =20 ohci_sysbus_die(ohci); =20 - pci_set_word(dev->parent_obj.config + PCI_STATUS, - PCI_STATUS_DETECTED_PARITY); + pci_set_word(pdev->config + PCI_STATUS, PCI_STATUS_DETECTED_PARITY); } =20 static void usb_ohci_realize_pci(PCIDevice *dev, Error **errp) --=20 2.38.1 From nobody Wed May 15 15:40:33 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1676905609; cv=none; d=zohomail.com; s=zohoarc; b=cqLbOmFTsU8Zvb0lM16qqbWm9zXBq/Z1ICoCQG2sQP7YbMSF3bxMZ66aBivjFkSsw8Rk0wSJZY/OeYP3r0C2/Qc4dQOapysUip7YEFjlGbrV0U4hG5tM+lotQxuGGM1AQBVF9ZlK5CckU+t+Zy3qmtkdOEEZzQuyC/LcLwxGwXc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1676905609; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=9u15jpuOfwEVXLJzjPb3b2l90e4PtdG+UU4bHmgsE5o=; b=WzY5BDThwauL2TeAjyBncf+9SXEwhPhnVAozj6DizDK44Emmqw2rqcPN2Vq0uykrZ1iaUulDo8uKqYBgfIRIqiunFLZwNq9CADsHwJGetqrCq1MljVXioYc0rSW+PstseIuIWvWq7mNMk2gcx8rB/ybXKhvsCK+zc8bUV+auxZ4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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 1676905609511461.7531885336458; Mon, 20 Feb 2023 07:06:49 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pU7jd-0001eX-UK; Mon, 20 Feb 2023 10:05:47 -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 1pU7jY-0001YY-Gc for qemu-devel@nongnu.org; Mon, 20 Feb 2023 10:05:40 -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 1pU7jW-0008Pc-Px for qemu-devel@nongnu.org; Mon, 20 Feb 2023 10:05:40 -0500 Received: by mail-wr1-x434.google.com with SMTP id c5so2230289wrr.5 for ; Mon, 20 Feb 2023 07:05:38 -0800 (PST) Received: from localhost.localdomain ([81.0.6.76]) by smtp.gmail.com with ESMTPSA id j27-20020a5d453b000000b002c577e2fc87sm3633703wra.15.2023.02.20.07.05.36 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 20 Feb 2023 07:05:37 -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=9u15jpuOfwEVXLJzjPb3b2l90e4PtdG+UU4bHmgsE5o=; b=RMWeA/1DUNU/mSgesZKESsaWE52KJLBrIkDhh1pCFUt79cs1JsT/nDsjR2GYaP58Hh RfX72N1TNOT40w69PJbWrQTomzhIQudyKWB3vBuBKhFi4wTzSC5V6GxZv72MCdAd9X3G ZfgqdccPB1fJBJqNKcvIcR/i8sr48jeJFmXUrT4ugVP/gNGpqlyFvjcGN83nS8cFU9EE G+f2ZvEwVSbJ+xkrzdGP45EYJgoqUFnn9GR5urH5Z+zNyS6siUbEOLLjGH4Hu2noPj3o wHkUr/XjbR3UbBLWkQc/EdSulcWIzbXjwozdmZE/dM45SlIm+IGU3MXK5WsT0VdK7zdP dDRw== 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=9u15jpuOfwEVXLJzjPb3b2l90e4PtdG+UU4bHmgsE5o=; b=meqqfkxqgZytHSDfx9EpoTXd+4tBDjK5JFq6r/1FjoeMHB+U3RdAWy9jvwoBHDGM+1 AFOYZuClORtC51su032yR/MBBNkmIKhdRQwld7FXAXLuWsOH/1tOfNq4EktS1CzLtxVy Xfno6QzWO6/T8h2i69h7yh7KlQNzAfaXvecjZ1OJON9d0dqPbGqmB67qwuIRSHj4ggQv x1Mr021+6Hcs94kiry41KMYL/K0aMHZrWk5X5UdtRkthMrwF5Jc6cWbYAlM4xPj5dCya dcQ1y1vFNgXJMOK4pGNP0i/Z6A+lfPMyeDsPgIzNTCWtwUc28FO0xSbCV3aawpPK9NXM GdEA== X-Gm-Message-State: AO0yUKUOOa4LQmsDs2jtldJYAIOc7zU87moZ8CrNZmKgyWNYWpd4w2HG 6izEwSU8IkJKAI4L4zctQ91QsqzKpfsE44fW X-Google-Smtp-Source: AK7set8HLzg7NSMDXpDZ57qoK9yCAD7LIX3SYBPyoMK8yCBmoqe17Mozgr7+GqXTQrEw3JUzszqfzg== X-Received: by 2002:a05:6000:2cf:b0:2c5:5313:9d19 with SMTP id o15-20020a05600002cf00b002c553139d19mr840769wry.26.1676905537867; Mon, 20 Feb 2023 07:05:37 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Gerd Hoffmann , Markus Armbruster , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH 4/9] hw/usb/hcd-uhci: Declare QOM macros using OBJECT_DECLARE_TYPE() Date: Mon, 20 Feb 2023 16:05:10 +0100 Message-Id: <20230220150515.32549-5-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230220150515.32549-1-philmd@linaro.org> References: <20230220150515.32549-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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: 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1676905610307100003 The automatic conversion done during commit a489d1951c ("Use OBJECT_DECLARE_TYPE when possible") missed this model because the typedefs are in a different file unit (hcd-uhci.c) than where the DECLARE_INSTANCE_CHECKER() is (hcd-uhci.h). Manually convert to OBJECT_DECLARE_TYPE(). Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson --- hw/usb/hcd-uhci.c | 2 -- hw/usb/hcd-uhci.h | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/hw/usb/hcd-uhci.c b/hw/usb/hcd-uhci.c index 30ae0104bb..f77ffda69a 100644 --- a/hw/usb/hcd-uhci.c +++ b/hw/usb/hcd-uhci.c @@ -60,9 +60,7 @@ enum { TD_RESULT_ASYNC_CONT, }; =20 -typedef struct UHCIState UHCIState; typedef struct UHCIAsync UHCIAsync; -typedef struct UHCIPCIDeviceClass UHCIPCIDeviceClass; =20 struct UHCIPCIDeviceClass { PCIDeviceClass parent_class; diff --git a/hw/usb/hcd-uhci.h b/hw/usb/hcd-uhci.h index e0fdb98ef1..69f8b40c49 100644 --- a/hw/usb/hcd-uhci.h +++ b/hw/usb/hcd-uhci.h @@ -75,7 +75,7 @@ typedef struct UHCIState { } UHCIState; =20 #define TYPE_UHCI "pci-uhci-usb" -DECLARE_INSTANCE_CHECKER(UHCIState, UHCI, TYPE_UHCI) +OBJECT_DECLARE_TYPE(UHCIState, UHCIPCIDeviceClass, UHCI) =20 typedef struct UHCIInfo { const char *name; --=20 2.38.1 From nobody Wed May 15 15:40:33 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1676905568; cv=none; d=zohomail.com; s=zohoarc; b=Br8QYYr6twJ65p1Qwg0UZ8taMUBoQO14Q4UkmLz13GCGnrb8APSmmcumXePxsW5FFJRwJinAThV/90dfRoU4ZVSWY5fwUdNGguDggI0mxTMtYVnNQRHGR2UZdfy08AS4Dd84dDxauEJP54Hk2E4VerHVw8jh+/vY8NKJC6bWfwM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1676905568; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=HSfxvXTslGwoUF9ppy8jNQv5yhLKiCPbveanE20/VQs=; b=RutZiw1kuG9mDjgJsZXFUvaci3fwnnhdqF37btqZVV8hhDxwl0Z/ajHso+OkShIgSQNjI+uwPVwRNgQtBhKR660LtvqffqR+1MNBYerVNnDXhKxD4EiADm56uCqyTrdrtIeUljKBnvvwCl7VqTMp62gw6KycnjeQ6V54w/q+/OY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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 16769055685371007.8316231956165; Mon, 20 Feb 2023 07:06:08 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pU7jg-0001ka-P2; Mon, 20 Feb 2023 10:05:48 -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 1pU7je-0001fL-Dw for qemu-devel@nongnu.org; Mon, 20 Feb 2023 10:05:47 -0500 Received: from mail-wm1-x32f.google.com ([2a00:1450:4864:20::32f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pU7jc-0008Re-4x for qemu-devel@nongnu.org; Mon, 20 Feb 2023 10:05:46 -0500 Received: by mail-wm1-x32f.google.com with SMTP id az11-20020a05600c600b00b003dc4fd6e61dso1341371wmb.5 for ; Mon, 20 Feb 2023 07:05:43 -0800 (PST) Received: from localhost.localdomain ([81.0.6.76]) by smtp.gmail.com with ESMTPSA id o6-20020a05600c4fc600b003dd8feea827sm11410074wmq.4.2023.02.20.07.05.41 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 20 Feb 2023 07:05:42 -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=HSfxvXTslGwoUF9ppy8jNQv5yhLKiCPbveanE20/VQs=; b=H5DJbPwlSHr0wxelY67ABoyZ5fFi2vxf492DyO97aoWKec/4XhNG7oNSHr3YbGemn0 d5PjctjHVY/FMvnoYgOlqNi1CbCsFAiZIQuADtA2cNbAZR54t1zWzZzYbjXNh2Dy7+1b /3fAgH7PMlMB9HPKYufAkyI1hrdVnyJN6BpN7LSIjgd7jpJgJm4cxb7lTkGBDMPGUteo NZe+2mBePix6VGKDQ5rYRp6ctdHZzlx0JZJG1XVdXpv2PXI44mgP2V1+3DGpM639bS7p FPc5+ZrBqHPiQ81g/yr0ki+2LDcXxng9R5qKrZutdIJdRz5iiVogXqGDxe2HQCWcq/wu CvOQ== 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=HSfxvXTslGwoUF9ppy8jNQv5yhLKiCPbveanE20/VQs=; b=CS9foG5n4wSEWGxhNrMQEfhQQ2igXU5+x5W5VGUrDtb0FEiYfamhuFlcinCHR4kK8W LkfoodEBFMIdPoOPigaspkM2ZyeFK2lE1/DixU67KLpTODIa6nqxSBFokdAhgTSyzM+v dL/1uC4+2MLW7jG0PDE0ZFRzZCqDZ+jzGB66pD0K6Mh/akfb/7Y5I07bLmNwUOP6/CwZ lYKu0fS5WNjwebwsX6zclAVSjmuBltIWcgQlUS/c4sqFJOl3TmOV2lvH3BRgzgQgkwpc dTtEg6lgoJFKb/D/03W+7iLme1eGbdfaErxqkgKBdP5NhQD4jirtDoQRJorwLduYX6yA z3Fw== X-Gm-Message-State: AO0yUKWgIrmEBz/Jh7+zdEu9HccG/vyqxWGBaZG5lMTz6i18BqTJeh/W 1zJBDzaRcxsGJu9W7FaqAa9XflRQpPwGnJi7 X-Google-Smtp-Source: AK7set+6A+Q790Cz/ezfBwA3kZRIfVW0Jg9iHiYM4XQ8fOg2o+7MMfNUvKoyYcWsv/arfdBFwmhVcw== X-Received: by 2002:a05:600c:331f:b0:3dc:19d1:3c13 with SMTP id q31-20020a05600c331f00b003dc19d13c13mr375070wmp.12.1676905542630; Mon, 20 Feb 2023 07:05:42 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Gerd Hoffmann , Markus Armbruster , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH 5/9] hw/usb/hcd-uhci: Replace container_of() by UHCI_GET_CLASS() QOM macro Date: Mon, 20 Feb 2023 16:05:11 +0100 Message-Id: <20230220150515.32549-6-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230220150515.32549-1-philmd@linaro.org> References: <20230220150515.32549-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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: pass client-ip=2a00:1450:4864:20::32f; envelope-from=philmd@linaro.org; helo=mail-wm1-x32f.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1676905569873100003 By using the QOM UHCI_GET_CLASS() cast macro we don't to use the intermediate PCIDeviceClass variable. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson --- hw/usb/hcd-uhci.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/hw/usb/hcd-uhci.c b/hw/usb/hcd-uhci.c index f77ffda69a..8ac1175ad2 100644 --- a/hw/usb/hcd-uhci.c +++ b/hw/usb/hcd-uhci.c @@ -1159,8 +1159,7 @@ static USBBusOps uhci_bus_ops =3D { void usb_uhci_common_realize(PCIDevice *dev, Error **errp) { Error *err =3D NULL; - PCIDeviceClass *pc =3D PCI_DEVICE_GET_CLASS(dev); - UHCIPCIDeviceClass *u =3D container_of(pc, UHCIPCIDeviceClass, parent_= class); + UHCIPCIDeviceClass *u =3D UHCI_GET_CLASS(dev); UHCIState *s =3D UHCI(dev); uint8_t *pci_conf =3D s->dev.config; int i; @@ -1267,7 +1266,7 @@ void uhci_data_class_init(ObjectClass *klass, void *d= ata) { PCIDeviceClass *k =3D PCI_DEVICE_CLASS(klass); DeviceClass *dc =3D DEVICE_CLASS(klass); - UHCIPCIDeviceClass *u =3D container_of(k, UHCIPCIDeviceClass, parent_c= lass); + UHCIPCIDeviceClass *u =3D UHCI_CLASS(klass); UHCIInfo *info =3D data; =20 k->realize =3D info->realize ? info->realize : usb_uhci_common_realize; --=20 2.38.1 From nobody Wed May 15 15:40:33 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1676905622; cv=none; d=zohomail.com; s=zohoarc; b=M2wApQG5jOhqFRrLzR8cCd4B9D7rh7FDP3RdcOY3SdT43Ku1pJNQ7VsDeoApvDaOZBwTyVKw+z14FyrkLT2vC2AsVv70C0kr8oyQ16Q2vDHM4uz9A88f5TvxAxvaNoocxf+omnlubPO4mPapA451QiZ/9i8Z/nLnfkkTNfOUmF8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1676905622; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=tJz+z2UXP9NxFKN85KXZvfj6u/KvvDw8qw3Z2QL+l+I=; b=khr9/xQzt+r/zDnGZsH8zFkgzcUDBqQIjrPWyJhSU8AEmiYngEOitFxRYTsWZ46BOFa90pKAmxj2DotEaR2q5fReI50/qZuPtpgnYt1eLI5KLzETFl6b6g6NjupkUzNpcvTD3PONuX4dJsqf3i6EH2BEBiJusacQ2PepmXLr5pw= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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 1676905622890406.8273327193972; Mon, 20 Feb 2023 07:07:02 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pU7ji-0001lK-QC; Mon, 20 Feb 2023 10:05:50 -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 1pU7jh-0001l7-T7 for qemu-devel@nongnu.org; Mon, 20 Feb 2023 10:05:49 -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 1pU7jg-0008Pc-EF for qemu-devel@nongnu.org; Mon, 20 Feb 2023 10:05:49 -0500 Received: by mail-wr1-x434.google.com with SMTP id c5so2230800wrr.5 for ; Mon, 20 Feb 2023 07:05:48 -0800 (PST) Received: from localhost.localdomain ([81.0.6.76]) by smtp.gmail.com with ESMTPSA id a16-20020adffb90000000b002c54c92e125sm829142wrr.46.2023.02.20.07.05.46 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 20 Feb 2023 07:05:47 -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=tJz+z2UXP9NxFKN85KXZvfj6u/KvvDw8qw3Z2QL+l+I=; b=mMMpzKV20DvNI1a+ue0uObqkkE1zAFwtyqVEDHQ8AHLGErcvNa3Os8lAL3aCZRJWln 2KSmeW9ijG9Y+hz+C/0C0wdvCXGR6aHSQVhOZduWVyyoj5zQzP5zGG5Waiorrw/DCV1o O6+fT6QGkWKIg4RZ66pIlRXhbBRJeU95YG0KtTs0OHWYRskTViwuFGBzRwZJxIBuJa6p StX9kpXU58hlgp12BoTOK7EJJKUuHa0yKU/nyHM+8ZEZWXDJu6AUu1cDBn2MzDN3mJwr 7QQTR9ix9pebdWMyPjbrVntfYxUdqje4Guw1Ex0AfS1RELLdk6EsGhGj8p12fVRABFTl FxBg== 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=tJz+z2UXP9NxFKN85KXZvfj6u/KvvDw8qw3Z2QL+l+I=; b=79fO5GLV7e1L5QoYGY8oa8t4oZpH8XM984CoeWQWahTmUuqZAceFISeskbQlk46vZE UKvRERnTDhd5PvtgWSBY664J1rW3h/iAKZxDy67oyGL+kLEgtKB16CHdesGN6G0gYihF /dOCL8nSj7UXzxav1rCDFhI0a0x8LJ0grllUYtakMpG2MWWkzRfkzhPiutDGEvJbpCGQ Ni29yvAO3NPmEVnk2NmlB5JR73XSnw0sO+r3b7hTbZl4ua12VqcEn21FuqVy4htSkG0f PhPysa/jSpTUfLb5YE0jxE/CSnEiNO0Ii2dbcmXH6+9tSZuFGdlzRpgMmNpW0CQhmsIh qFCA== X-Gm-Message-State: AO0yUKW0tkt6lKoe7svJLpu/kNfRBjVxW4l1XD45yZUIXhsg4pAx8XM0 f2Vu/JMxQU+LPh8IRZeAj4OjetTcLynOCwXw X-Google-Smtp-Source: AK7set+WzoYHRkfC+EtMMFfvWQRjVs4gxX47NIOqH0Wu/fRz4inJtbd3dWhDi4MVJval4oDbELx4Rg== X-Received: by 2002:adf:eac6:0:b0:2c5:53e6:9aba with SMTP id o6-20020adfeac6000000b002c553e69abamr1578216wrn.5.1676905547616; Mon, 20 Feb 2023 07:05:47 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Gerd Hoffmann , Markus Armbruster , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH 6/9] hw/usb/hcd-xhci-nec: Declare QOM macros for NEC_XHCI Date: Mon, 20 Feb 2023 16:05:12 +0100 Message-Id: <20230220150515.32549-7-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230220150515.32549-1-philmd@linaro.org> References: <20230220150515.32549-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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: 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1676905624255100002 NEC_XHCI is a QOM object type. Declare its macros / typedefs using OBJECT_DECLARE_SIMPLE_TYPE(). Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson --- hw/usb/hcd-xhci-nec.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/hw/usb/hcd-xhci-nec.c b/hw/usb/hcd-xhci-nec.c index 13c9ac5dbd..d732be0ef9 100644 --- a/hw/usb/hcd-xhci-nec.c +++ b/hw/usb/hcd-xhci-nec.c @@ -27,14 +27,16 @@ =20 #include "hcd-xhci-pci.h" =20 -typedef struct XHCINecState { +OBJECT_DECLARE_SIMPLE_TYPE(XHCINecState, NEC_XHCI) + +struct XHCINecState { /*< private >*/ XHCIPciState parent_obj; /*< public >*/ uint32_t flags; uint32_t intrs; uint32_t slots; -} XHCINecState; +}; =20 static Property nec_xhci_properties[] =3D { DEFINE_PROP_ON_OFF_AUTO("msi", XHCIPciState, msi, ON_OFF_AUTO_AUTO), --=20 2.38.1 From nobody Wed May 15 15:40:33 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1676905626; cv=none; d=zohomail.com; s=zohoarc; b=YNFCnIBfb7uzDp3uHWK2YeGYI2ySX9rjKKrxPz/Wu9RwVpviOfPgArBKtLdNDWKXwJctHbzBIgPWJc9WzDJ648WFiuO76vgGewZP+6K5ZJhxyXOhxoscp6FEsjrdi3B9I+yTw8ofKh1jvIJzj1ldXrkg7XpmVsGClDfF6en9mQ8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1676905626; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=p8o9rMHYIWugBzDHKzJd9qgUvI0GxAA+Ds+7D1kDUBM=; b=Nstq6jmG+KVEszI9ghDLazpjCBQwo25z7MpOuJfYXg15smqTaa1TD3hs3CtUm1QXVXAYM2i6VchE5FXk8SoQpWQ84SdfOA76pejKHRHqDx624TeeC2gKr4QU5Wss0vzEbTl1lXGV2Te14ajKudbNFYkmcODvRZHkaxoPWqxqeQE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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 1676905626763866.8079147061015; Mon, 20 Feb 2023 07:07:06 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pU7k5-00023q-Ds; Mon, 20 Feb 2023 10:06:15 -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 1pU7jn-0001oh-Qw for qemu-devel@nongnu.org; Mon, 20 Feb 2023 10:05:57 -0500 Received: from mail-wr1-x42f.google.com ([2a00:1450:4864:20::42f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pU7jm-0008U6-8s for qemu-devel@nongnu.org; Mon, 20 Feb 2023 10:05:55 -0500 Received: by mail-wr1-x42f.google.com with SMTP id v3so1462948wrp.2 for ; Mon, 20 Feb 2023 07:05:53 -0800 (PST) Received: from localhost.localdomain ([81.0.6.76]) by smtp.gmail.com with ESMTPSA id t5-20020adfdc05000000b002c556f36116sm4133914wri.66.2023.02.20.07.05.51 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 20 Feb 2023 07:05:52 -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=p8o9rMHYIWugBzDHKzJd9qgUvI0GxAA+Ds+7D1kDUBM=; b=dXKm87OvSP5t8PW1VhPsHLOYT9xOV5RBpPkg0viuHrxaBLSMDwyK9WyS0P0WvJqq9Z nQsJKmGynhhaoa3VULViKj/X0t9nQY646RqArIXdw1aUFzRtYvxNu9YOJUOtbaOd505p lbldkY5rmBe5CfTSI6cwQqxASSh20HdkVf22RRS70SdgtNFPA3Fotx2tXKGh93VRHkkI BoVJYmeKXcL2LbeNVOAhJeJAD01yV1v2daZ7s75rmDBnCt25f16lGOmzICUZmfv9RcbR BbDjbi1p5Lk97pgBXCnQqxJ3FSc+7KO0FlQCFneeYgisWyLAVeXxkaXUFTIvqVcjWMzp cnLA== 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=p8o9rMHYIWugBzDHKzJd9qgUvI0GxAA+Ds+7D1kDUBM=; b=FKaCncCYz3EPq/Dunz3KrCEsGqVNkeh4tGgEN9gBGEjVQxXgjazY7pCqrdy4r1qjsk Kw3xlgBFALaWjAaPsn1dcdTK5i+WwMsDC3Ca16xgndcbotxoPKGCZunw1JU77pXSnRpU 85zIoTXjnYPU47uZB5q5kVgAGJkavJCiR0aS7m6C3lZF7kj+97k0OYU27AyMPiGu42Hh FwskH96jJgO9HAj8gvNjvc3TeikJsAOKJ6RWyHa4UpaXSQcaQ7Xwo0znOX7da+1wr6Ib ZjoDydNP5MoVxe2b/kzi5uP0ZbTheSDVp5AlN4CrnT7rrij+m3R9gYT9r4ZBYLoHVeF9 z0oA== X-Gm-Message-State: AO0yUKWqb4tuDJZ5jvpIcEJWSXDRtBea3ITJc9U52ZXb8voOp7N9uz7p W143ma7plCNvTSg3mphm8/HhNfx3ZhM+FFHq X-Google-Smtp-Source: AK7set+Fr+RlRaTSgA1TIOlDInqd6M5dPOqikpRdcBaMu0dyb4K5F0wuH0UHZvPQR0zDqTnIrIcXiQ== X-Received: by 2002:adf:ee43:0:b0:2c5:afce:6080 with SMTP id w3-20020adfee43000000b002c5afce6080mr334045wro.12.1676905552497; Mon, 20 Feb 2023 07:05:52 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Gerd Hoffmann , Markus Armbruster , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH 7/9] hw/usb/hcd-xhci-nec: Replace container_of() by NEC_XHCI() QOM cast macro Date: Mon, 20 Feb 2023 16:05:13 +0100 Message-Id: <20230220150515.32549-8-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230220150515.32549-1-philmd@linaro.org> References: <20230220150515.32549-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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: pass client-ip=2a00:1450:4864:20::42f; envelope-from=philmd@linaro.org; helo=mail-wr1-x42f.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1676905628289100009 Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson --- hw/usb/hcd-xhci-nec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/usb/hcd-xhci-nec.c b/hw/usb/hcd-xhci-nec.c index d732be0ef9..328e5bfe7c 100644 --- a/hw/usb/hcd-xhci-nec.c +++ b/hw/usb/hcd-xhci-nec.c @@ -53,7 +53,7 @@ static Property nec_xhci_properties[] =3D { static void nec_xhci_instance_init(Object *obj) { XHCIPciState *pci =3D XHCI_PCI(obj); - XHCINecState *nec =3D container_of(pci, XHCINecState, parent_obj); + XHCINecState *nec =3D NEC_XHCI(obj); =20 pci->xhci.flags =3D nec->flags; pci->xhci.numintrs =3D nec->intrs; --=20 2.38.1 From nobody Wed May 15 15:40:33 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1676905625; cv=none; d=zohomail.com; s=zohoarc; b=K2vR4BTOVGFeGQOpf8oSJ90eWyRX8ivaJ0hM/wK4F5ILxMGMQKp0y4ypT6kWq9PD4/uQWuZKbMePku/6ytFJFYUHK8IapKXinFtW88PAn0LZ441NarKXyL95Cd8pbSNLIN7onIkrSBO2ZJYocUTx7O3KB7qbEq8CSMw0N0WdYtw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1676905625; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=Rwk3S75FdqWeTle70LswE0cg7wHk0orFnQPLyZ5g350=; b=jRAbbu89HX41b/Nz1RnmA9wWw9ilU3m9b5fXY4BrZf8JVt+EF3Bkh0vL/hiKnqv7sZ3v6IhfiIrnK70A+9WL83teSdgcoMoj9+w4Xw/g+XlCM39T9gFfJXvrLYl1VjswydQgROr1b4mDE6MvYIImmmL+D3IhpCArINmMw33itQk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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 1676905625436396.8329733871492; Mon, 20 Feb 2023 07:07:05 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pU7k9-0002G0-QS; Mon, 20 Feb 2023 10:06:19 -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 1pU7ju-0001t1-FI for qemu-devel@nongnu.org; Mon, 20 Feb 2023 10:06:10 -0500 Received: from mail-wr1-x429.google.com ([2a00:1450:4864:20::429]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pU7js-0008Um-RI for qemu-devel@nongnu.org; Mon, 20 Feb 2023 10:06:02 -0500 Received: by mail-wr1-x429.google.com with SMTP id bo30so983088wrb.0 for ; Mon, 20 Feb 2023 07:05:59 -0800 (PST) Received: from localhost.localdomain ([81.0.6.76]) by smtp.gmail.com with ESMTPSA id y1-20020adff141000000b002c58f199a49sm11428923wro.117.2023.02.20.07.05.56 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 20 Feb 2023 07:05:57 -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=Rwk3S75FdqWeTle70LswE0cg7wHk0orFnQPLyZ5g350=; b=rdS4B/WCFnvVO5TKYbKcoQK/WeA9T17pLMTOkt3wcMDJbyTNGZo2NcMKcZMLFztdlY Nw0vyvHeN8wnYCYBixoHw50+uYX10oNRlj+tKB+zVkJVXDO/58oOljosON5Z6/CHx3rx k6fwLBMUtYt1vrcO97UAlGu6kUCN82ov+wRzh00nBd/UlG3sRVI7ejix9TNIAYyyrdxv fgoSkLXVdl//8JWnWjf84YOGRvoYu5MGWmR85r1BNL3Rw8E/tsZU9fd6ANL9aAhjHm7D /QdnTeAl+JyYi8BjGWcDMKU+vYI35wNTxak8GHNTQIw3xRkS6mCtgvEwYOms1y2OJciw Yz0g== 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=Rwk3S75FdqWeTle70LswE0cg7wHk0orFnQPLyZ5g350=; b=rEiz/kF+n7eyzGWFct5NU9cKUhwYZuJ4WUPX88HKVPRtIesucOHlJ0kA/d9cQfKTuw DEueZXXDksKUReqwRkZPIECjk6xy79XpvqMiOwrGHglZixd81yLHGz3iTyPgVbKl241v MXFTQMSRS7oDFhLoMtv3ToEJvBDLnJb9wmANhnmeshVuvFJItJ0T6snC2pFRYxEibiD7 ThLEzQyPTbwSWhLaBSiv0Nz/95T0K8jBSf/ShktCAlTnW6Z4Ys8rh8Asf6gbW/hXnTcB OlIEmSLhjWTIlPlL2L0N4U9mHOoGN/lOdCpw/rYFL2e8uf9Y3+PxL0Be5HZkzPlxTZ+Z VJIw== X-Gm-Message-State: AO0yUKU78PK6a4RGKK/1UPESdceElQkNPCFtv5Qg/eAIwG6GFzRPO4Am CaDBXZjlvBtCT8YzP3hFI12zWNMcHhnWZ5H7 X-Google-Smtp-Source: AK7set/roX5wuRRwTdlRtsijr0lBSa2FsN9FX7wsbjw+iSMlCc43HtDgsjOEbxL4OFAUigSTvwrD3g== X-Received: by 2002:adf:fc12:0:b0:2c3:e20b:82aa with SMTP id i18-20020adffc12000000b002c3e20b82aamr1973309wrr.22.1676905557565; Mon, 20 Feb 2023 07:05:57 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Gerd Hoffmann , Markus Armbruster , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH 8/9] hw/usb/u2f: Declare QOM macros using OBJECT_DECLARE_TYPE() Date: Mon, 20 Feb 2023 16:05:14 +0100 Message-Id: <20230220150515.32549-9-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230220150515.32549-1-philmd@linaro.org> References: <20230220150515.32549-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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: pass client-ip=2a00:1450:4864:20::429; envelope-from=philmd@linaro.org; helo=mail-wr1-x429.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1676905626317100005 hw/usb/u2f.h was added by commit 80e267f1d1 ("hw/usb: Add U2F key base class"), almost the same time of the automatic conversion done by commit c821774a3b ("Use OBJECT_DECLARE_TYPE where posible"). Manually convert to OBJECT_DECLARE_TYPE(). Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson --- hw/usb/u2f.h | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/hw/usb/u2f.h b/hw/usb/u2f.h index a408a82927..8bff13141a 100644 --- a/hw/usb/u2f.h +++ b/hw/usb/u2f.h @@ -31,22 +31,16 @@ #define U2FHID_PACKET_SIZE 64 #define U2FHID_PENDING_IN_NUM 32 =20 -typedef struct U2FKeyState U2FKeyState; typedef struct U2FKeyInfo U2FKeyInfo; =20 #define TYPE_U2F_KEY "u2f-key" -#define U2F_KEY(obj) \ - OBJECT_CHECK(U2FKeyState, (obj), TYPE_U2F_KEY) -#define U2F_KEY_CLASS(klass) \ - OBJECT_CLASS_CHECK(U2FKeyClass, (klass), TYPE_U2F_KEY) -#define U2F_KEY_GET_CLASS(obj) \ - OBJECT_GET_CLASS(U2FKeyClass, (obj), TYPE_U2F_KEY) +OBJECT_DECLARE_TYPE(U2FKeyState, U2FKeyClass, U2F_KEY) =20 /* * Callbacks to be used by the U2F key base device (i.e. hw/u2f.c) * to interact with its variants (i.e. hw/u2f-*.c) */ -typedef struct U2FKeyClass { +struct U2FKeyClass { /*< private >*/ USBDeviceClass parent_class; =20 @@ -55,12 +49,12 @@ typedef struct U2FKeyClass { const uint8_t packet[U2FHID_PACKET_SIZE]); void (*realize)(U2FKeyState *key, Error **errp); void (*unrealize)(U2FKeyState *key); -} U2FKeyClass; +}; =20 /* * State of the U2F key base device (i.e. hw/u2f.c) */ -typedef struct U2FKeyState { +struct U2FKeyState { USBDevice dev; USBEndpoint *ep; uint8_t idle; @@ -70,7 +64,7 @@ typedef struct U2FKeyState { uint8_t pending_in_start; uint8_t pending_in_end; uint8_t pending_in_num; -} U2FKeyState; +}; =20 /* * API to be used by the U2F key device variants (i.e. hw/u2f-*.c) --=20 2.38.1 From nobody Wed May 15 15:40:33 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1676905611; cv=none; d=zohomail.com; s=zohoarc; b=JMXi7ZmIRSt5Cxq2SLFIu0E8HWYbs4uPXkTAJaopa1CAU0H6kYuTmz/I6qZ1/OXB6cNwhbS4Ajy+b6oDF0wK86aDbhjXIF4eXgA2ta4HExfAj7VAPwrQa8x+xOUafjkntSCVrtXYMd/fu/Dn1GAxAKZ7IfSuuU/D3AO5FhtK1Ow= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1676905611; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=qkM29ZYnS80tOuTl6ndvH0Cr2j3m8kabXDaXkwn7EWs=; b=MaQoOtNIFOGd1vLSkHkSHZ8ZzLCYKa9YgU/Vqgxw64P0OTjnnN5sEsDT4WooRIgTqQ0qvYUyBkmLWA5kKxBvKnltDd9YLKR6PnEYMY6uyu4clAvhE9JCiWLOlUvWOZK3bWifZbAKbD2jRyX6r1pZsCRReJZSPsb0SENs/dghL5A= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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 1676905611422465.82009549663746; Mon, 20 Feb 2023 07:06:51 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pU7kH-0002UG-NB; Mon, 20 Feb 2023 10:06:25 -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 1pU7k0-00024M-J5 for qemu-devel@nongnu.org; Mon, 20 Feb 2023 10:06:11 -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 1pU7jy-0008VO-DZ for qemu-devel@nongnu.org; Mon, 20 Feb 2023 10:06:08 -0500 Received: by mail-wr1-x42d.google.com with SMTP id t13so1467229wrv.13 for ; Mon, 20 Feb 2023 07:06:03 -0800 (PST) Received: from localhost.localdomain ([81.0.6.76]) by smtp.gmail.com with ESMTPSA id p9-20020adfce09000000b002c5493a17efsm12617632wrn.25.2023.02.20.07.06.01 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 20 Feb 2023 07:06:02 -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=qkM29ZYnS80tOuTl6ndvH0Cr2j3m8kabXDaXkwn7EWs=; b=xV0y1/nXiJXWfsgXH359JNNC1H61ZrNTma9hfWvppEhSx3TrrIB3NA+T0u0DfoJq9Q wTxmtTBiXERCPC1cX0rj3CenoO2V11GEtWpN61Rfo9XAJFJk+LVRKmFNHJMHn2ZyT+1C PiMoEFzMV6/aH7vM27DCiMxLjBcjBXSoKQSJ6LBSS3W0ke2jl6dffJOM8khHiF1WWorK VVAV7Iq8r+9aMaCGG50aWJByqYd3xtRT21FVC9A6lLt6vQ3R/mtOx5zrp0jn6WRhAvhJ tXqCfklNEydlZQjVHVHP/o1BSgy3ENXSN1SfNtJJuFLiUo6Zx5ya1LNu5CzjWKOFEh4t mmOg== 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=qkM29ZYnS80tOuTl6ndvH0Cr2j3m8kabXDaXkwn7EWs=; b=uoUlw4orzE3Fbg/1WgSCCAV0qWcoPjlEhYMsILhKGPLcPQtlrnZYAoH2rTbCG1nD9A UDdlpHWnaC+GLHo8FA6ff7Dmz77axT7+6SlMGTu4JeJJwwka7jEjtqjUwC6DL8VNAJU0 K8VNLoNvAkxD/Yhgjnb29XBPwuPzrmThUxphM5CO0m/B1UwFZwyc/Cl8+CUF/sjOWPhe Ke6kVbKdGdEqTXgaOuCfX6UzlxVKX1TaZmAg9T1a8IVqKpBl/07U38sOjCaMrGKUk1Cy MEvKzyIsQXxGSYyY2Gbkk13T8TL0hYNrWLpolBMIKEfXKQpGCBmkVXfCop8v/fzd7w9o FLmA== X-Gm-Message-State: AO0yUKWGDVlHwv34ocMY3DPdd/QsqwZA3surMw5Bv63yoPLKL8P0UlBr Q7SZGdsd65tE6F/CutDWKiQ7odzbyGQetluD X-Google-Smtp-Source: AK7set+ZQetSGsq8kf85jT4wjshhQOk6OFSxAKh4s69hJtKvpOlaO0KxjTOCUha+vSv6CreEQih36w== X-Received: by 2002:a5d:4610:0:b0:2c5:98f2:5b16 with SMTP id t16-20020a5d4610000000b002c598f25b16mr3257738wrq.1.1676905562416; Mon, 20 Feb 2023 07:06:02 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Gerd Hoffmann , Markus Armbruster , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH 9/9] hw/usb/u2f-passthru: Use QOM type-safe cast conversion macros Date: Mon, 20 Feb 2023 16:05:15 +0100 Message-Id: <20230220150515.32549-10-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230220150515.32549-1-philmd@linaro.org> References: <20230220150515.32549-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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: 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=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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1676905612205100006 Use the QOM cast macros to avoid accessing internal fields. Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- hw/usb/u2f-passthru.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/hw/usb/u2f-passthru.c b/hw/usb/u2f-passthru.c index fc93429c9c..b99c0b622f 100644 --- a/hw/usb/u2f-passthru.c +++ b/hw/usb/u2f-passthru.c @@ -299,7 +299,7 @@ static void u2f_passthru_recv_from_host(U2FPassthruStat= e *key, if (transaction->resp_size >=3D transaction->resp_bcnt) { u2f_transaction_close(key, cid); } - u2f_send_to_guest(&key->base, packet); + u2f_send_to_guest(U2F_KEY(key), packet); } =20 static void u2f_passthru_read(void *opaque) @@ -316,9 +316,10 @@ static void u2f_passthru_read(void *opaque) =20 ret =3D read(key->hidraw_fd, packet, sizeof(packet)); if (ret < 0) { + USBDevice *udev =3D USB_DEVICE(key); /* Detach */ - if (base->dev.attached) { - usb_device_detach(&base->dev); + if (udev->attached) { + usb_device_detach(udev); u2f_passthru_reset(key); } return; --=20 2.38.1