From nobody Thu Nov 13 20:44:52 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1582577576; cv=none; d=zohomail.com; s=zohoarc; b=FXeOq1J5al4ZEQ05puaGhtFb0rZihHVSZ0qhF+6qoLdeXAlaLB25Vx99TcmmGS5MYGRgxJgK4RXwp5Csbf9Vj5isTNKY3yxrzmOXUih7UZcQSnTs7oMa4J3TXLkTnSTkGLA1VFxtEAPigQi3HA9VQXRrZcESAUcmJ7AyHDDY9d8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1582577576; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=DAKyL7Tqa+fBdxrFOnKvFsx39GH2EjqIV6ZKoapzE/Q=; b=WlvFu/CKhh2hNgUFpaIm+0zC1c+CbaPhsADBFL2SFWzBvQmpD9owiaqrheokqNtNLqdMGCge+WbKb3Yxni4EiCcZAI1Qxmw6chQsg3dGzqcFNKvAD1OkMg+bAFri/FlPi/sl9e91sY0BQVqOBkTkRxwskjplEAOUsqBIoJcUG5I= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1582577576067473.5699629501122; Mon, 24 Feb 2020 12:52:56 -0800 (PST) Received: from localhost ([::1]:42204 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j6Kik-0000Vp-Sl for importer@patchew.org; Mon, 24 Feb 2020 15:52:54 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:48786) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j6Ken-00018R-Vo for qemu-devel@nongnu.org; Mon, 24 Feb 2020 15:48:50 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j6Kem-00068s-Mi for qemu-devel@nongnu.org; Mon, 24 Feb 2020 15:48:49 -0500 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:31350 helo=us-smtp-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1j6Kem-00068G-IB for qemu-devel@nongnu.org; Mon, 24 Feb 2020 15:48:48 -0500 Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-164-V0SMMfEZN6-60Cyca7b3Ow-1; Mon, 24 Feb 2020 15:48:46 -0500 Received: by mail-wm1-f71.google.com with SMTP id b205so243362wmh.2 for ; Mon, 24 Feb 2020 12:48:45 -0800 (PST) Received: from x1w.redhat.com (47.red-88-21-205.staticip.rima-tde.net. [88.21.205.47]) by smtp.gmail.com with ESMTPSA id t81sm863436wmg.6.2020.02.24.12.48.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 24 Feb 2020 12:48:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1582577328; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=DAKyL7Tqa+fBdxrFOnKvFsx39GH2EjqIV6ZKoapzE/Q=; b=jCTeQGLkzw7doN3lNOZwZI7yCIPsvqNWqAMwZSCkUQfRrLIgo3r335BtrWmYW+dlBljj47 6qnCxy23y/10B84wBzLgBY8rJ4MYliGn1MwCjh5Tomz9AZt0jmjzr5EJtHzYUqeycqNMDV NgDyCp6IcLTe8+gwWoYE5qvolSoSlpk= X-MC-Unique: V0SMMfEZN6-60Cyca7b3Ow-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=kHrh7HRUxq+j6HbASfjSpjwX0NBi+3mUfkSXhbTFwJw=; b=cXDwiGPc6joylkjmj8aw/uIq9WKVAKVp+EVpm1u4EYMB97+xkBmnTQ43PP/0K4XeHg KTP7FmGxQCa2f3pcmjyWFVOcmEvsWSXsompI5NHp/ZaahihXICyUh0Jasp9bDKlvBbAE sRPSMNLCynBifrKwSz5ppdiN6Ho/F218Z+3P7b7QYP24ssHJWuVWd9d7j/E3AimvMitO pntTKyd/ZgPOmA6uskzVKdz2xXlqzj90QxIyHxoIdsIbFi9XDBElUILd/kH5Acob9UOB E35o4YL+/eTJ+Cz7EmaNPxiil2drSJQvEF/DGEY0Ce5xFQEkb33xmVPuLBTFbSmj7Ila jYlA== X-Gm-Message-State: APjAAAX5PTqR2XBNJLBTqJlgJAFHWd9FC+95wIDytTWHkYazj+YGsa+f nhhTExEdLAEuy9Y0tXKICZ5qXC7aVJo1UViV2tmhT8C/8HzosX44KE4CWvkW529V0QWFar6V24m X7CgkwC9g4IhqIOI= X-Received: by 2002:a1c:9c4c:: with SMTP id f73mr767648wme.125.1582577325010; Mon, 24 Feb 2020 12:48:45 -0800 (PST) X-Google-Smtp-Source: APXvYqxLwdvkCXa+u8AS+E6gxck9dM+a9v0Rc897RGeC0Inki2Bq/iMfAnjbkQ7ByePUpzOMLllSfA== X-Received: by 2002:a1c:9c4c:: with SMTP id f73mr767637wme.125.1582577324771; Mon, 24 Feb 2020 12:48:44 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: Peter Maydell , Paolo Bonzini , qemu-devel@nongnu.org Subject: [PATCH v2 06/32] hw/display: Use memory_region_init_rom() with read-only regions Date: Mon, 24 Feb 2020 21:48:02 +0100 Message-Id: <20200224204828.23167-7-philmd@redhat.com> X-Mailer: git-send-email 2.21.1 In-Reply-To: <20200224204828.23167-1-philmd@redhat.com> References: <20200224204828.23167-1-philmd@redhat.com> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 205.139.110.120 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Sagar Karandikar , "Michael S. Tsirkin" , Jason Wang , Mark Cave-Ayland , KONRAD Frederic , Alistair Francis , "Edgar E. Iglesias" , Max Reitz , qemu-block@nongnu.org, Magnus Damm , =?UTF-8?q?Herv=C3=A9=20Poussineau?= , Joel Stanley , Palmer Dabbelt , Aleksandar Rikalo , Richard Henderson , Artyom Tarasenko , Eduardo Habkost , Alistair Francis , Fabien Chouteau , qemu-arm@nongnu.org, Peter Chubb , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Subbaraya Sundeep , David Gibson , Kevin Wolf , qemu-riscv@nongnu.org, Igor Mitsyanko , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Laurent Vivier , Jean-Christophe Dubois , Michael Walle , qemu-ppc@nongnu.org, Aleksandar Markovic , Bastian Koppelmann , Aurelien Jarno Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8"; text/plain; charset="utf-8" This commit was produced with the Coccinelle script scripts/coccinelle/memory-region-housekeeping.cocci. Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- hw/display/cg3.c | 5 ++--- hw/display/tcx.c | 5 ++--- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/hw/display/cg3.c b/hw/display/cg3.c index 4fb67c6b1c..a1ede10394 100644 --- a/hw/display/cg3.c +++ b/hw/display/cg3.c @@ -287,9 +287,8 @@ static void cg3_initfn(Object *obj) SysBusDevice *sbd =3D SYS_BUS_DEVICE(obj); CG3State *s =3D CG3(obj); =20 - memory_region_init_ram_nomigrate(&s->rom, obj, "cg3.prom", FCODE_MAX_R= OM_SIZE, - &error_fatal); - memory_region_set_readonly(&s->rom, true); + memory_region_init_rom_nomigrate(&s->rom, obj, "cg3.prom", + FCODE_MAX_ROM_SIZE, &error_fatal); sysbus_init_mmio(sbd, &s->rom); =20 memory_region_init_io(&s->reg, obj, &cg3_reg_ops, s, "cg3.reg", diff --git a/hw/display/tcx.c b/hw/display/tcx.c index ca458f94fe..76de16e8ea 100644 --- a/hw/display/tcx.c +++ b/hw/display/tcx.c @@ -755,9 +755,8 @@ static void tcx_initfn(Object *obj) SysBusDevice *sbd =3D SYS_BUS_DEVICE(obj); TCXState *s =3D TCX(obj); =20 - memory_region_init_ram_nomigrate(&s->rom, obj, "tcx.prom", FCODE_MAX_R= OM_SIZE, - &error_fatal); - memory_region_set_readonly(&s->rom, true); + memory_region_init_rom_nomigrate(&s->rom, obj, "tcx.prom", + FCODE_MAX_ROM_SIZE, &error_fatal); sysbus_init_mmio(sbd, &s->rom); =20 /* 2/STIP : Stippler */ --=20 2.21.1