From: Gerd Hoffmann <kraxel@redhat.com>
To: qemu-devel@nongnu.org
Cc: "Thomas Huth" <thuth@redhat.com>,
"Philippe Mathieu-Daudé" <f4bug@amsat.org>,
"Gerd Hoffmann" <kraxel@redhat.com>,
"Michael S. Tsirkin" <mst@redhat.com>
Subject: [PULL 4/6] hw/display/cirrus_vga: Clean up indentation in pci_cirrus_vga_realize()
Date: Fri, 18 Mar 2022 14:56:32 +0100 [thread overview]
Message-ID: <20220318135634.2851040-5-kraxel@redhat.com> (raw)
In-Reply-To: <20220318135634.2851040-1-kraxel@redhat.com>
From: Thomas Huth <thuth@redhat.com>
Most of the code in this function had been indented with 5 spaces instead
of 4. Since 4 is our preferred style, remove one space in the bad lines here.
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Signed-off-by: Thomas Huth <thuth@redhat.com>
Message-Id: <20220317083027.16688-2-thuth@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
hw/display/cirrus_vga.c | 55 +++++++++++++++++++++--------------------
1 file changed, 28 insertions(+), 27 deletions(-)
diff --git a/hw/display/cirrus_vga.c b/hw/display/cirrus_vga.c
index fdca6ca659f9..7da1be3e122e 100644
--- a/hw/display/cirrus_vga.c
+++ b/hw/display/cirrus_vga.c
@@ -2940,27 +2940,28 @@ void cirrus_init_common(CirrusVGAState *s, Object *owner,
static void pci_cirrus_vga_realize(PCIDevice *dev, Error **errp)
{
- PCICirrusVGAState *d = PCI_CIRRUS_VGA(dev);
- CirrusVGAState *s = &d->cirrus_vga;
- PCIDeviceClass *pc = PCI_DEVICE_GET_CLASS(dev);
- int16_t device_id = pc->device_id;
+ PCICirrusVGAState *d = PCI_CIRRUS_VGA(dev);
+ CirrusVGAState *s = &d->cirrus_vga;
+ PCIDeviceClass *pc = PCI_DEVICE_GET_CLASS(dev);
+ int16_t device_id = pc->device_id;
- /* follow real hardware, cirrus card emulated has 4 MB video memory.
- Also accept 8 MB/16 MB for backward compatibility. */
- if (s->vga.vram_size_mb != 4 && s->vga.vram_size_mb != 8 &&
- s->vga.vram_size_mb != 16) {
- error_setg(errp, "Invalid cirrus_vga ram size '%u'",
- s->vga.vram_size_mb);
- return;
- }
- /* setup VGA */
- vga_common_init(&s->vga, OBJECT(dev));
- cirrus_init_common(s, OBJECT(dev), device_id, 1, pci_address_space(dev),
- pci_address_space_io(dev));
- s->vga.con = graphic_console_init(DEVICE(dev), 0, s->vga.hw_ops, &s->vga);
-
- /* setup PCI */
+ /*
+ * Follow real hardware, cirrus card emulated has 4 MB video memory.
+ * Also accept 8 MB/16 MB for backward compatibility.
+ */
+ if (s->vga.vram_size_mb != 4 && s->vga.vram_size_mb != 8 &&
+ s->vga.vram_size_mb != 16) {
+ error_setg(errp, "Invalid cirrus_vga ram size '%u'",
+ s->vga.vram_size_mb);
+ return;
+ }
+ /* setup VGA */
+ vga_common_init(&s->vga, OBJECT(dev));
+ cirrus_init_common(s, OBJECT(dev), device_id, 1, pci_address_space(dev),
+ pci_address_space_io(dev));
+ s->vga.con = graphic_console_init(DEVICE(dev), 0, s->vga.hw_ops, &s->vga);
+ /* setup PCI */
memory_region_init(&s->pci_bar, OBJECT(dev), "cirrus-pci-bar0", 0x2000000);
/* XXX: add byte swapping apertures */
@@ -2968,14 +2969,14 @@ static void pci_cirrus_vga_realize(PCIDevice *dev, Error **errp)
memory_region_add_subregion(&s->pci_bar, 0x1000000,
&s->cirrus_linear_bitblt_io);
- /* setup memory space */
- /* memory #0 LFB */
- /* memory #1 memory-mapped I/O */
- /* XXX: s->vga.vram_size must be a power of two */
- pci_register_bar(&d->dev, 0, PCI_BASE_ADDRESS_MEM_PREFETCH, &s->pci_bar);
- if (device_id == CIRRUS_ID_CLGD5446) {
- pci_register_bar(&d->dev, 1, 0, &s->cirrus_mmio_io);
- }
+ /* setup memory space */
+ /* memory #0 LFB */
+ /* memory #1 memory-mapped I/O */
+ /* XXX: s->vga.vram_size must be a power of two */
+ pci_register_bar(&d->dev, 0, PCI_BASE_ADDRESS_MEM_PREFETCH, &s->pci_bar);
+ if (device_id == CIRRUS_ID_CLGD5446) {
+ pci_register_bar(&d->dev, 1, 0, &s->cirrus_mmio_io);
+ }
}
static Property pci_vga_cirrus_properties[] = {
--
2.35.1
next prev parent reply other threads:[~2022-03-18 14:22 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-03-18 13:56 [PULL 0/6] Fixes 20220318 patches Gerd Hoffmann
2022-03-18 13:56 ` [PULL 1/6] ui/gtk: Ignore 2- and 3-button press events Gerd Hoffmann
2022-03-18 13:56 ` [PULL 2/6] ui: avoid unnecessary memory operations in vnc_refresh_server_surface() Gerd Hoffmann
2022-03-18 13:56 ` [PULL 3/6] audio/mixeng: Do not declare unused variables Gerd Hoffmann
2022-03-18 13:56 ` Gerd Hoffmann [this message]
2022-03-18 13:56 ` [PULL 5/6] hw/display: Allow vga_common_init() to return errors Gerd Hoffmann
2022-03-18 13:56 ` [PULL 6/6] hw/display/vga: Report a proper error when adding a 2nd ISA VGA Gerd Hoffmann
2022-03-19 14:16 ` [PULL 0/6] Fixes 20220318 patches Peter Maydell
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=20220318135634.2851040-5-kraxel@redhat.com \
--to=kraxel@redhat.com \
--cc=f4bug@amsat.org \
--cc=mst@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).