From nobody Tue May 14 19:35:15 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; 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=fail(p=none dis=none) header.from=eik.bme.hu Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1674060561209465.7848917594994; Wed, 18 Jan 2023 08:49:21 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pIBby-0000Y2-Ed; Wed, 18 Jan 2023 11:48:32 -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 1pIBbB-0000W9-V6; Wed, 18 Jan 2023 11:47:56 -0500 Received: from zero.eik.bme.hu ([152.66.115.2]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pIBb9-0001sh-S5; Wed, 18 Jan 2023 11:47:41 -0500 Received: from zero.eik.bme.hu (blah.eik.bme.hu [152.66.115.182]) by localhost (Postfix) with SMTP id D3A52745712; Wed, 18 Jan 2023 17:45:12 +0100 (CET) Received: by zero.eik.bme.hu (Postfix, from userid 432) id 1BCFB745706; Wed, 18 Jan 2023 17:45:12 +0100 (CET) From: BALATON Zoltan Subject: [PATCH v2] ppc/pegasos2: Improve readability of VIA south bridge creation MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable To: qemu-devel@nongnu.org, qemu-ppc@nongnu.org Cc: Daniel Henrique Barboza , philmd@linaro.org Message-Id: <20230118164512.1BCFB745706@zero.eik.bme.hu> Date: Wed, 18 Jan 2023 17:45:12 +0100 (CET) X-Spam-Probability: 8% 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=152.66.115.2; envelope-from=balaton@eik.bme.hu; helo=zero.eik.bme.hu X-Spam_score_int: -41 X-Spam_score: -4.2 X-Spam_bar: ---- X-Spam_report: (-4.2 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_MED=-2.3, 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZM-MESSAGEID: 1674060564775100003 Slightly improve readability of creating the south bridge by changing type of a local variable to avoid some casts within function arguments which makes some lines shorter and easier to read. Signed-off-by: BALATON Zoltan Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- v2: Fixed typos in commit message hw/ppc/pegasos2.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/hw/ppc/pegasos2.c b/hw/ppc/pegasos2.c index f46d4bf51d..1a13632ba6 100644 --- a/hw/ppc/pegasos2.c +++ b/hw/ppc/pegasos2.c @@ -102,7 +102,8 @@ static void pegasos2_init(MachineState *machine) CPUPPCState *env; MemoryRegion *rom =3D g_new(MemoryRegion, 1); PCIBus *pci_bus; - PCIDevice *dev, *via; + Object *via; + PCIDevice *dev; I2CBus *i2c_bus; const char *fwname =3D machine->firmware ?: PROM_FILENAME; char *filename; @@ -159,19 +160,18 @@ static void pegasos2_init(MachineState *machine) pci_bus =3D mv64361_get_pci_bus(pm->mv, 1); =20 /* VIA VT8231 South Bridge (multifunction PCI device) */ - via =3D pci_create_simple_multifunction(pci_bus, PCI_DEVFN(12, 0), tru= e, - TYPE_VT8231_ISA); + via =3D OBJECT(pci_create_simple_multifunction(pci_bus, PCI_DEVFN(12, = 0), + true, TYPE_VT8231_ISA)); object_property_add_alias(OBJECT(machine), "rtc-time", - object_resolve_path_component(OBJECT(via), - "rtc"), + object_resolve_path_component(via, "rtc"), "date"); qdev_connect_gpio_out(DEVICE(via), 0, qdev_get_gpio_in_named(pm->mv, "gpp", 31)); =20 - dev =3D PCI_DEVICE(object_resolve_path_component(OBJECT(via), "ide")); + dev =3D PCI_DEVICE(object_resolve_path_component(via, "ide")); pci_ide_create_devs(dev); =20 - dev =3D PCI_DEVICE(object_resolve_path_component(OBJECT(via), "pm")); + dev =3D PCI_DEVICE(object_resolve_path_component(via, "pm")); i2c_bus =3D I2C_BUS(qdev_get_child_bus(DEVICE(dev), "i2c")); spd_data =3D spd_data_generate(DDR, machine->ram_size); smbus_eeprom_init_one(i2c_bus, 0x57, spd_data); --=20 2.30.6