From patchwork Sun Oct 30 22:28:34 2022 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: 620038 Delivered-To: patch@linaro.org Received: by 2002:a17:522:c983:b0:460:3032:e3c4 with SMTP id kr3csp2452607pvb; Sun, 30 Oct 2022 15:37:01 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7OrkVtAR2c0a78fmKGqJBPVGkJWRJks9Aw5OhZ+yQNo7oacY2XLWZkYeWordgb4YuepPa4 X-Received: by 2002:a05:6214:1d0b:b0:4bb:19c6:2a59 with SMTP id e11-20020a0562141d0b00b004bb19c62a59mr8548097qvd.50.1667169421377; Sun, 30 Oct 2022 15:37:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667169421; cv=none; d=google.com; s=arc-20160816; b=TpzT1ykZlHwmpYW1p3gfdKg310NslAOHauI0m586atMW31vdezUjIRfmnsbtUQyVuU hbhQC/pX1J2JJzz+DFvYA5VWcxsugNpCof5KIZwYyHXI1scjNYGdPH6TCoorJKcf/pjE N47KcH6BaUH30JrniA12EvRI+UmQIYUuD+xEaoCO8UntMe/veMtn8fkas0RId9qxnI7O TF2P+NDPZ76GFHYdBTRiLkX1visxXNQMkzBZxMMPfFlu5utPujs1+ThTWbPSGUsdLrLw aeLJCZcqZhh2Z40nz5opdB/1/xtrMuq5RBOdjFJB1IrITXRo1yCRRokzDWnMhvC1bA9t QbFA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:sender: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=ZmmXEXyVmeaeq801a3SSzA2lFB/U3WaewUO331bNFbI=; b=kKK+SLrS0vBQTTPoEa9IEH7AEO1kJThXZQr25ix+lCdBBY4QcDYVBQI5ylRTCYvYkf BREfho7e065XJyhfA+Xi7EIwOE+/0kPT367a8xoC5DCVlTN1//b7hOmgXvsjTLXfiO/5 Up2Luh6aM4R7Rzsf2dROLHIXDIvXcfGJuupMlyMQjdYZbgZSZ1Gxu4ukhpHikxE5f7cK 06mKvfUJm3HiE5nzeoHexgZz5bFJ3wySTEXbNyJrrGu78Fwgx+oMamUPcF8Uz5RDDINE 37MbXplfFw50BmnfZDnjE4nlt44OxIRxDSbc+DH3vZTbnKWI3VVSLNIh91YaYq8qDOJx 0spg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=qUpcJejn; 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 t3-20020ac87603000000b003a51e6b761bsi1632035qtq.369.2022.10.30.15.37.01 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sun, 30 Oct 2022 15:37:01 -0700 (PDT) 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=qUpcJejn; 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 1opGu2-0001I1-9X; Sun, 30 Oct 2022 18:35:42 -0400 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 1opGsV-00059D-9c for qemu-devel@nongnu.org; Sun, 30 Oct 2022 18:34:04 -0400 Received: from mail-wm1-x333.google.com ([2a00:1450:4864:20::333]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1opGsT-0000Ng-E9 for qemu-devel@nongnu.org; Sun, 30 Oct 2022 18:34:02 -0400 Received: by mail-wm1-x333.google.com with SMTP id 5so6236547wmo.1 for ; Sun, 30 Oct 2022 15:34:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; 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=ZmmXEXyVmeaeq801a3SSzA2lFB/U3WaewUO331bNFbI=; b=qUpcJejn3/q3zhAdMuycjc1yxm+FiwK3u0U1Hbj34OyPelPh0v3/a873DCkJ3ttFf+ dQOoTM8jCoCZh6XAUdfckG8kBCN/oEvtoeu9X6m0X+AX+0hRnS5wusvycuwwqOzP0jhp IZzve954fkIUEXvPlH4fiUNEnL4yhcboutmDvhGdFv71juLrV8QB4lpERLP9gGbpRTvj E8cDrWifVVn8nzzjK1e6wyyifFQl4E9QY/5SIWjzXyY52bZqLVL0GH1YoBKwwUVDjAj9 43aCt5c2+3gnH96WR3XLuSAAoyl7WEuPTCKXOYvGKIgku6+STeINYgIp8XgwIZQdyCoq 2Msg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=ZmmXEXyVmeaeq801a3SSzA2lFB/U3WaewUO331bNFbI=; b=6LFkdnguMDxtMCG8QqW7UTHNCovQKAbYPHOFhP+KcF5uRzYZVXaak0ob0Z0nARp0y/ hQJ1EkXIAsU4k9On2oWs8gVMdfJ8jjfr2HkcVbYSK3tOibniV53ivOuXaBl+hmNO+R49 V5kVrjVZ8KtObLEtg4GmY1OnKrRmHyRyEgK5cLbNCmQFOjBOERuunkAtVeuy2hhfsTdo wC4krKeneXUyP5N3H7IEwsPbyuz6xR9pyxhasi4rpmaqktfOTOKOxObB7cGk+lO87Tuu 0wJOIyxsF2V9GnkP/sP7drqIu+SZ/D31F3ga1YbbKqFPWx7vOBg8bwIIII/s4pB/f1Q0 SVUQ== X-Gm-Message-State: ACrzQf01TQR8E6paOtT7ZJr7FeufE6Ail31+ouSjMDPj8UqY+76BZjOs OmRNRz2R5HX30LqLXq9JUbOsHevzK3F6VA== X-Received: by 2002:a05:600c:4586:b0:3c6:fbb0:bf2d with SMTP id r6-20020a05600c458600b003c6fbb0bf2dmr5984663wmo.13.1667169239866; Sun, 30 Oct 2022 15:33:59 -0700 (PDT) Received: from localhost.localdomain ([185.126.107.38]) by smtp.gmail.com with ESMTPSA id k6-20020a05600c1c8600b003b4e009deb2sm6078461wms.41.2022.10.30.15.33.58 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sun, 30 Oct 2022 15:33:59 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Aleksandar Rikalo , Huacai Chen , Stefan Pejic , Jiaxun Yang , Aurelien Jarno , Paul Burton , Bernhard Beschow Subject: [PULL 48/55] hw/mips/malta: Reuse dev variable Date: Sun, 30 Oct 2022 23:28:34 +0100 Message-Id: <20221030222841.42377-49-philmd@linaro.org> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20221030222841.42377-1-philmd@linaro.org> References: <20221030222841.42377-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::333; envelope-from=philmd@linaro.org; helo=mail-wm1-x333.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=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: , Sender: "Qemu-devel" Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Bernhard Beschow While at it, move the assignments closer to where they are used. Signed-off-by: Bernhard Beschow Reviewed-by: Philippe Mathieu-Daudé Message-Id: <20221022150508.26830-26-shentey@gmail.com> Signed-off-by: Philippe Mathieu-Daudé --- hw/mips/malta.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/hw/mips/malta.c b/hw/mips/malta.c index 5099ed9592..6ac811763c 100644 --- a/hw/mips/malta.c +++ b/hw/mips/malta.c @@ -1237,7 +1237,6 @@ void mips_malta_init(MachineState *machine) MaltaState *s; PCIDevice *piix4; DeviceState *dev; - DeviceState *pm_dev; s = MIPS_MALTA(qdev_new(TYPE_MIPS_MALTA)); sysbus_realize_and_unref(SYS_BUS_DEVICE(s), &error_fatal); @@ -1403,13 +1402,13 @@ void mips_malta_init(MachineState *machine) TYPE_PIIX4_PCI_DEVICE); dev = DEVICE(piix4); isa_bus = ISA_BUS(qdev_get_child_bus(dev, "isa.0")); - pm_dev = DEVICE(object_resolve_path_component(OBJECT(dev), "pm")); - smbus = I2C_BUS(qdev_get_child_bus(pm_dev, "i2c")); /* Interrupt controller */ qdev_connect_gpio_out_named(dev, "intr", 0, i8259_irq); /* generate SPD EEPROM data */ + dev = DEVICE(object_resolve_path_component(OBJECT(piix4), "pm")); + smbus = I2C_BUS(qdev_get_child_bus(dev, "i2c")); generate_eeprom_spd(&smbus_eeprom_buf[0 * 256], ram_size); generate_eeprom_serial(&smbus_eeprom_buf[6 * 256]); smbus_eeprom_init(smbus, 8, smbus_eeprom_buf, smbus_eeprom_size);