All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Philippe Mathieu-Daudé" <f4bug@amsat.org>
To: qemu-devel@nongnu.org
Cc: "Thomas Huth" <thuth@redhat.com>,
	"Hervé Poussineau" <hpoussin@reactos.org>,
	"Gerd Hoffmann" <kraxel@redhat.com>,
	"Philippe Mathieu-Daudé" <f4bug@amsat.org>
Subject: [PATCH-for-7.0 2/5] hw/display/vga-mmio: Inline vga_mm_init()
Date: Fri, 19 Nov 2021 18:11:59 +0100	[thread overview]
Message-ID: <20211119171202.458919-3-f4bug@amsat.org> (raw)
In-Reply-To: <20211119171202.458919-1-f4bug@amsat.org>

Inline vga_mm_init() in vga_mmio_init() to simplify the
next patch review. Kind of.

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
 hw/display/vga-mmio.c | 27 ++++++++++-----------------
 1 file changed, 10 insertions(+), 17 deletions(-)

diff --git a/hw/display/vga-mmio.c b/hw/display/vga-mmio.c
index 8aaf44e7b1d..0aefbcf53a0 100644
--- a/hw/display/vga-mmio.c
+++ b/hw/display/vga-mmio.c
@@ -65,12 +65,19 @@ static const MemoryRegionOps vga_mm_ctrl_ops = {
     .endianness = DEVICE_NATIVE_ENDIAN,
 };
 
-static void vga_mm_init(VGAMmioState *s, hwaddr vram_base,
-                        hwaddr ctrl_base, int it_shift,
-                        MemoryRegion *address_space)
+int vga_mmio_init(hwaddr vram_base,
+                    hwaddr ctrl_base, int it_shift,
+                    MemoryRegion *address_space)
 {
+    VGAMmioState *s;
     MemoryRegion *s_ioport_ctrl, *vga_io_memory;
 
+    s = g_malloc0(sizeof(*s));
+
+    s->vga.vram_size_mb = VGA_RAM_SIZE / MiB;
+    s->vga.global_vmstate = true;
+    vga_common_init(&s->vga, NULL);
+
     s->it_shift = it_shift;
     s_ioport_ctrl = g_malloc(sizeof(*s_ioport_ctrl));
     memory_region_init_io(s_ioport_ctrl, NULL, &vga_mm_ctrl_ops, s,
@@ -89,20 +96,6 @@ static void vga_mm_init(VGAMmioState *s, hwaddr vram_base,
     memory_region_add_subregion(address_space,
                                 vram_base + 0x000a0000, vga_io_memory);
     memory_region_set_coalescing(vga_io_memory);
-}
-
-int vga_mmio_init(hwaddr vram_base,
-                    hwaddr ctrl_base, int it_shift,
-                    MemoryRegion *address_space)
-{
-    VGAMmioState *s;
-
-    s = g_malloc0(sizeof(*s));
-
-    s->vga.vram_size_mb = VGA_RAM_SIZE / MiB;
-    s->vga.global_vmstate = true;
-    vga_common_init(&s->vga, NULL);
-    vga_mm_init(s, vram_base, ctrl_base, it_shift, address_space);
 
     s->vga.con = graphic_console_init(NULL, 0, s->vga.hw_ops, s);
 
-- 
2.31.1



  parent reply	other threads:[~2021-11-19 17:25 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-19 17:11 [PATCH-for-7.0 0/5] hw/display: QOM'ify vga_mmio_init() as TYPE_VGA_MMIO Philippe Mathieu-Daudé
2021-11-19 17:11 ` [PATCH-for-7.0 1/5] hw/display: Rename VGA_ISA_MM -> VGA_MMIO Philippe Mathieu-Daudé
2021-11-19 18:15   ` BALATON Zoltan
2021-11-22 15:06   ` Thomas Huth
2021-11-19 17:11 ` Philippe Mathieu-Daudé [this message]
2021-11-19 18:20   ` [PATCH-for-7.0 2/5] hw/display/vga-mmio: Inline vga_mm_init() BALATON Zoltan
2021-11-19 18:23     ` BALATON Zoltan
2021-11-19 18:28     ` Philippe Mathieu-Daudé
2021-11-22 15:08   ` Thomas Huth
2021-11-19 17:12 ` [PATCH-for-7.0 3/5] hw/display/vga-mmio: QOM'ify vga_mmio_init() as TYPE_VGA_MMIO Philippe Mathieu-Daudé
2021-11-19 18:40   ` BALATON Zoltan
2021-11-19 17:12 ` [PATCH-for-7.0 4/5] hw/mips/jazz: Inline vga_mmio_init() and remove it Philippe Mathieu-Daudé
2021-11-19 18:43   ` BALATON Zoltan
2021-11-19 17:12 ` [NOTFORMERGE PATCH 5/5] tests/avocado: Test NetBSD 9.2 on the Jazz Magnum machine Philippe Mathieu-Daudé
2021-11-22 20:05   ` Willian Rampazzo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20211119171202.458919-3-f4bug@amsat.org \
    --to=f4bug@amsat.org \
    --cc=hpoussin@reactos.org \
    --cc=kraxel@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=thuth@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.