From patchwork Mon Feb 20 15:05:08 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: 655092 Delivered-To: patch@linaro.org Received: by 2002:adf:9bcd:0:0:0:0:0 with SMTP id e13csp1447373wrc; Mon, 20 Feb 2023 07:05:46 -0800 (PST) X-Google-Smtp-Source: AK7set8ekB3dzVFTufVAebqB9twrWGWnAgUlYHiQDiB03YVzNxuNIZdv25F2o90u+ov4aDUQ22Kb X-Received: by 2002:a05:6214:2027:b0:571:f87:a665 with SMTP id 7-20020a056214202700b005710f87a665mr4126262qvf.35.1676905545928; Mon, 20 Feb 2023 07:05:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1676905545; cv=none; d=google.com; s=arc-20160816; b=OXqqpFiYcBVUG+zEmTJ2MtqbDn3BxO34ZUZUnhY1kMMlbUmXPYVHe0MDf22KQXNjrH b3FkeDI9G8OcRin3b9Ju5LRrgpQL7sUGzvzhiPa0tZBOr1eNtsyc3Ohyczx6p/7cxTFD O8VvjBVrUoOyG3iY8xnaS3Np5+MvmNNpHHZKxlLDfLOx6zaoereZM7Zy1kjXBx3dS7qI nk/mGgpQSimhUAYMS7p61K7ZUf+bulDg3CCGnj0qNtCVKq0IJ7nqqfqOdrtnJ7KA4mEG mh7xkcnU9FwkSsz6JUrN6hRrdQpSyp+ofOIYFv4J0M3h1qIofQhmYC80mVUqZ003zstC JKmQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=WvQXFHkymgCugjl5w0M5Pkt74ouZE927KClvNUr2f1I=; b=BdxgIRr6hzRtAD+GOdM53DigqF86AYoMm0VBx5bY3ibpp3vrE4DZev7KRagwvV3pwT nSfX8ykVoCcSpcSZYx7WYbHkx+MrTx0lkH23RDe1MRBw//taEwvRjcqcIYRx+VjaMglj kssYzGKl8uzhLhkSjOAqG6I8O3iqCRydTJ30DY6q3ZaWS9SrIsmAHLtabgFa3Tg5l9zW DMWGQKByIyHylNt3pgfnb402/k0rZm9PE0nnjioB6EJpa0L5MD5xLDgPhb5ptdU8Xlq1 2QAVij3+eGIPCmGou9zComFOuEpPw3P29x2HBZ5uJapQpcqU5ub9bVqcnrjq+kZiGjF6 OhKA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=oNbyK5bm; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id q11-20020a0cf5cb000000b0056ea39b7a0csi1124840qvm.235.2023.02.20.07.05.45 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 20 Feb 2023 07:05:45 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=oNbyK5bm; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org 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) 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-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) 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) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Gerd Hoffmann , Markus Armbruster , =?utf-8?q?Philippe_Mathieu-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 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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Forward-define the type first, then use it for the ohci_die() handler. Signed-off-by: Philippe Mathieu-Daudé 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 = { 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 = 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; -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; - void (*ohci_die)(struct OHCIState *ohci); -} OHCIState; + void (*ohci_die)(OHCIState *ohci); +}; #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);