From patchwork Thu Oct 12 04:12: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: 732462 Delivered-To: patch@linaro.org Received: by 2002:a5d:54d1:0:b0:31d:da82:a3b4 with SMTP id x17csp752678wrv; Wed, 11 Oct 2023 21:19:32 -0700 (PDT) X-Google-Smtp-Source: AGHT+IH6oPznPxx6hCj5v3ATCJpWqjbfet56Fb4DLiT5CMOkaFPT6e5Jm88rvBa+hDaYxVxabLvA X-Received: by 2002:a05:620a:4554:b0:775:7d81:f8bb with SMTP id u20-20020a05620a455400b007757d81f8bbmr30425292qkp.11.1697084372149; Wed, 11 Oct 2023 21:19:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697084372; cv=none; d=google.com; s=arc-20160816; b=sSnJJQcgrWrsbnK4rSfANBdunfIrXtPz2q7ZnGlfgPMaQAfXAmRD1nf14p8XqSKRLr LjTUn1bc6KVpZWjQoi6Cg/4iXB1uVkESLeTSCW8/bh617/9TM1P97Jh98fdSDeUYwvRP pPL+igBPjMVsE+WGzuiuUzVTjjxKIlhR4TJOsVlqW57qHdzApXldFYRgbqYyxDlE5hT5 56XrWt/5Z2W+yb6ufhcKQwlUWNjsLTJrviUCemza2U20HvZ0vcBGHXbnVt/jFT54ISrs jaDmTyjcSNxms1hS2hhc81UWs+36CUZRhHBxhM8kEqB/yrxgl/aK3oamKqKWMoyFZvHL znRg== 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=lWNq3KWxwESBCknmH6aQ2YVg3r1DMh4fTWxmynlFDM0=; fh=JC0uePkDNHAC6vZ7v8QWv0c8a4TbaacWMibqgTcw/aQ=; b=Pv0/Lz4F101Iu1/rsUo1tOuYkE1RR+6i81NhcgGBmxx1f/KDKEJbKQ9znnPmXL4eQI CssxZzu62xpzNO4LD4asTkXM0GviyVGAS2pz12f2AV0Pe2VcSBNGIWPeA53E2EA/xIyB a8yUOk8hN9wmbls7Qg4NXTFXRaddJQ1TvNfKnJa8stXugIJzsJcIwetGxokCSvaIsK0t LzeazGDkioRN/afZHLBPKlDd3cXzLqCcUa/GmRA+DshOzNz09M0jugtJJ0t8XqHL+iP2 AwdTB3J94QuyT/iuXWYAT2Wn8gbk4I2e0Qh43WyN1VbfBcgJ/eVw+/m3OhXrsgFI4epr FxTg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=fGopAv3t; 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 m10-20020a05620a214a00b00775b341e4c3si10163132qkm.103.2023.10.11.21.19.31 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 11 Oct 2023 21:19:32 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=fGopAv3t; 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 1qqn47-00034Y-Fw; Thu, 12 Oct 2023 00:12:51 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qqn45-0002y1-GH for qemu-devel@nongnu.org; Thu, 12 Oct 2023 00:12:49 -0400 Received: from mail-ed1-x532.google.com ([2a00:1450:4864:20::532]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qqn43-0002Y2-KA for qemu-devel@nongnu.org; Thu, 12 Oct 2023 00:12:49 -0400 Received: by mail-ed1-x532.google.com with SMTP id 4fb4d7f45d1cf-53de0d1dc46so973552a12.3 for ; Wed, 11 Oct 2023 21:12:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697083965; x=1697688765; darn=nongnu.org; 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=lWNq3KWxwESBCknmH6aQ2YVg3r1DMh4fTWxmynlFDM0=; b=fGopAv3tLuaBWtx+fTKUYshtGF3yoVhkRKO0jtTy/3qiEag4PemWkozISdXwtBazIE 4+5izvh9p5it7YhZj6Pit8tj7gP+API7oVmpuJwg2BcF1XhzXVVTr4Bc9EgEu5yK74k/ vIMz2n77abK8NOmFNb8t3GvvcIJdZ+PHdVAz+/GtwpYuuKGE8vvaHieIYYSvG2F/Zrgl 5U59mcLX77PEpOenX0T8qHwX8tfuFARgj940wKJst9J1oEz3I7EHjve/+ljMUgTosuti agWjGRlEAW28qQdUv352gLBQN9Lux3Q8noUYM32wF8un1/tTdz+zrGqsWcloCAHA91/T FfsQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697083965; x=1697688765; 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=lWNq3KWxwESBCknmH6aQ2YVg3r1DMh4fTWxmynlFDM0=; b=vy4py0XTMP9YFZFk8WUy1/gcozmPXIBYgdJE6hN9vViMN34K0gl+xxtbXPAfHoNfyW 1UofFd4ndHJbQrwpkNdpSC1ASNPN3oGI1ibyNCMbnd18coWB298hb+Ajtc8RbQ2EKnRO S8Qf0wJwBvL0/Se/h8EanaDNFov8pAA6hKDlypiwLg96NDBJmuV6rvd2aepDbimh46ER Zl9euzh4tQLwiVgCagd++49sgJLwaFYNw9EDX4lGnmc323/tWBcGTQg7X0+e/ftCakrC QBnW+jc5tHJtBTm0k3Kf1nw0CUl9w9Qlwu8AEGcJ1eDMbsdGQ+fGridqKeQVzmAXl7rQ bmaQ== X-Gm-Message-State: AOJu0Yz29Db9sb6EnDt1VVMRCnwYs0PWL1yKTzrtqNkn2NfQHPl6Wmx7 nnoXnmCI9M9uR65umSmikwafe9/WCYAgM1zLtqXjpA== X-Received: by 2002:a05:6402:351:b0:533:87c9:4a83 with SMTP id r17-20020a056402035100b0053387c94a83mr20694022edw.37.1697083965369; Wed, 11 Oct 2023 21:12:45 -0700 (PDT) Received: from m1x-phil.lan (dcs23-h01-176-173-173-31.dsl.sta.abo.bbox.fr. [176.173.173.31]) by smtp.gmail.com with ESMTPSA id dm9-20020a05640222c900b0053db1ca293asm1993649edb.19.2023.10.11.21.12.43 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 11 Oct 2023 21:12:45 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Yoshinori Sato , Magnus Damm , qemu-trivial@nongnu.org, =?utf-8?q?Phi?= =?utf-8?q?lippe_Mathieu-Daud=C3=A9?= Subject: [PATCH 1/3] hw/pci-host/sh_pcic: Declare CPU QOM types using DEFINE_TYPES() macro Date: Thu, 12 Oct 2023 06:12:35 +0200 Message-ID: <20231012041237.22281-2-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231012041237.22281-1-philmd@linaro.org> References: <20231012041237.22281-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::532; envelope-from=philmd@linaro.org; helo=mail-ed1-x532.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 When multiple QOM types are registered in the same file, it is simpler to use the the DEFINE_TYPES() macro. In particular because type array declared with such macro are easier to review. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Yoshinori Sato --- hw/pci-host/sh_pci.c | 40 +++++++++++++++++----------------------- 1 file changed, 17 insertions(+), 23 deletions(-) diff --git a/hw/pci-host/sh_pci.c b/hw/pci-host/sh_pci.c index 77e7bbc65f..41aed48c85 100644 --- a/hw/pci-host/sh_pci.c +++ b/hw/pci-host/sh_pci.c @@ -167,17 +167,6 @@ static void sh_pci_host_class_init(ObjectClass *klass, void *data) dc->user_creatable = false; } -static const TypeInfo sh_pci_host_info = { - .name = "sh_pci_host", - .parent = TYPE_PCI_DEVICE, - .instance_size = sizeof(PCIDevice), - .class_init = sh_pci_host_class_init, - .interfaces = (InterfaceInfo[]) { - { INTERFACE_CONVENTIONAL_PCI_DEVICE }, - { }, - }, -}; - static void sh_pci_device_class_init(ObjectClass *klass, void *data) { DeviceClass *dc = DEVICE_CLASS(klass); @@ -185,17 +174,22 @@ static void sh_pci_device_class_init(ObjectClass *klass, void *data) dc->realize = sh_pci_device_realize; } -static const TypeInfo sh_pci_device_info = { - .name = TYPE_SH_PCI_HOST_BRIDGE, - .parent = TYPE_PCI_HOST_BRIDGE, - .instance_size = sizeof(SHPCIState), - .class_init = sh_pci_device_class_init, +static const TypeInfo sh_pcic_types[] = { + { + .name = TYPE_SH_PCI_HOST_BRIDGE, + .parent = TYPE_PCI_HOST_BRIDGE, + .instance_size = sizeof(SHPCIState), + .class_init = sh_pci_device_class_init, + }, { + .name = "sh_pci_host", + .parent = TYPE_PCI_DEVICE, + .instance_size = sizeof(PCIDevice), + .class_init = sh_pci_host_class_init, + .interfaces = (InterfaceInfo[]) { + { INTERFACE_CONVENTIONAL_PCI_DEVICE }, + { }, + }, + }, }; -static void sh_pci_register_types(void) -{ - type_register_static(&sh_pci_device_info); - type_register_static(&sh_pci_host_info); -} - -type_init(sh_pci_register_types) +DEFINE_TYPES(sh_pcic_types) From patchwork Thu Oct 12 04:12: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: 732461 Delivered-To: patch@linaro.org Received: by 2002:ab3:5b93:0:b0:23f:8cfb:5ad7 with SMTP id j19csp324893ltf; Wed, 11 Oct 2023 21:13:27 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFxvAjnq6Xw6nH2AZG8bPwzxgn+j1GgB4I365A/eSftrONllDDI6gyFlRaMWUNNGojIQV3/ X-Received: by 2002:a05:6214:3a03:b0:658:2037:718b with SMTP id nw3-20020a0562143a0300b006582037718bmr26000236qvb.51.1697084007576; Wed, 11 Oct 2023 21:13:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697084007; cv=none; d=google.com; s=arc-20160816; b=L+02hpeCMOU8LL+apMHbspOtsYQMBSPZJ4LHMjupEDKA4HWuZ/FUOB/feMXIzDjqH/ 709ueJ3GP/+75Sh3cLeDv/7cU1PO0ZVXHnnmpdB2e0IPLKrl5+2Yb4yEYfj5N8f0ivC9 3JvtiYqQBr065CDAcR4MWB2FWjlX7+dhM0ZRj03jZ9L/AesFOBr5LEEIxhSoe8z5/NI4 p79qG3gR+3K7nLa2kMT5xFKgN15ihh1QVN2VsumLBta9KcwU+VgzWU5iEgdjBxgysZiy n1+Bha0vXdAQQu2qcJCeEsHtEvuZv1ZLgaH0RL/xy5mLhv0rL3PtaIPFOvmTO8n+YTlo WkdA== 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=WsX2DG2aDbsRhbntpTTVvqExibrPowqSUQlphKlY4n0=; fh=JC0uePkDNHAC6vZ7v8QWv0c8a4TbaacWMibqgTcw/aQ=; b=YX3XPgMZYBxiaHozSYtDid9ftoOx0E9v9ZJgRiy+4/hwyOl9pIzF+uk/ceium8BX6Q sZmaOxTOJrTClKlgrCF0PtiYC1y43Ljte2Hfpwa1a33XUuCzp5x1iKjmY8WVcouY3E8p At5cWuaba8LJYxJWn2dreLKD1Gngh21oMPKNkxmFnLEpbkZXTVLi3ndI0hXXPGc2UgGX HVT6HNZuLKQRcb43s0Fsw2Wny3yaBKmGKP3HCFrxitXXN1QfchPYDgQ1vzbTYhFRlpIi 0hc1wolaxYug7mAf4zzDvohRjeX0vw44kImg9IP/Jjh1tNxIDfxagRs/fQiUYDAuG/w8 aa8g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=w18JCYRj; 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 y12-20020a0ce04c000000b0066d07638aa3si1878274qvk.424.2023.10.11.21.13.27 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 11 Oct 2023 21:13:27 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=w18JCYRj; 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 1qqn4F-0003kR-F9; Thu, 12 Oct 2023 00:12:59 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qqn4B-0003Ks-MM for qemu-devel@nongnu.org; Thu, 12 Oct 2023 00:12:55 -0400 Received: from mail-ed1-x52d.google.com ([2a00:1450:4864:20::52d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qqn49-0002Zb-Aj for qemu-devel@nongnu.org; Thu, 12 Oct 2023 00:12:55 -0400 Received: by mail-ed1-x52d.google.com with SMTP id 4fb4d7f45d1cf-53d82bea507so972388a12.2 for ; Wed, 11 Oct 2023 21:12:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697083971; x=1697688771; darn=nongnu.org; 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=WsX2DG2aDbsRhbntpTTVvqExibrPowqSUQlphKlY4n0=; b=w18JCYRji2rvQmiWW8GXzoT4EX2JpQZXD/Ya2nScLFnKDoO90sVXRLuW7ejKXW8sif 4K+miP1lnsG4MhfZyKDL6KySm5rj85VPMZbU1qqHD10Hf42UCzLvepCVf9Qnaz51nuED ht5FwxTh50tT53IzEiP30Ok6WP5/8bqCNI5NyubnbFOnkNZ9QS4n2ot8aMZ+JpZPVs5L sTGmYC94j+dGlpn6oYLDm5Mi6ewLi9Zgx9cwgtkmNWCjiPN1DHzvwmSqOyq+YvFncyd1 0lJGr/2gsSwgATQ3NvViUvD8PfywvNq846/1ONv9VSsEVtIOzu7j5GfI/zDuLovqrzXI DoMA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697083971; x=1697688771; 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=WsX2DG2aDbsRhbntpTTVvqExibrPowqSUQlphKlY4n0=; b=dduR1PVu3SsCovg0cEhEI+8LdAx0/21wuLuENE4IMvqMT6ROdOgob/+NKKKZvBWvVE nspPtDwK+i2TUDye9chPrGar8bVDJZADTjkkiV7YyGt/oOb4SWl7IM7d89jMiG0GGa+y nLUvt25plT7qYzbsysEESv7cDwaXl4XH5OASHwhF0rU1UMloKp6kcnV1jJ5OwvCqfU3h Iam/KLW1SUtK2HG1xSU2w6bMoI5lg79fAU4XfwHamALzgp8/9BwyxTqm5ffmlSVqjIlE +1ZcsuVdjMznmXZPDkw2edYrKpvDZs8nidxUnPFaVJ1mn/0vMFcdbIeBbbaVISxPjmQu rTkw== X-Gm-Message-State: AOJu0YwEfWaLExTjWk+sHSvgTBk8gdMy1cLN8guJBFzgduTe0UgM5wmk kposDHe4o7q+35oT4GzWU+orOTB4vVfH5/6hvZMTAQ== X-Received: by 2002:a17:906:8a64:b0:9b3:120:f319 with SMTP id hy4-20020a1709068a6400b009b30120f319mr19483428ejc.51.1697083971231; Wed, 11 Oct 2023 21:12:51 -0700 (PDT) Received: from m1x-phil.lan (dcs23-h01-176-173-173-31.dsl.sta.abo.bbox.fr. [176.173.173.31]) by smtp.gmail.com with ESMTPSA id r14-20020a170906364e00b009b65a698c16sm10513833ejb.220.2023.10.11.21.12.50 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 11 Oct 2023 21:12:50 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Yoshinori Sato , Magnus Damm , qemu-trivial@nongnu.org, =?utf-8?q?Phi?= =?utf-8?q?lippe_Mathieu-Daud=C3=A9?= Subject: [PATCH 2/3] hw/pci-host/sh_pcic: Correct PCI host / devfn#0 function names Date: Thu, 12 Oct 2023 06:12:36 +0200 Message-ID: <20231012041237.22281-3-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231012041237.22281-1-philmd@linaro.org> References: <20231012041237.22281-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::52d; envelope-from=philmd@linaro.org; helo=mail-ed1-x52d.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 Host bridge device and PCI function #0 are inverted. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Yoshinori Sato --- hw/pci-host/sh_pci.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/hw/pci-host/sh_pci.c b/hw/pci-host/sh_pci.c index 41aed48c85..580e273d96 100644 --- a/hw/pci-host/sh_pci.c +++ b/hw/pci-host/sh_pci.c @@ -116,7 +116,7 @@ static void sh_pci_set_irq(void *opaque, int irq_num, int level) qemu_set_irq(pic[irq_num], level); } -static void sh_pci_device_realize(DeviceState *dev, Error **errp) +static void sh_pcic_host_realize(DeviceState *dev, Error **errp) { SysBusDevice *sbd = SYS_BUS_DEVICE(dev); SHPCIState *s = SH_PCI_HOST_BRIDGE(dev); @@ -145,19 +145,19 @@ static void sh_pci_device_realize(DeviceState *dev, Error **errp) s->dev = pci_create_simple(phb->bus, PCI_DEVFN(0, 0), "sh_pci_host"); } -static void sh_pci_host_realize(PCIDevice *d, Error **errp) +static void sh_pcic_pci_realize(PCIDevice *d, Error **errp) { pci_set_word(d->config + PCI_COMMAND, PCI_COMMAND_WAIT); pci_set_word(d->config + PCI_STATUS, PCI_STATUS_CAP_LIST | PCI_STATUS_FAST_BACK | PCI_STATUS_DEVSEL_MEDIUM); } -static void sh_pci_host_class_init(ObjectClass *klass, void *data) +static void sh_pcic_pci_class_init(ObjectClass *klass, void *data) { PCIDeviceClass *k = PCI_DEVICE_CLASS(klass); DeviceClass *dc = DEVICE_CLASS(klass); - k->realize = sh_pci_host_realize; + k->realize = sh_pcic_pci_realize; k->vendor_id = PCI_VENDOR_ID_HITACHI; k->device_id = PCI_DEVICE_ID_HITACHI_SH7751R; /* @@ -167,11 +167,11 @@ static void sh_pci_host_class_init(ObjectClass *klass, void *data) dc->user_creatable = false; } -static void sh_pci_device_class_init(ObjectClass *klass, void *data) +static void sh_pcic_host_class_init(ObjectClass *klass, void *data) { DeviceClass *dc = DEVICE_CLASS(klass); - dc->realize = sh_pci_device_realize; + dc->realize = sh_pcic_host_realize; } static const TypeInfo sh_pcic_types[] = { @@ -179,12 +179,12 @@ static const TypeInfo sh_pcic_types[] = { .name = TYPE_SH_PCI_HOST_BRIDGE, .parent = TYPE_PCI_HOST_BRIDGE, .instance_size = sizeof(SHPCIState), - .class_init = sh_pci_device_class_init, + .class_init = sh_pcic_host_class_init, }, { .name = "sh_pci_host", .parent = TYPE_PCI_DEVICE, .instance_size = sizeof(PCIDevice), - .class_init = sh_pci_host_class_init, + .class_init = sh_pcic_pci_class_init, .interfaces = (InterfaceInfo[]) { { INTERFACE_CONVENTIONAL_PCI_DEVICE }, { }, From patchwork Thu Oct 12 04:12: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: 732463 Delivered-To: patch@linaro.org Received: by 2002:ab3:5b93:0:b0:23f:8cfb:5ad7 with SMTP id j19csp327768ltf; Wed, 11 Oct 2023 21:20:27 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHaUscWwofJTsbw9FtQZQi4RyZJR+pA8FZlY5/ks21yVoAD6zJRC2fYReEXu2HglNKCTrAn X-Received: by 2002:a0c:aa53:0:b0:659:a316:95cc with SMTP id e19-20020a0caa53000000b00659a31695ccmr21743722qvb.38.1697084426913; Wed, 11 Oct 2023 21:20:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697084426; cv=none; d=google.com; s=arc-20160816; b=WLTGLW7wyzOux0eHW6M3KePRX/VoWWbQ9B9korAdQsZXbnwUEpd9UvF0FA4xbOeo4Q /0HJS8aHyI2K7/FI0MUXwtTD+igKklUHeQn0m6PWoD3H0TyIzbNuSN3ffEL+DONITSMm 434B55FEEOKyr6EgBhoyRMMwdxrdppBYOG3hX+OosgQbhvcjlZStDuyAWReaLEab5Pqq yIi0EXuMbc2CF9qyEZ3amKQbT1+mGMaqliahdoj5EReHuTxb06hAwYoYmKFKzxdyIO7L AdHYtZDN8FFb95IEJ+cSK2MX691GWLB2DEfsKJ6ZH0rxtAx/38yoWdwx87ijdfETn6+y ddyg== 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=gNXd/6GPgJXQ92iTYms/9+W0zMbeXRjR7NXBD4ayeB0=; fh=JC0uePkDNHAC6vZ7v8QWv0c8a4TbaacWMibqgTcw/aQ=; b=hzfrLLxBU/XjdPwkPr0EyJnhNANCVvqfOU2hnPUsuhVmvdqLQXl72QmlO8ED4cnhH5 GTuIxB9LSOCfzJfZsgnz2ugL29Ujd8aWUKH/LDrQB8rXXtFsOg4aDAsmd+svaFUQdCW1 tu+rDbIuglOkaN20q+eCbFdg62vtQuWu9B7tl8Ka8zia/e6rpPGjO3HGqP7KHgoJYfjb vlUYXQj6ci6H5oa710x5FDkVfk7wRzjz8hBNtJzW0d15SD9pyMbPkwvo4CuW3j4IPgNE 2nWITgdyLAQhdvgxG9StH99x4CdqX+uuZ97bcl+EAvPvS1zyoUoaZvReF0pHdNH0RNsU io6w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=kGDkRmaQ; 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 r6-20020a05620a298600b0077421d5f27dsi10804497qkp.571.2023.10.11.21.20.26 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 11 Oct 2023 21:20:26 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=kGDkRmaQ; 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 1qqn4I-0004EY-V9; Thu, 12 Oct 2023 00:13:03 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qqn4H-000467-Ma for qemu-devel@nongnu.org; Thu, 12 Oct 2023 00:13:01 -0400 Received: from mail-lj1-x22b.google.com ([2a00:1450:4864:20::22b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qqn4E-0002b5-Nu for qemu-devel@nongnu.org; Thu, 12 Oct 2023 00:13:01 -0400 Received: by mail-lj1-x22b.google.com with SMTP id 38308e7fff4ca-2c16bc71e4cso6378141fa.0 for ; Wed, 11 Oct 2023 21:12:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697083977; x=1697688777; darn=nongnu.org; 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=gNXd/6GPgJXQ92iTYms/9+W0zMbeXRjR7NXBD4ayeB0=; b=kGDkRmaQwCYp6j2jJH7aTXzacgKnjUGg7OjRcP6+P3+OXsPR4aTYHJM84+EEQZqG8s gGxbNd8N0SNO1Wb5J/tTuZxF0rftGL7uRU0bsEJfJezT6TpGtaWxn17D2T31jGL0/0pD Iz6PP22Rcnonca1KKJK98a+lFXWUJ2xqhyt6t0uYXEyuL/4Q3vWS1VDFBuHm53K9CNMu QQ4s+XjBi/mOBcUwHIceof26jidwFIc/xXj5QYW7Q19pD01lLDksOXcPBUGfYzfmyXNP YRKefmJNxRMyNFWUIUyfepcW6JX3PHxk3SdpKTdfndmr6DwRh2PhoppCdYU6qqCY97u8 Wkhw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697083977; x=1697688777; 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=gNXd/6GPgJXQ92iTYms/9+W0zMbeXRjR7NXBD4ayeB0=; b=cWV3ig6ssSngaxyt7zY6GOhTPsrXxA1bU0KlcMrSAZ5rd4rUTMBmV3wiys5+rpP+aF rNlDqiwxlhxnIrozIHUYjiKzcXMxPdwalzQfHP1ehv65xaY/z8OeY40lMxYKr2SGIbud 1rb3tfVFkdPs2BFCCXbCZdKNFNGzm8mZd5ij9jg51z/m5/lRUvG2iYIqbp8Ryl8FECJy PqElz+j4FCyQh4omuu8RP+Pwa6DTPd4Snh9jfNUve9so+bcK+WD3vhHrSPt2iwcS1r23 2SxWxBHd5AiTUAiJt9P7PNPwnVGxF+d7LwSQ5Ees4wcSneD1dvjvBOePkMop4ElErc0v 4kFQ== X-Gm-Message-State: AOJu0YzXhOz332h4c45U25l78BuaPIyuqgHUsouuR1YcgacKg+zsgTID /zDZgjbVqTOpgg6HQgebOl0ImToKgbQY/5U1fGHzeA== X-Received: by 2002:a2e:b165:0:b0:2c0:23d3:daee with SMTP id a5-20020a2eb165000000b002c023d3daeemr20366292ljm.39.1697083976706; Wed, 11 Oct 2023 21:12:56 -0700 (PDT) Received: from m1x-phil.lan (dcs23-h01-176-173-173-31.dsl.sta.abo.bbox.fr. [176.173.173.31]) by smtp.gmail.com with ESMTPSA id qb40-20020a1709077ea800b009b9af27d98csm9145791ejc.132.2023.10.11.21.12.55 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 11 Oct 2023 21:12:56 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Yoshinori Sato , Magnus Damm , qemu-trivial@nongnu.org, =?utf-8?q?Phi?= =?utf-8?q?lippe_Mathieu-Daud=C3=A9?= Subject: [PATCH 3/3] hw/pci-host/sh_pcic: Replace magic value by proper definition Date: Thu, 12 Oct 2023 06:12:37 +0200 Message-ID: <20231012041237.22281-4-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231012041237.22281-1-philmd@linaro.org> References: <20231012041237.22281-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::22b; envelope-from=philmd@linaro.org; helo=mail-lj1-x22b.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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Yoshinori Sato --- hw/pci-host/sh_pci.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/hw/pci-host/sh_pci.c b/hw/pci-host/sh_pci.c index 580e273d96..4edebced5e 100644 --- a/hw/pci-host/sh_pci.c +++ b/hw/pci-host/sh_pci.c @@ -40,7 +40,7 @@ struct SHPCIState { PCIHostState parent_obj; PCIDevice *dev; - qemu_irq irq[4]; + qemu_irq irq[PCI_NUM_PINS]; MemoryRegion memconfig_p4; MemoryRegion memconfig_a7; MemoryRegion isa; @@ -131,7 +131,8 @@ static void sh_pcic_host_realize(DeviceState *dev, Error **errp) s->irq, get_system_memory(), get_system_io(), - PCI_DEVFN(0, 0), 4, TYPE_PCI_BUS); + PCI_DEVFN(0, 0), PCI_NUM_PINS, + TYPE_PCI_BUS); memory_region_init_io(&s->memconfig_p4, OBJECT(s), &sh_pci_reg_ops, s, "sh_pci", 0x224); memory_region_init_alias(&s->memconfig_a7, OBJECT(s), "sh_pci.2",