From nobody Thu Nov 14 18:11:51 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=1708946173; cv=none; d=zohomail.com; s=zohoarc; b=IChz6VxAajuxWeWjoGZVl2FenV3qmDCNJYxYDx53u88jW3/imvWc45RNIAYc99jXQIPOZmT0JrynMukIfW8JWzd6/lv8VevY+I3vXxKkMA2ta6ePe57k+9Bg5yoCbASqm24qZyzDPcNiMCdV+0aosXTZ312uL0hQd7+N73XUijc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1708946173; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=t/Fkfjcs9G3hXZQ2TEH/vNoM6jNLvzBhoSDBD5uo4Kk=; b=fiPFnb9B/foXZ3KW1WDHxOhrruQ3bb+I8G8/x1vJeUEVrfFw00/HECsk4PZJjpOgvTGCK2RmSKjCQY9blpJuN5K3+DEH0p2r5V6RjxZt5BCt0M/GiObbdNVTpdAmltzBk3GH4cTTs+2K2z/URWKOZ6cx6KdHuNRCMwPlEqF6RfA= 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 1708946173598765.8403761517546; Mon, 26 Feb 2024 03:16:13 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1reYwP-0000Z3-DT; Mon, 26 Feb 2024 06:14: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 1reYwN-0000YE-V0 for qemu-devel@nongnu.org; Mon, 26 Feb 2024 06:14:35 -0500 Received: from mail-wm1-x332.google.com ([2a00:1450:4864:20::332]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1reYwL-0008RJ-UW for qemu-devel@nongnu.org; Mon, 26 Feb 2024 06:14:35 -0500 Received: by mail-wm1-x332.google.com with SMTP id 5b1f17b1804b1-412a7b68809so2833045e9.0 for ; Mon, 26 Feb 2024 03:14:33 -0800 (PST) Received: from m1x-phil.lan ([176.176.164.69]) by smtp.gmail.com with ESMTPSA id e25-20020a05600c219900b004128c73beffsm11638564wme.34.2024.02.26.03.14.29 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 26 Feb 2024 03:14:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1708946072; x=1709550872; 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=t/Fkfjcs9G3hXZQ2TEH/vNoM6jNLvzBhoSDBD5uo4Kk=; b=L+/E72lbE36HRYDZ716YqG53D/dDcfpPwdG0mP1NSLOpBJSBtTBoWi4GYvGFDc98VH BKT9a+hIOGWxvLC4JUj1qaarIF1huVZVoz29CYs+QLeoGyp+MIW+HShA2nBS4e4JEbuz e4ydxWtk9cPVKv/9H+2fwxTmN7O23IcOY1o5rwkLC+uwVZyqusJlVvtP0l4uNBLjggj/ dQDihewvDFJZvdgb8MB/kRfdoQj8ctjNmIn5jsXiE7wbrIXjSgw86qwIjtEMsPNUogMW m7M2Jk/66p2Xmh+COkFw/AS0trip4lr9xtwD/Cks4L5robNpUXXHxA8n/EedoZKipd9a RN9A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708946072; x=1709550872; 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=t/Fkfjcs9G3hXZQ2TEH/vNoM6jNLvzBhoSDBD5uo4Kk=; b=v9I8ezgfZ7hLoRFBncz3+LfJyWX14bonSDxNkvDdHg+kA+sYzyl6u8NEhRj2+Rw1Y7 y57J2N8/l7t8yCfHeF7bMY3hUI+Bs9Oe7AllSpqbFnxGOCfKRrOHnZKbLlg2QBmFDTrP EvTT6bjubhLnbn5FEV5Ug+m+oLw97ejgoXf6heVdCZ68+rK0NW459V/odXHoICAHn0Em HvnZP11tWZTegaAgIgvGFZyJLTmrI7fuSjdv1Okqz1VaB9y5G39Q7wexy8HenF6NwQGh kc9aHOxjCDEUAlHk/VeiwqR9EPT9U6sVmPmy42Z+NVc9oKfcqDuqPVQvTqEqUpthZyQi ymkA== X-Gm-Message-State: AOJu0YzMRgcMVa5gqPKEGZf4Xn2cTwUXfxIhP8bfUYGIfBGIWNU5iyCQ VUO84OiUL8hB0RRKamsjLi6LHFd2KTHknLq+QOOOPUfSqvSWQiOhwdwJC4kJU5OVOXdvGsAH1ZM D X-Google-Smtp-Source: AGHT+IHP5Q8sS+F9kh0R4zB3EkKL/sIsggBdSvD7ilGLTi6JTskd+qYlvCOtweIZ323QHzCgbo/WYw== X-Received: by 2002:a05:600c:5493:b0:412:f24:560a with SMTP id iv19-20020a05600c549300b004120f24560amr5140259wmb.11.1708946071905; Mon, 26 Feb 2024 03:14:31 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org, Bernhard Beschow Cc: Laurent Vivier , Thomas Huth , BALATON Zoltan , Ani Sinha , qemu-block@nongnu.org, Marcel Apfelbaum , Eduardo Habkost , John Snow , Paolo Bonzini , "Michael S. Tsirkin" , Igor Mammedov , Richard Henderson , Mark Cave-Ayland , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH v2 02/15] hw/i386/q35: Add local 'lpc_obj' variable Date: Mon, 26 Feb 2024 12:14:01 +0100 Message-ID: <20240226111416.39217-3-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240226111416.39217-1-philmd@linaro.org> References: <20240226111416.39217-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::332; envelope-from=philmd@linaro.org; helo=mail-wm1-x332.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1708946175756100005 Instead of casting OBJECT(lpc) multiple times, do it once in the new 'lpc_obj' variable. Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- hw/i386/pc_q35.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c index 45a4102e75..dcad6000d9 100644 --- a/hw/i386/pc_q35.c +++ b/hw/i386/pc_q35.c @@ -124,6 +124,7 @@ static void pc_q35_init(MachineState *machine) X86MachineState *x86ms =3D X86_MACHINE(machine); Object *phb; PCIDevice *lpc; + Object *lpc_obj; DeviceState *lpc_dev; MemoryRegion *system_memory =3D get_system_memory(); MemoryRegion *system_io =3D get_system_io(); @@ -223,6 +224,7 @@ static void pc_q35_init(MachineState *machine) /* create ISA bus */ lpc =3D pci_new_multifunction(PCI_DEVFN(ICH9_LPC_DEV, ICH9_LPC_FUNC), TYPE_ICH9_LPC_DEVICE); + lpc_obj =3D OBJECT(lpc); lpc_dev =3D DEVICE(lpc); qdev_prop_set_bit(lpc_dev, "smm-enabled", x86_machine_is_smm_enabled(x86ms)); @@ -231,7 +233,7 @@ static void pc_q35_init(MachineState *machine) } pci_realize_and_unref(lpc, pcms->pcibus, &error_fatal); =20 - x86ms->rtc =3D ISA_DEVICE(object_resolve_path_component(OBJECT(lpc), "= rtc")); + x86ms->rtc =3D ISA_DEVICE(object_resolve_path_component(lpc_obj, "rtc"= )); =20 object_property_add_link(OBJECT(machine), PC_MACHINE_ACPI_DEVICE_PROP, TYPE_HOTPLUG_HANDLER, @@ -239,13 +241,13 @@ static void pc_q35_init(MachineState *machine) object_property_allow_set_link, OBJ_PROP_LINK_STRONG); object_property_set_link(OBJECT(machine), PC_MACHINE_ACPI_DEVICE_PROP, - OBJECT(lpc), &error_abort); + lpc_obj, &error_abort); =20 - acpi_pcihp =3D object_property_get_bool(OBJECT(lpc), + acpi_pcihp =3D object_property_get_bool(lpc_obj, ACPI_PM_PROP_ACPI_PCIHP_BRIDGE, NULL); =20 - keep_pci_slot_hpc =3D object_property_get_bool(OBJECT(lpc), + keep_pci_slot_hpc =3D object_property_get_bool(lpc_obj, "x-keep-pci-slot-hpc", NULL); =20 @@ -255,7 +257,7 @@ static void pc_q35_init(MachineState *machine) "true", true); } =20 - isa_bus =3D ISA_BUS(qdev_get_child_bus(lpc_dev, "isa.0")); + isa_bus =3D ISA_BUS(qdev_get_child_bus(DEVICE(lpc_obj), "isa.0")); =20 if (x86ms->pic =3D=3D ON_OFF_AUTO_ON || x86ms->pic =3D=3D ON_OFF_AUTO_= AUTO) { pc_i8259_create(isa_bus, gsi_state->i8259_irq); --=20 2.41.0