From patchwork Fri Oct 20 15:06:25 2023 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: 736250 Delivered-To: patch@linaro.org Received: by 2002:adf:dd81:0:b0:32d:baff:b0ca with SMTP id x1csp353681wrl; Fri, 20 Oct 2023 08:07:36 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEs/uT/AuLLvIpfcIfqNFdXsMHgI06d7rU7X5fk6k1U47O8fltv4sQG3M0oNoyzOLR3gGO3 X-Received: by 2002:a05:6871:4684:b0:1ea:8b10:247a with SMTP id ni4-20020a056871468400b001ea8b10247amr2859126oab.42.1697814456417; Fri, 20 Oct 2023 08:07:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697814456; cv=none; d=google.com; s=arc-20160816; b=ZYItG4VYP0L/FCsdiAW43HAx1dEuqdmRNWc5/5rQnGnl2uc+DNclFHPotqEoDHor+q 1Mfxj4hFSboYmACoJGhwD5jcBJYITg6cKdT7C0MRTJU/Rzv1gHCqq27BYfz9CdWBfQEm /cJjBqwc1faRdbh8i7eHbe5BhL0Hcmsamt6GB5PoiSCgeczf6XHt7sdphqTOgwK4LOTK cZ9DZdZ7h2gvkGhZfiuPwjELACU+3biARPtDIVzWg07UE1/9rQqtpmos1l3cfx1KDtMq JlohYaaTv12NzyOhQ+KtKh1KiXExePyoUf8Q0IYMb4Ip69RTyrdWub4u10o2bPObgtGd nXvQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; 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=c0zvSCA6AYDZV2ErRdt/jshRiMTPrawiKivetLDL0Ao=; fh=6K1MWX6u3jkCueyV8jYuo9x2BPi9GJqFYEKyGoRKT0U=; b=ZAV43Mwi0lSDsP/i9eV4p9fBXVL+O2XVbjDxk8pjlPOPDGYex/8VE1I8BJOMloy5bF dOmGZx0Wee+2fLZhATEmA/km7adyI7AgxvXIhX7Lgzx4SiSgbry6CCqzbNuESchX8YHt bqlFaltD1S4Awifw8BNEOOeSgXjpnZkahI0Q+OYWs1B5C3ZnLDMgFMLgpJ29n+wUQHJM 46gbJilfnvPVLScRj3E9y6ffFCYaRfbP+qhYwHuI/ZFwpmvYtEgkT9wr04XCVMmv4GNP ZRiYF1Kv1U/2xRTnKwTKZ83frj18Nj4adUjuVeYHCaCvXQmcYvlrUK43LqZEaJCWVraZ JqzQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=qObmGYqp; 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 g12-20020ac8580c000000b00403561a9373si1363328qtg.649.2023.10.20.08.07.36 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 20 Oct 2023 08:07:36 -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=qObmGYqp; 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 1qtr5i-0006Rf-41; Fri, 20 Oct 2023 11:07:10 -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 1qtr5g-0006Jw-0y for qemu-devel@nongnu.org; Fri, 20 Oct 2023 11:07:08 -0400 Received: from mail-ej1-x635.google.com ([2a00:1450:4864:20::635]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qtr5e-0001Os-3v for qemu-devel@nongnu.org; Fri, 20 Oct 2023 11:07:07 -0400 Received: by mail-ej1-x635.google.com with SMTP id a640c23a62f3a-9c2a0725825so143769966b.2 for ; Fri, 20 Oct 2023 08:07:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697814422; x=1698419222; 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=c0zvSCA6AYDZV2ErRdt/jshRiMTPrawiKivetLDL0Ao=; b=qObmGYqpNx+Y9Yos4/6Gxj3LJLotzanwAGws++IG/gGvx6TFh5+HwSSSk4eRqWNJXH xx5b5Iq3pGbJ9kKTOYg8EFHkKxG4N2pq55Cx0iv4ku/IJbK1z1MgiEXRPDnVctMeiApk tZFWRGIWBDdAZF9RtsBqWstz2oJkdgM35WMtUzQG8H9eUTc3rKNNmhjzuu/sjXAy3CAP x0qUzEwCfq+eJCsCHFnhfM6ziy03erYIDeEC7VQJh9MUf3qtQHSf75Og1ZceCrwwZ+Sk 53EzLPBsqb9iViaACD5Mib539XM5dGcbBYom5zVVBPyqCTr9rYYz5TcmZ1dM8J8Oup3F xyhg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697814422; x=1698419222; 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=c0zvSCA6AYDZV2ErRdt/jshRiMTPrawiKivetLDL0Ao=; b=j7nGbN8MpcJKaGJ8ISOHI8fZU/AxjrkMe8yyP3yukZ4CXbyFzRm0pV9a8S7JA6i7JR Mx92dACHbtwJWCBD7uONoV3BifJCp/b62Wnyp+++9MIpHIQL59ZCQwWekzkts5ub3Ja6 gnUpp1rrwhP4UKyHRhDoug9Sxr48Dtz8JsQtAuZOlWB30A87Ov9uREtNl3Bs3lnhk8aw /TD3d3qHMmb0MM8JV/Lwlp+iSezV+EAZzun2bERDghsb0V/3FI55HsMHYOomSUe9/XBQ wU2SIGgyLeKOQUybDHSJVUZ4Tu+6mkti6aQeOkIWHQiBucbpYKzO2cvTGKSKXxzKB2Sz W3Tw== X-Gm-Message-State: AOJu0YxH2vsLwqTt7mD0o6FHypncxiqT595hA4YyMsxI90B9vPrAV9lT LGYJbxZiV3cn3VIhL8qN3cZywsmQ/7D8TjbXnww= X-Received: by 2002:a17:907:6088:b0:9ad:8aac:362b with SMTP id ht8-20020a170907608800b009ad8aac362bmr1851341ejc.23.1697814422591; Fri, 20 Oct 2023 08:07:02 -0700 (PDT) Received: from m1x-phil.lan (tbo33-h01-176-171-212-97.dsl.sta.abo.bbox.fr. [176.171.212.97]) by smtp.gmail.com with ESMTPSA id m10-20020a170906234a00b009b29668fce7sm1646701eja.113.2023.10.20.08.07.01 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 20 Oct 2023 08:07:02 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Mark Cave-Ayland , Laurent Vivier , Thomas Huth , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PATCH 5/6] hw/m68k/next-cube: Do not open-code sysbus_create_simple() Date: Fri, 20 Oct 2023 17:06:25 +0200 Message-ID: <20231020150627.56893-6-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231020150627.56893-1-philmd@linaro.org> References: <20231020150627.56893-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::635; envelope-from=philmd@linaro.org; helo=mail-ej1-x635.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: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Mechanical change using the following coccinelle script: @@ identifier dev; identifier sbd; expression qom_type; expression addr; @@ - dev = qdev_new(qom_type); - sysbus_realize_and_unref(SYS_BUS_DEVICE(dev), &error_fatal); - sysbus_mmio_map(SYS_BUS_DEVICE(dev), 0, addr); + dev = sysbus_create_simple(qom_type, addr, NULL); then manually removing the 'dev' variable to avoid: error: variable 'dev' set but not used [-Werror,-Wunused-but-set-variable] Signed-off-by: Philippe Mathieu-Daudé Tested-by: Thomas Huth Reviewed-by: Thomas Huth --- hw/m68k/next-cube.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/hw/m68k/next-cube.c b/hw/m68k/next-cube.c index 5d244b3b95..d17e6be8e1 100644 --- a/hw/m68k/next-cube.c +++ b/hw/m68k/next-cube.c @@ -950,7 +950,6 @@ static void next_cube_init(MachineState *machine) MemoryRegion *bmapm2 = g_new(MemoryRegion, 1); MemoryRegion *sysmem = get_system_memory(); const char *bios_name = machine->firmware ?: ROM_FILE; - DeviceState *dev; DeviceState *pcdev; /* Initialize the cpu core */ @@ -974,9 +973,7 @@ static void next_cube_init(MachineState *machine) memory_region_add_subregion(sysmem, 0x04000000, machine->ram); /* Framebuffer */ - dev = qdev_new(TYPE_NEXTFB); - sysbus_realize_and_unref(SYS_BUS_DEVICE(dev), &error_fatal); - sysbus_mmio_map(SYS_BUS_DEVICE(dev), 0, 0x0B000000); + sysbus_create_simple(TYPE_NEXTFB, 0x0B000000, NULL); /* MMIO */ sysbus_mmio_map(SYS_BUS_DEVICE(pcdev), 0, 0x02000000); @@ -993,9 +990,7 @@ static void next_cube_init(MachineState *machine) memory_region_add_subregion(sysmem, 0x820c0000, bmapm2); /* KBD */ - dev = qdev_new(TYPE_NEXTKBD); - sysbus_realize_and_unref(SYS_BUS_DEVICE(dev), &error_fatal); - sysbus_mmio_map(SYS_BUS_DEVICE(dev), 0, 0x0200e000); + sysbus_create_simple(TYPE_NEXTKBD, 0x0200e000, NULL); /* Load ROM here */ /* still not sure if the rom should also be mapped at 0x0*/