From patchwork Fri Feb 16 11:03:09 2024 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: 773329 Delivered-To: patch@linaro.org Received: by 2002:adf:9dc2:0:b0:33b:4db1:f5b3 with SMTP id q2csp1288418wre; Fri, 16 Feb 2024 03:11:31 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCV5dHUGUrATk2drv68vz2jiPoE39uupyXs+I8BYMGAlrfo4WN5Q2ucIK3WMBAKGey6S47HAkjI05LnquYI21n4n X-Google-Smtp-Source: AGHT+IHedxQGaM267dpClcK0pDgbO0Aqi8W+u1p0os9/r0HDKWbIyQSx5shXUWVEqxL2DlH0DaTV X-Received: by 2002:ac8:5a55:0:b0:42c:43d6:c69e with SMTP id o21-20020ac85a55000000b0042c43d6c69emr13359467qta.1.1708081871381; Fri, 16 Feb 2024 03:11:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1708081871; cv=none; d=google.com; s=arc-20160816; b=i7Ttvkn6xj0TPNPxI88an3sp3K2eswprwcnLczrN8fzF7YzDbonktmXYl6H0ZXfbXr rIrmraJWlG0Xr8tf5ce4Y3dEuljoSHV1j5kJupkpRy2oU+dRRt9pCtp7QUbPtaOEKghA aO6sNtt99fVKHiinp6JPdJEUBCOnALmasRlk5xR/HoARlyyZgs9R+sxHEhx/cL23GM00 NpPnKCjkFMfe/AsckR6GqNX9XT9jNSX/RWNuE65tbejs6AoeUNnv2DWZFN1giXiwq2H2 yCYJJkC2VL009fNGeWomssVABwRkONXnPleIMHs7Vip5i+uCI99EPgl07r9B/0hPhp30 Uy6w== 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=ELKUbUBr744bWbi9HHUFUd98mluSMaEj1sworCQzpug=; fh=VbPIqyFuCYL65k0FKNVmSVSYwnadnuqExi5+vdUGOTw=; b=H78e6tB5dYgnOhLiv9B53cWfLLsXe2qzG7GvQ5NFdpuOgvILaGt9FWmJK7otizHPI3 A97PbB/VHrsdGf75r+jXtbhcmn/SafzOXxDEZe2RQpQ+JIOYeG+LRFo52R94vtrUYXTg z1GV6pYeCZxhhCNhAFtfsI/2saVpbANMZ79MFtgAuus9UfNgYCDAhNf5+AbWyFZ0A9uT Pe/ydLlZxBkdN+xu77Gf/BVAmXPcYjzSot6zrEL+jBuFc+UoRNXrBgN3SXgpDRNBBBTP uWPf5lm2SSAkEiJe0olELTFH2TtpY0ph0lTNQuwRTKo3tkjI9Wyizt2GDUjrD8rnLhgQ JYeQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="Hx/8fgPX"; 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 g4-20020ac87d04000000b0042c592b68ddsi3883451qtb.314.2024.02.16.03.11.11 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 16 Feb 2024 03:11:11 -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="Hx/8fgPX"; 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 1raw2A-00023L-3p; Fri, 16 Feb 2024 06:05:35 -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 1raw23-0001ZY-VR for qemu-devel@nongnu.org; Fri, 16 Feb 2024 06:05:28 -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 1raw1s-0001FM-Hx for qemu-devel@nongnu.org; Fri, 16 Feb 2024 06:05:27 -0500 Received: by mail-wr1-x429.google.com with SMTP id ffacd0b85a97d-33934567777so1057476f8f.1 for ; Fri, 16 Feb 2024 03:05:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1708081514; x=1708686314; 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=ELKUbUBr744bWbi9HHUFUd98mluSMaEj1sworCQzpug=; b=Hx/8fgPXQq5hg4OPgOcSzsfgVa+ySPBuLbXb6XoE6MpS5Qt3zWfpoMP4G9rBhVzLf3 holnO1KCNPid2zQheWFV+d3TSmLDlTkdoeX6tNHhk8LfMWXfNC2pmLOhKoxiSefimFcE DOXXH9E1XEz638rO60CAgUaIafpoVcPMWF697jVf7wRXNvjGteM8ouE1RYJChM0ibVy3 5waXu1msyJM4lwfvnAgMrtVWtwFv9oAFqWfq1JRPreIGSRklGvw664q5HRLogkYebKIW /v+VcW695zUrGewdh9BAtwEFFizcD86om7VEfTNNxwxEivGpBgTGwfqFa+UytEQ0c+hL ZRDA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708081514; x=1708686314; 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=ELKUbUBr744bWbi9HHUFUd98mluSMaEj1sworCQzpug=; b=EZOKFfryG9YKIZFW0pu1Y+F5jJ6Q0h25MI29GOUBs0pQp2eQqDx3EE4/2jdo3NKJMM WXiwBdW0FQ5VjQ6hBN8PylXZ1Y4aWIquA8jwzcyf74i+CqERqe4qhLX7xygMx5RXIEif OamxmroLsy8TpvaiYGXjVRL2fm4KDPOQ2QqMr4EXcyc4/H5oNFxjDIFnPK2wzRKca9Ii TDS02b1O0xoajW5ch5Uz3E/LIMnaiXJCZYJEqbNk5S/mJX0dGKarIGVSpMIiQCjHA9Lp niBHNhzLurVgJDo1TLPXI7KWU27vnGjCFO8f7JLMKQXOA/Gz2fUZRqgYEWjPXrBBu7VG R/Yg== X-Gm-Message-State: AOJu0Yw4/kwi0akbgR1mUtLQBMKl3IXV1qiQqoedQYRWFynnsqyED0vl B0yYPTRzHH6i8TWrBsB8rem0Xubcz62otwD2+Jy0Y0YiCIYXcSiLCFpQUscxJdrFdPRgZHT1NSn S X-Received: by 2002:a5d:4a4f:0:b0:33b:5087:c913 with SMTP id v15-20020a5d4a4f000000b0033b5087c913mr3438284wrs.54.1708081514666; Fri, 16 Feb 2024 03:05:14 -0800 (PST) Received: from m1x-phil.lan ([176.187.210.246]) by smtp.gmail.com with ESMTPSA id x6-20020adff0c6000000b0033cfc035940sm1889460wro.34.2024.02.16.03.05.12 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 16 Feb 2024 03:05:13 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org, qemu-s390x@nongnu.org, qemu-ppc@nongnu.org, qemu-block@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Peter Maydell Subject: [PATCH 18/21] hw/pci-host/versatile: Replace object_initialize() -> _child() Date: Fri, 16 Feb 2024 12:03:09 +0100 Message-ID: <20240216110313.17039-19-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240216110313.17039-1-philmd@linaro.org> References: <20240216110313.17039-1-philmd@linaro.org> MIME-Version: 1.0 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, T_SCC_BODY_TEXT_LINE=-0.01 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 When the QOM parent is available, prefer object_initialize_child() over object_initialize(), since it create the parent relationship. Signed-off-by: Philippe Mathieu-Daudé --- hw/pci-host/versatile.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hw/pci-host/versatile.c b/hw/pci-host/versatile.c index 0e65deb3f9..5d1f9cc96d 100644 --- a/hw/pci-host/versatile.c +++ b/hw/pci-host/versatile.c @@ -410,7 +410,8 @@ static void pci_vpb_realize(DeviceState *dev, Error **errp) PCI_DEVFN(11, 0), TYPE_PCI_BUS); h->bus = &s->pci_bus; - object_initialize(&s->pci_dev, sizeof(s->pci_dev), TYPE_VERSATILE_PCI_HOST); + object_initialize_child(OBJECT(dev), "pci-func0", + &s->pci_dev, TYPE_VERSATILE_PCI_HOST); for (i = 0; i < 4; i++) { sysbus_init_irq(sbd, &s->irq[i]);