From patchwork Mon Nov 25 14:05:33 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: 845324 Delivered-To: patch@linaro.org Received: by 2002:a5d:688e:0:b0:382:43a8:7b94 with SMTP id h14csp1198936wru; Mon, 25 Nov 2024 06:09:41 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCXVe6l+BWXqiBcFf8tLAFB7gZliijE9GwRiymni5jxx92YpbT46eQcgkuTa/pTmGKlI7vHHUQ==@linaro.org X-Google-Smtp-Source: AGHT+IGgWeUCf7B1wGOoiFNpKwqIVHi12vvM1kgQyYdv8to3+NAltx6JKwpK7uSGl+o7eWVoO0kg X-Received: by 2002:a05:600c:4447:b0:431:55bf:fe4 with SMTP id 5b1f17b1804b1-433ce491837mr113182635e9.24.1732543780972; Mon, 25 Nov 2024 06:09:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1732543780; cv=none; d=google.com; s=arc-20240605; b=GZL0kLqyBxwva+ekdzStEDIG9J60kq7keO0c/8cI6cF+8/j1VCISeH3GFWw0iGVbnU 7BYUhjDzB+HZi4ax+HSVhVmQKcbBM0s+DMan0LRpXRrX/H3O3AeO9YndHj4yK6dFIYAd CRQFI/1uxwDaZ+BKpA+ewKlLWbvmSYOi9xsd1OuEdvA5cwXdgzLLjux0vQlOG9+Dgzd2 NllzJ9b6wHeXVfeibQlGOM+6gdY8IzfuAG6XS0LQ+ZF0du5tTJ7Umo3X2HGZpXhgTC5m wItwt4n4IQDoAVuD03P1ho5yyxzGwzv5A/wgVInrzDOdDuk6DcqPO60Pv5Zvl5wwQkNz j4LQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; 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=CidC1DzNGex4xdl38okZ6dg7MoluQ+zRZMKK1keD2+U=; fh=01MTBs686u0z/v+1HBxc617dy4wgnTfT5lmRb9hvZO0=; b=HmlP77BaHj9h2P3oAz8gjPLPUuuSfB3+D2qPgrfNplDva6Cy9i/h73wTbrKtrmdXDL AFdH0xpH4s5jSxu9lf15R9hyhj4EFjcej+BppIsFVmTkkhxWiS6SoMPzDhCcPlixgEiD HKTR3mY4sptJbyi+k91yz1CLo/ymRo5ohQ74I58HaGC6Sp05UaIC8NQoRsCZQSL3pWiz LwC7YVztxY7gJ4xQKs2pPkgjQTGEbC9/tMD0w7bPp62Hp68f3u6TH3XJnBlqR1mQ5GE/ J2NQFqqBaInFzjFYciQZFSC1xqTo1VoP/hfRg+6mGcDBW69RDkIB8+MmKya2Kh8GI9ZT o/Ng==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=LSk6hKme; 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; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id 5b1f17b1804b1-434a09729eesi9330485e9.192.2024.11.25.06.09.40 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 25 Nov 2024 06:09:40 -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=LSk6hKme; 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; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tFZkP-0003Vg-06; Mon, 25 Nov 2024 09:07:29 -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 1tFZkD-0002sv-NR for qemu-devel@nongnu.org; Mon, 25 Nov 2024 09:07:18 -0500 Received: from mail-lf1-x12e.google.com ([2a00:1450:4864:20::12e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tFZkB-0006kt-9J for qemu-devel@nongnu.org; Mon, 25 Nov 2024 09:07:16 -0500 Received: by mail-lf1-x12e.google.com with SMTP id 2adb3069b0e04-53de27f1478so1502284e87.2 for ; Mon, 25 Nov 2024 06:07:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1732543631; x=1733148431; 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=CidC1DzNGex4xdl38okZ6dg7MoluQ+zRZMKK1keD2+U=; b=LSk6hKmeFAbz8lC7fHUMSEV0llmA1Cp8ZY4J6nZmBlLMWvk3xCgCWJPEHyJqf8U9+3 l5mU0SMCmTjZPfTTrP7jkkmLGQcxLgv4VJl60KNldTy1Nwfov4U3fkEtZ0P5y+VDPVMT WcS+z4Wmb//yCtynd0PqqFNPAMmSc0QS3xRJCClxeACqgIBoOEySOXnzaFaq6Uz1MyOT IC9Id3mw8rJyy67zgqQOcfVvxb+e/dQP83k8z+UJ3s2GG9BKkWW4nUIWIbQpEVN5Gcwx YPhKmHR8U3S0VBRPNDtvt69pfwHL8+UO68dzSz245AXpqJPVI63Th+IywmkMO+ld/6t+ 6JhA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1732543631; x=1733148431; 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=CidC1DzNGex4xdl38okZ6dg7MoluQ+zRZMKK1keD2+U=; b=irm3qcXX2NkGaF7BB3YzCKDnS/+mWeWpQXv2gOuJURV3P2l89kmOrFoyURbyn5Ubdu x0RVEsXzDtCsWpP74Xk97E4IEpAKSLMIru33DZSuIWBWZwKBp1cHw27yzdBS+TsXDtt1 xEQ/pHRyNk033NT1vRQzXip7GjuS8/UybvwgWU7hyh7G9zCwn4eltQOulHDt4dzPTacD Vr3QGNw9PpFdwHHelmsVPRoBsE4ZVb1BCfIK4EYiZK6yGI3NGybiOTJ16URShs1RfEzR Z5mbUHlUtpRz8rz32BFmj79feVdwsZqkApSiFe12k7+98oiP4ELXpwdohRNTsfhH82Lr Ju/g== X-Gm-Message-State: AOJu0YxvHwR0ee+8teFWbj060VjgIKxgiepQmrdHt+NOE2j/lN8qLk04 9UgvcFdR01wR/1Y68lMXOKjctByJ19xbNOby0nyOWKmm9OTi13YBxIfdt/C7ug9MxIV7eFc2Kqy P X-Gm-Gg: ASbGncss5mOxunGQLM2rSJDelKEBdtcU/1XkvqajByTbw0zbh8jmouQyaN0P/O+hiKx kCY2YEcFVY6sXwsF+6QzZmUAVQPFgblCfKQ3KWJq7O3BrdCnCY8lccXf8JvrfGNps+TfRdrG3fx tPvbVyha99roS2Ec/h7pUNbPa4TiLblDzLwvuUXzOjVY2yve6+WiiiOvNCx7dV+bo3l2rPv0hVf A2BeCAFad1MQyLz8cJBLhH+IR9i1HSHKWxCxa/LHyuTaJvxRkskqvdfSxVIJpXfyM7Dhph9 X-Received: by 2002:a05:6512:b12:b0:53d:cfdb:c65c with SMTP id 2adb3069b0e04-53dd39b62d8mr5978210e87.52.1732543631212; Mon, 25 Nov 2024 06:07:11 -0800 (PST) Received: from localhost.localdomain ([176.176.170.239]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4349ca82957sm63707025e9.33.2024.11.25.06.07.08 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 25 Nov 2024 06:07:10 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Daniel Henrique Barboza , Marcin Juszkiewicz , Bin Meng , Alistair Francis , Harsh Prateek Bora , Zhao Liu , =?utf-8?q?Daniel_P_=2E_Berrang=C3=A9?= , Daniel Henrique Barboza , =?utf-8?q?Philippe_Mat?= =?utf-8?q?hieu-Daud=C3=A9?= , Liu Zhiwei , Palmer Dabbelt , Marcel Apfelbaum , qemu-arm@nongnu.org, "Michael S. Tsirkin" , Nicholas Piggin , Leif Lindholm , Peter Maydell , qemu-riscv@nongnu.org, Weiwei Li , Radoslaw Biernacki , Thomas Huth , Yanan Wang , Eduardo Habkost , qemu-ppc@nongnu.org Subject: [PATCH-for-10.0 6/8] hw/riscv/virt: Remove pointless GPEX_HOST() cast Date: Mon, 25 Nov 2024 15:05:33 +0100 Message-ID: <20241125140535.4526-7-philmd@linaro.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20241125140535.4526-1-philmd@linaro.org> References: <20241125140535.4526-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::12e; envelope-from=philmd@linaro.org; helo=mail-lf1-x12e.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 No need to QOM-cast twice, since the intermediate value is not used. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Thomas Huth --- hw/riscv/virt.c | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/hw/riscv/virt.c b/hw/riscv/virt.c index 45a8c4f819..2feb851f15 100644 --- a/hw/riscv/virt.c +++ b/hw/riscv/virt.c @@ -1140,23 +1140,21 @@ static inline DeviceState *gpex_pcie_init(MemoryRegion *sys_mem, dev = qdev_new(TYPE_GPEX_HOST); /* Set GPEX object properties for the virt machine */ - object_property_set_uint(OBJECT(GPEX_HOST(dev)), PCI_HOST_ECAM_BASE, + object_property_set_uint(OBJECT(dev), PCI_HOST_ECAM_BASE, ecam_base, NULL); - object_property_set_int(OBJECT(GPEX_HOST(dev)), PCI_HOST_ECAM_SIZE, + object_property_set_int(OBJECT(dev), PCI_HOST_ECAM_SIZE, ecam_size, NULL); - object_property_set_uint(OBJECT(GPEX_HOST(dev)), - PCI_HOST_BELOW_4G_MMIO_BASE, + object_property_set_uint(OBJECT(dev), PCI_HOST_BELOW_4G_MMIO_BASE, mmio_base, NULL); - object_property_set_int(OBJECT(GPEX_HOST(dev)), PCI_HOST_BELOW_4G_MMIO_SIZE, + object_property_set_int(OBJECT(dev), PCI_HOST_BELOW_4G_MMIO_SIZE, mmio_size, NULL); - object_property_set_uint(OBJECT(GPEX_HOST(dev)), - PCI_HOST_ABOVE_4G_MMIO_BASE, + object_property_set_uint(OBJECT(dev), PCI_HOST_ABOVE_4G_MMIO_BASE, high_mmio_base, NULL); - object_property_set_int(OBJECT(GPEX_HOST(dev)), PCI_HOST_ABOVE_4G_MMIO_SIZE, + object_property_set_int(OBJECT(dev), PCI_HOST_ABOVE_4G_MMIO_SIZE, high_mmio_size, NULL); - object_property_set_uint(OBJECT(GPEX_HOST(dev)), PCI_HOST_PIO_BASE, + object_property_set_uint(OBJECT(dev), PCI_HOST_PIO_BASE, pio_base, NULL); - object_property_set_int(OBJECT(GPEX_HOST(dev)), PCI_HOST_PIO_SIZE, + object_property_set_int(OBJECT(dev), PCI_HOST_PIO_SIZE, pio_size, NULL); sysbus_realize_and_unref(SYS_BUS_DEVICE(dev), &error_fatal); @@ -1189,7 +1187,7 @@ static inline DeviceState *gpex_pcie_init(MemoryRegion *sys_mem, gpex_set_irq_num(GPEX_HOST(dev), i, PCIE_IRQ + i); } - GPEX_HOST(dev)->gpex_cfg.bus = PCI_HOST_BRIDGE(GPEX_HOST(dev))->bus; + GPEX_HOST(dev)->gpex_cfg.bus = PCI_HOST_BRIDGE(dev)->bus; return dev; }