From patchwork Tue Oct 24 08:30:09 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: 737528 Delivered-To: patch@linaro.org Received: by 2002:adf:dd81:0:b0:32d:baff:b0ca with SMTP id x1csp1916789wrl; Tue, 24 Oct 2023 01:31:21 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGzzzjCI05JkbStkt1p+BDEtlDFwZSsqC/y/1QJ1Ii3rPU9z4Jq12NOL8FU1l9/zeaAohov X-Received: by 2002:ac8:5783:0:b0:41e:21c9:fef7 with SMTP id v3-20020ac85783000000b0041e21c9fef7mr4161428qta.63.1698136281504; Tue, 24 Oct 2023 01:31:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698136281; cv=none; d=google.com; s=arc-20160816; b=YXfansPK7QsXnEdRX4QKts0SJHCBxPSGu+rhRbRQ/7ex2paUJAWp52bG3QqnaXyfIA nMnajgaZMYAV2PjlligrfsUuNNitJ7tmKug4dRjx3Q0r9GCaZZTuZw8u66sXBj/dUwwW nvrOETnrbDyAazoMBGA3CwvzCYHjD7CCOQz7zZGsdBjrOLikyfQKAUyPhLJ0LprsJ+YN uOLvnz2fSkXf6kcvs83NBY7YWdSEtddJ5WqeYzUes9sdVD1k9cuqeCykKFdtihuSevV7 RRCnPS+lcuTiC8NmmMUl3/jB7W0RB2o8FQcu2tk3jg4Jv7+lBGKKJGEWps82rfr1HbGq zWTA== 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=he7WJqvEltVxRP8YaDhG1VvbH+UnVaFuryry2MF/wd8=; fh=JCpky7niHyNvgZITwflAzKrQ1Rp2zJoC9GCk/Ap1/EE=; b=h56tK4/zgJZW/Fe3TJML76yWrIPOO0z87ZHzosNFKRyogWZbpLbsKg6+HGexIk+uB4 zb7Q0ez8+5TZ+xaMFvHCBYK6kL7gtKEhguJJrFGv7jcxtzcCkhVgYEq+AAEvURgTRzY8 P7al8/+sRVrHGXHbcWsZDKru/wD+ygdBMHr3woWM8SPuD56/VSoNnppcN3K8uMEgwbxH B2q7q4ZUD6Zrj+QHnC9Q6rptPabWLSwqxMqjOm0lOVOrxUw0W3Yvb44yMZENG7H3ZHmq CTMr8GxOde5QA/cQOw7ff2GBnDT0LgLLEfmIwXwdfHj15Ky89fwrY2YbjrXZz8R9AwXC qaYQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=PyHYI7+S; 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 10-20020ac84e8a000000b0041cb95e3d9asi6742181qtp.44.2023.10.24.01.31.21 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 24 Oct 2023 01:31:21 -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=PyHYI7+S; 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 1qvCoO-0001fk-TN; Tue, 24 Oct 2023 04:30:52 -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 1qvCoM-0001fY-J3 for qemu-devel@nongnu.org; Tue, 24 Oct 2023 04:30:50 -0400 Received: from mail-lj1-x22d.google.com ([2a00:1450:4864:20::22d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qvCoK-0001CN-G5 for qemu-devel@nongnu.org; Tue, 24 Oct 2023 04:30:50 -0400 Received: by mail-lj1-x22d.google.com with SMTP id 38308e7fff4ca-2c523ac38fbso62310381fa.0 for ; Tue, 24 Oct 2023 01:30:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1698136246; x=1698741046; 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=he7WJqvEltVxRP8YaDhG1VvbH+UnVaFuryry2MF/wd8=; b=PyHYI7+SqssB5XC7I33R4At8I/pAynzuNYJ8Nt5er3Mmtm9BJ9odugLiZibx9VjSi9 v6R6aDEBzjLCgugg/8LT0pU0Qw3OdPJ9nYi0ltw4XG898DJCc0hm7nQJA/T/F5PQsbtE aqSuaMOGKskeG/sLFqq7q1ZlhW4hNM33SWh3dn6z804Y/tUaBsIOrwwDd8n3w3i5ESGn ASuzGuvwzcsPhKuzg8Ota6eosxUVQRWB7XibMXKp4pPVSexOHomhzdJg3OOcmZHtJnlr 7LMRdDQay6axalNZaw5iTqKJO0ylLzFxWhI64mFnNhJa8eWmeoDflcNR0X/tCu8WrfpF kLHg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698136246; x=1698741046; 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=he7WJqvEltVxRP8YaDhG1VvbH+UnVaFuryry2MF/wd8=; b=mTGAVJuvNprW79+4ootmXKkn9sty5/VLHJptrgKuBVKVv3q/6TFehxtstSvzbkEBHo fqKwlWDE1cgDyeaTs8pvg3xuFcBDW2+NN9G7ShRYQ95OfcyNsxFbLt/Cc0TvdqN74Qbr jBnXLuROoPSYo5sTNwQ+00XGICk8PAqrgSjBnEh5UyN1o9+1aME10MZu29Zal8QvUcXA uSSqC83GxNr2gCRh7/VJiNRU301TDJ9yeSqPM2/+BbKLgV/hWMiIAbASp/kQus2iCnBd YS7QSHq93m24ci9crohsLLyW7qIdQ74j+SGB2NCxfYx3rpe9dFju5b7EetFs9kvyBwy9 3CIA== X-Gm-Message-State: AOJu0YxFpqqWuG5rsCieDwkMuqRrwv2G1Gj93J+LEoC9rzupuIwVAh2l 1+eqMkznkIln/zPDc0/9bzSZ5OIQ+u/J00C5x0Q= X-Received: by 2002:a05:651c:a0c:b0:2c5:24a8:c22d with SMTP id k12-20020a05651c0a0c00b002c524a8c22dmr11253759ljq.3.1698136246643; Tue, 24 Oct 2023 01:30:46 -0700 (PDT) Received: from m1x-phil.lan (sem44-h01-176-172-55-165.dsl.sta.abo.bbox.fr. [176.172.55.165]) by smtp.gmail.com with ESMTPSA id c8-20020a05600c0a4800b0040775fd5bf9sm11594619wmq.0.2023.10.24.01.30.45 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 24 Oct 2023 01:30:46 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Mark Cave-Ayland , Thomas Huth , Laurent Vivier , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Richard Henderson Subject: [PATCH v2 6/6] hw/m68k/virt: Do not open-code sysbus_create_simple() Date: Tue, 24 Oct 2023 10:30:09 +0200 Message-ID: <20231024083010.12453-7-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231024083010.12453-1-philmd@linaro.org> References: <20231024083010.12453-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::22d; envelope-from=philmd@linaro.org; helo=mail-lj1-x22d.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; expression qom_type; expression addr; expression irq; @@ - dev = qdev_new(qom_type); - sysbus_realize_and_unref(SYS_BUS_DEVICE(dev), &error_fatal); - sysbus_mmio_map(SYS_BUS_DEVICE(dev), 0, addr); - sysbus_connect_irq(SYS_BUS_DEVICE(dev), 0, irq); + dev = sysbus_create_simple(qom_type, addr, irq); Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Reviewed-by: Thomas Huth --- hw/m68k/virt.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/hw/m68k/virt.c b/hw/m68k/virt.c index e7dc188855..2e49e262ee 100644 --- a/hw/m68k/virt.c +++ b/hw/m68k/virt.c @@ -201,11 +201,8 @@ static void virt_init(MachineState *machine) sysbus_connect_irq(sysbus, 0, PIC_GPIO(VIRT_GF_TTY_IRQ_BASE)); /* virt controller */ - dev = qdev_new(TYPE_VIRT_CTRL); - sysbus = SYS_BUS_DEVICE(dev); - sysbus_realize_and_unref(sysbus, &error_fatal); - sysbus_mmio_map(sysbus, 0, VIRT_CTRL_MMIO_BASE); - sysbus_connect_irq(sysbus, 0, PIC_GPIO(VIRT_CTRL_IRQ_BASE)); + dev = sysbus_create_simple(TYPE_VIRT_CTRL, VIRT_CTRL_MMIO_BASE, + PIC_GPIO(VIRT_CTRL_IRQ_BASE)); /* virtio-mmio */ io_base = VIRT_VIRTIO_MMIO_BASE;