From patchwork Thu Nov 2 10:05:38 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Thomas Huth X-Patchwork-Id: 740436 Delivered-To: patch@linaro.org Received: by 2002:a5d:538f:0:b0:32d:baff:b0ca with SMTP id d15csp736985wrv; Thu, 2 Nov 2023 03:06:37 -0700 (PDT) X-Google-Smtp-Source: AGHT+IH9lDqmJ0vfMoytTxIvgLfDmwC5aLZbws8Yk3cy3Z2z/lR32dCEj5xgQA4Jh+VoNBs8tr3y X-Received: by 2002:a05:6871:490f:b0:1f0:597d:fe25 with SMTP id tw15-20020a056871490f00b001f0597dfe25mr492310oab.45.1698919597281; Thu, 02 Nov 2023 03:06:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698919597; cv=none; d=google.com; s=arc-20160816; b=TSCLysDowPK4eZLJrUv2tO0s6uhR+z72gK2E7S+xKoFN8juk7egWD8HR6Yr4L4J7GL wh5U0edz47sAIIMTOYiBvG6MrJ5aWDfBJvzFb4ooBiZWdZ1rJGVPQ+ygDus+v4ESCLEv FObkkcQOrgvgeDeXmb90pEBlU/WIOopJJM69C/IzaTZYKe7IYPzdJRCGWHzlVC3SOzB3 QvJKBpt0YlC/OyLGEGtHC4vu0q213kEn/zKp8SSrEQh3DIF8HP/I70NPw4OQjA9yHHLx 3A1jgzJr+UCFLgzBp/0FO+Nqjg+PaWla7yehvibRD8RpGHVW55oRMQPnoX183h1wtLLw ABRQ== 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; bh=bf2kNhCkpvCEnz1DEQWyTqLO5YTEMKoovu/EJ+x2rmc=; fh=iCN9tuTwM5rayWWWJtHoGNfuTLfrQgz//t8J35Hw7Ts=; b=Y1RUX7QftIIlLCcpLrLFlKT8HjcreUtcMYqRHcAX3t5a86hiFi3+r48OxPZUv59hBB ZapzVg8HhcGLY5zGrEUdUj3X4Gxb4R1+jVkjU7Fm4O7AVR5MwohkagpTDncXLOJUm0pm i6eE0sQWl5YI+/kJmpT5YpulaMhPTWkwTrErL0lvFiwFb6HbskKOWm5eV/wqAAY0hqOQ w2OBUDsxiy/rCwTmXr7mwhf9mq3yQu0TpogfCo4XYoY50choDQaNTQjIfbnZaEIgnXwf RYDGTyN5VwxxcAmYqTRIAfjI9xCQ02i8Q+WMhXaFNINUSIhO1KBCc4yd0GIW6J+YSl2m XWBQ== ARC-Authentication-Results: i=1; mx.google.com; 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" Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id p10-20020a05622a13ca00b004180bc0da71si4147169qtk.71.2023.11.02.03.06.37 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 02 Nov 2023 03:06:37 -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; 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" Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qyUaQ-0001p5-F3; Thu, 02 Nov 2023 06:06:02 -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 1qyUaO-0001oX-Io for qemu-devel@nongnu.org; Thu, 02 Nov 2023 06:06:00 -0400 Received: from mail-ej1-f52.google.com ([209.85.218.52]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qyUaL-0003I3-TS for qemu-devel@nongnu.org; Thu, 02 Nov 2023 06:06:00 -0400 Received: by mail-ej1-f52.google.com with SMTP id a640c23a62f3a-9c41e95efcbso105642966b.3 for ; Thu, 02 Nov 2023 03:05:57 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698919556; x=1699524356; 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=bf2kNhCkpvCEnz1DEQWyTqLO5YTEMKoovu/EJ+x2rmc=; b=Y9RynoZSUVQ6ASsscJjUzgIzB6D/qzpmfoBpvGSXSG7jneptT3cSyM7rxbd9/b9JQD 4IvAXFfj02PM84jWiZbEHGk7uhlO9e/q5BErsjQrguIdPxJ7E2adTIvIUhRJAK5r3nn/ v/ISodVEqaTqTzRHYUQQhYK86x8XRKpWtgnlKVMVEiFhLgpNWwuGgHstTHcvoG3CCZiq /3tbeYJUZMIO8ML7tje3LsP7UfgJ9255FKiMT2I6SqyKrBV6X54ntGAVAaQYFNloQCM+ OCSsguSO5lHhRATZj0QJimJmW/cMIKDZU81shn4IEVIn22eC4Qp3VXNrIGPOVjGUdzww +7yg== X-Gm-Message-State: AOJu0YymyL9RoyrC6efREhfW7MkL/MRQUDuKn07ZWhaP75V3hBddNXUw RLRSQhtt3zUF5m1e6mmh3vjaebvsrUE= X-Received: by 2002:a17:907:97d6:b0:9bf:77ae:3aa9 with SMTP id js22-20020a17090797d600b009bf77ae3aa9mr3773951ejc.24.1698919555867; Thu, 02 Nov 2023 03:05:55 -0700 (PDT) Received: from localhost.localdomain (ip-109-42-115-39.web.vodafone.de. [109.42.115.39]) by smtp.gmail.com with ESMTPSA id o21-20020a170906359500b009b97d9ae329sm927236ejb.198.2023.11.02.03.05.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Nov 2023 03:05:55 -0700 (PDT) From: Thomas Huth To: qemu-devel@nongnu.org, Stefan Hajnoczi Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PULL 05/10] hw/m68k/next-cube: Do not open-code sysbus_create_simple() Date: Thu, 2 Nov 2023 11:05:38 +0100 Message-ID: <20231102100543.4875-6-huth@tuxfamily.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231102100543.4875-1-huth@tuxfamily.org> References: <20231102100543.4875-1-huth@tuxfamily.org> MIME-Version: 1.0 Received-SPF: pass client-ip=209.85.218.52; envelope-from=th.huth@gmail.com; helo=mail-ej1-f52.google.com X-Spam_score_int: -13 X-Spam_score: -1.4 X-Spam_bar: - X-Spam_report: (-1.4 / 5.0 requ) BAYES_00=-1.9, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no 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 From: Philippe Mathieu-Daudé 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é Reviewed-by: Richard Henderson Reviewed-by: Thomas Huth Message-ID: <20231024083010.12453-6-philmd@linaro.org> Signed-off-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*/