From patchwork Fri Feb 16 11:03:08 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: 773319 Delivered-To: patch@linaro.org Received: by 2002:adf:9dc2:0:b0:33b:4db1:f5b3 with SMTP id q2csp1287147wre; Fri, 16 Feb 2024 03:08:23 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCXpH/w4g9XoULJxmxshmI2Lyx805fw8qwJPJJzSnJVFC+2jQaYSRnGtiwN2mnAsrCZD84wQ9VhaMSX5QE5wpl9K X-Google-Smtp-Source: AGHT+IGrJexEtWcNaqx5SEixF0NJYx9pAgUh+ZJI+kHGR9N5kSz1LhDtGxhbx5ZDtrqVtk1Ed9AN X-Received: by 2002:a05:6808:1524:b0:3c1:4179:32e0 with SMTP id u36-20020a056808152400b003c1417932e0mr896503oiw.7.1708081703677; Fri, 16 Feb 2024 03:08:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1708081703; cv=none; d=google.com; s=arc-20160816; b=WXkZeLkX35d35gLr5A6ndM2WC3T6iXQgcD0IilZpOqnW22SFPJUQFK8A0rZmPzohp4 3TgvQyEj8988v1RY3BBvTgtz+mCwXgA7S6Qv23Dj3CPQi7TL+cw2VhiEFFJKpHCISCkC oZbW+eyUi8vtgwStyX3zHmygiIZmrv7T22LAZxrjdldUjRhSZHnX77DdRuqbgmTlvbUe VDybuAfoaaDhn4XK/lYFKylbObXpGhlZh3aL8BErm92DzY4AL+VbPSN2KSoGJO0drjL0 glvVZhDi279dUMeSMLgqHccFP+L2KTtzKuMbAUXWYXV30IlO1k1DOBhL+kHquTIviZHE +NtQ== 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=wIiFm5Lc76s4egbopN+QwAc3v81IfNt4gHe1mB8rI9U=; fh=lo699SrpvFYJnxFLZ6omanT1M6xx54FOFadsij93CRk=; b=GiH/lH0kUJAH4+cUo6J/MGBbLRoHrTBOy9CGzsum4w+aKRC2284rvgSuixm+wLf2uE 7udTi9J/uZE85ktRoKxfdMy4PwuYBv89N7cE2yUKtYPDIQNsDmtGgZL66j9xCRljkJm1 Rn0rgiCw/NsMlGjn3umiZgwqcJwVX1RlU3nsBB4W1wD4xG4ybgIW4abF3eWFtXDW5gw6 dT4PPdh85qnRFL9DT8huS6hHULM/ZqBvuxM6llW/TjZsRPqPv2dtAEzB+opWXUiHflcb lPskboKB+7K7/iNIa/BxMpn47OdG1Mugj1xkFBQq6kcPGrYCMHXRo7plzV18AEHCHdZH 82dA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=JKl4ls6s; 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 f6-20020ac85d06000000b0042dc7351039si4341662qtx.209.2024.02.16.03.08.23 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 16 Feb 2024 03:08:23 -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=JKl4ls6s; 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 1raw20-0001Cx-QJ; Fri, 16 Feb 2024 06:05:24 -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 1raw1x-00013D-CC for qemu-devel@nongnu.org; Fri, 16 Feb 2024 06:05:21 -0500 Received: from mail-wr1-x435.google.com ([2a00:1450:4864:20::435]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1raw1m-0001DP-OA for qemu-devel@nongnu.org; Fri, 16 Feb 2024 06:05:20 -0500 Received: by mail-wr1-x435.google.com with SMTP id ffacd0b85a97d-33b4e6972f6so912362f8f.2 for ; Fri, 16 Feb 2024 03:05:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1708081508; x=1708686308; 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=wIiFm5Lc76s4egbopN+QwAc3v81IfNt4gHe1mB8rI9U=; b=JKl4ls6s30yDphvgFJqbet/DnKLO6hOugNHjlqBQM4MmoyrzpXxtYqCz9RU9iLq0Bb wxxWr8TuJ1s8kz+aRFHPxFmQZxg0Ewv7/J62aaaKGksrO7Bw9nUxL4N/1Yr/UVXRI3QP x7ksVuHBMJ0mmXYDvgx8bvDKgmNuCV5Bwk/ZM6bUpVcOIBKW4LFvKa7sDsdwraNHeELm 6vQysFkGoTrl+vurBUP5AA/THKiAx5FV8H5+qXIjp67ku1fqcXuuAOqwSbIbaNqR0BKO gnfb+qp45ne7y6GJLh6sOVYD1u37dTiEK/KJinW9BO3E7eVT+wN/AQG1LgJlET73ckth SPZA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708081508; x=1708686308; 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=wIiFm5Lc76s4egbopN+QwAc3v81IfNt4gHe1mB8rI9U=; b=mpFVVbJ5OpWlHQCTGbaDRg/jiqYARxSTGKzLefcTLs0h/+e2CXEmV5Sj75oKVfwriF feajiZQYa9Uju8ZdgG7ez8BTEiASt7WsvyVlFb1F6u/Xe2iT+FgVZRAt0I0uE9BLlpA1 Nw1OieR6ApcM+fimhW7UCxZhKC7X+Qn7+tWfMWLdRZrKtaJV8qfOdO4Nn39JbQ2IDszQ 1A1b+ueAjMShlVw//Vbt/lvMvEgdVwPNmna+qud7/uaSNwn8AHmLiawCxn0jO60FvmUo bnl1n2MwX9YCeUWULZx9HDL/7qtkqtXNoj73KqeYUvibaIRlt8ZauApi+XIqWP+YJDWO 5e0w== X-Gm-Message-State: AOJu0YxE31UApwz0VXytNQvtnedpAy+rUddYU92U4tnDwaXDEfiY5Iox eT8GFhCP1EKRCdC6Ym3sPu7TVTiZxD7zSe2upzh+6adIheDzCiyuz6/LUecV+TEg7WRF3Ubpb30 r X-Received: by 2002:a5d:664d:0:b0:33d:157d:a7ad with SMTP id f13-20020a5d664d000000b0033d157da7admr1642262wrw.40.1708081507912; Fri, 16 Feb 2024 03:05:07 -0800 (PST) Received: from m1x-phil.lan ([176.187.210.246]) by smtp.gmail.com with ESMTPSA id b10-20020a5d40ca000000b0033ceca3a3dbsm1898621wrq.2.2024.02.16.03.05.05 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 16 Feb 2024 03:05:07 -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?= , "Michael S. Tsirkin" , Marcel Apfelbaum , Paolo Bonzini , Richard Henderson , Eduardo Habkost Subject: [PATCH 17/21] hw/i386/iommu: Prefer object_initialize_child over object_initialize Date: Fri, 16 Feb 2024 12:03:08 +0100 Message-ID: <20240216110313.17039-18-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::435; envelope-from=philmd@linaro.org; helo=mail-wr1-x435.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. Rename the 'klass' variable as 'obj' since the argument holds a reference to an instance object and not a class one. Signed-off-by: Philippe Mathieu-Daudé --- hw/i386/amd_iommu.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/hw/i386/amd_iommu.c b/hw/i386/amd_iommu.c index 7329553ad3..c3afbc4130 100644 --- a/hw/i386/amd_iommu.c +++ b/hw/i386/amd_iommu.c @@ -1616,11 +1616,11 @@ static const VMStateDescription vmstate_amdvi_sysbus = { .unmigratable = 1 }; -static void amdvi_sysbus_instance_init(Object *klass) +static void amdvi_sysbus_instance_init(Object *obj) { - AMDVIState *s = AMD_IOMMU_DEVICE(klass); + AMDVIState *s = AMD_IOMMU_DEVICE(obj); - object_initialize(&s->pci, sizeof(s->pci), TYPE_AMD_IOMMU_PCI); + object_initialize_child(obj, "iommu", &s->pci, TYPE_AMD_IOMMU_PCI); } static void amdvi_sysbus_class_init(ObjectClass *klass, void *data)