From patchwork Sun Nov 3 13:33:48 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bernhard Beschow X-Patchwork-Id: 13860373 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 626A8D11041 for ; Sun, 3 Nov 2024 13:35:51 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1t7aku-0006D1-UQ; Sun, 03 Nov 2024 08:35:00 -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 1t7aki-000678-Nc; Sun, 03 Nov 2024 08:34:50 -0500 Received: from mail-ed1-x52d.google.com ([2a00:1450:4864:20::52d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1t7akg-0001DE-JG; Sun, 03 Nov 2024 08:34:47 -0500 Received: by mail-ed1-x52d.google.com with SMTP id 4fb4d7f45d1cf-5ceb03aadb1so3463643a12.0; Sun, 03 Nov 2024 05:34:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1730640884; x=1731245684; 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=OSUXdq93xqCIzRVUO2sgZ5ZRdMkGuWMIHhF5tQTYyjM=; b=QQfeeZbaXBZBXD52GqBcCsyDcpX69eJBddMpbZh8ShWe4I+e7/D91lPKoImRcs/TXH tTvi4pYvhOZppokSOqbOgFXo5yySckkdGjyTBNrXS0U2PbSwMdU+slR4NB9RKxYHimuw 2V4E9u46V0ueCLFjB5UVtUBhgbk8xiVJckQRk+Ay7pN1e35PxAe0/F0e7TA9wX9w4A51 JgIMLtg+h7I6DuvguJspyIExjKLYhjEPxs4XBnV9pp/dcNZrEXX2+Bb9Y1hViZWkfbiH rTozv/Z+W6qMngYZa0cVzr4mzScKeFcAtOUcMzDP2Wm4DwL310UF9y6dbqN4m0HLBEcv qPWA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730640884; x=1731245684; 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=OSUXdq93xqCIzRVUO2sgZ5ZRdMkGuWMIHhF5tQTYyjM=; b=WXRQJSz6k5aiQ59OFy9EO2YKPqu0HsUDOBclWytGrLY6TXQVaP6rlZfmO04la6o3uk UD2djZoWKTFTv3zLtlAJ1C8MfduWvidlbLCW/inPwiSb8D1NxdX39i0/3zacUGjb5XlU gV545EtJh3PtM+xyrXZJQtonlbhdbJpWl+Mv6CkISDTQmJGUa2589L7Mz085a52Xvnk/ 1X+ixrSkty8a5ns7aOf0TyfNVaeTT2T+ALdJGqmVsQX9UITeNAG6njUQX5mVVTJZAn22 /AN5ODZtDpXCX9NsGEAmlICWV8geJKT2EZX3//ovpbN6F86RP/cXcD/27083HGBALMXj s+fg== X-Forwarded-Encrypted: i=1; AJvYcCWRaIrWdasinJePcYvH56hadVcS0M02HdpRXBcOyCCmQcyvUT8VN1JICeBBy49EbPGLgQjmi/yWp8w5@nongnu.org, AJvYcCXzaXdXe4XGzhvmeHfa5SCtKd4ocFQsnIbNkTpRqrMsx+9M/U7I0ltCP0zJ9ngz2fFYolabz3xGu2Y=@nongnu.org X-Gm-Message-State: AOJu0YygDor/tfWacS7Wg/ptx6+yrl6/ZTab9JOEZMhZBumdcTIqao0i 8rJJ/ylikoVR4mBjrT/ioqFmesugOjZZNj5/3uWFVa9p3Al+33bjiBhj6A== X-Google-Smtp-Source: AGHT+IFFoIXH+FAuPZ0vMVjN6afjo2lrtHwnrDcUbLgHXdwoGxTX3b9Sdqk6MQMli648IJ17O7cSTQ== X-Received: by 2002:a17:907:e87:b0:a99:ea2c:59d1 with SMTP id a640c23a62f3a-a9e5092959amr1331511766b.26.1730640883543; Sun, 03 Nov 2024 05:34:43 -0800 (PST) Received: from archlinux.. (pd9ed7f6d.dip0.t-ipconnect.de. [217.237.127.109]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a9e5664350esm424328866b.159.2024.11.03.05.34.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 03 Nov 2024 05:34:43 -0800 (PST) From: Bernhard Beschow To: qemu-devel@nongnu.org Cc: Jason Wang , qemu-ppc@nongnu.org, =?utf-8?q?C=C3=A9?= =?utf-8?q?dric_Le_Goater?= , Paolo Bonzini , Hanna Reitz , Nicholas Piggin , Corey Minyard , Kevin Wolf , Bin Meng , =?utf-8?q?Phi?= =?utf-8?q?lippe_Mathieu-Daud=C3=A9?= , Bernhard Beschow , qemu-block@nongnu.org, Alex Williamson , Daniel Henrique Barboza Subject: [PATCH v4 02/26] hw/ppc/e500: Remove firstenv variable Date: Sun, 3 Nov 2024 14:33:48 +0100 Message-ID: <20241103133412.73536-3-shentey@gmail.com> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20241103133412.73536-1-shentey@gmail.com> References: <20241103133412.73536-1-shentey@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::52d; envelope-from=shentey@gmail.com; helo=mail-ed1-x52d.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, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, 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+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org The firstenv variable is never read, so remove it. The env variable is then only used inside the loop, so move it there to restrict its scope. Signed-off-by: Bernhard Beschow --- hw/ppc/e500.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/hw/ppc/e500.c b/hw/ppc/e500.c index ba83f33033..0683629ac0 100644 --- a/hw/ppc/e500.c +++ b/hw/ppc/e500.c @@ -899,7 +899,6 @@ void ppce500_init(MachineState *machine) const PPCE500MachineClass *pmc = PPCE500_MACHINE_GET_CLASS(machine); MachineClass *mc = MACHINE_CLASS(pmc); PCIBus *pci_bus; - CPUPPCState *env = NULL; uint64_t loadaddr; hwaddr kernel_base = -1LL; int kernel_size = 0; @@ -921,7 +920,6 @@ void ppce500_init(MachineState *machine) IrqLines *irqs; DeviceState *dev, *mpicdev; DriveInfo *dinfo; - CPUPPCState *firstenv = NULL; MemoryRegion *ccsr_addr_space; SysBusDevice *s; PPCE500CCSRState *ccsr; @@ -930,6 +928,7 @@ void ppce500_init(MachineState *machine) irqs = g_new0(IrqLines, smp_cpus); for (i = 0; i < smp_cpus; i++) { PowerPCCPU *cpu; + CPUPPCState *env; CPUState *cs; cpu = POWERPC_CPU(object_new(machine->cpu_type)); @@ -950,10 +949,6 @@ void ppce500_init(MachineState *machine) &error_abort); qdev_realize_and_unref(DEVICE(cs), NULL, &error_fatal); - if (!firstenv) { - firstenv = env; - } - irqs[i].irq[OPENPIC_OUTPUT_INT] = qdev_get_gpio_in(DEVICE(cpu), PPCE500_INPUT_INT); irqs[i].irq[OPENPIC_OUTPUT_CINT] = @@ -974,8 +969,6 @@ void ppce500_init(MachineState *machine) } } - env = firstenv; - if (!QEMU_IS_ALIGNED(machine->ram_size, RAM_SIZES_ALIGN)) { error_report("RAM size must be multiple of %" PRIu64, RAM_SIZES_ALIGN); exit(EXIT_FAILURE);