From: Gerd Hoffmann <kraxel@redhat.com>
To: qemu-devel@nongnu.org
Cc: Marcel Apfelbaum <marcel.apfelbaum@gmail.com>,
Gerd Hoffmann <kraxel@redhat.com>,
"Michael S. Tsirkin" <mst@redhat.com>
Subject: [Qemu-devel] [PULL 1/7] edid: fix alignment issues
Date: Mon, 15 Oct 2018 11:05:11 +0200 [thread overview]
Message-ID: <20181015090517.26884-2-kraxel@redhat.com> (raw)
In-Reply-To: <20181015090517.26884-1-kraxel@redhat.com>
Use stl_le_p() & friends instead of casts.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Message-id: 20181015055333.32030-1-kraxel@redhat.com
---
hw/display/edid-generate.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/hw/display/edid-generate.c b/hw/display/edid-generate.c
index 37e60fe42a..bdf5e1d4d4 100644
--- a/hw/display/edid-generate.c
+++ b/hw/display/edid-generate.c
@@ -223,7 +223,7 @@ static void edid_desc_timing(uint8_t *desc,
uint32_t clock = 75 * (xres + xblank) * (yres + yblank);
- *(uint32_t *)(desc) = cpu_to_le32(clock / 10000);
+ stl_le_p(desc, clock / 10000);
desc[2] = xres & 0xff;
desc[3] = xblank & 0xff;
@@ -342,9 +342,9 @@ void qemu_edid_generate(uint8_t *edid, size_t size,
(((info->vendor[2] - '@') & 0x1f) << 0));
uint16_t model_nr = 0x1234;
uint32_t serial_nr = info->serial ? atoi(info->serial) : 0;
- *(uint16_t *)(edid + 8) = cpu_to_be16(vendor_id);
- *(uint16_t *)(edid + 10) = cpu_to_le16(model_nr);
- *(uint32_t *)(edid + 12) = cpu_to_le32(serial_nr);
+ stw_be_p(edid + 8, vendor_id);
+ stw_le_p(edid + 10, model_nr);
+ stl_le_p(edid + 12, serial_nr);
/* manufacture week and year */
edid[16] = 42;
--
2.9.3
next prev parent reply other threads:[~2018-10-15 9:05 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-10-15 9:05 [Qemu-devel] [PULL 0/7] Vga 20181015 patches Gerd Hoffmann
2018-10-15 9:05 ` Gerd Hoffmann [this message]
2018-10-15 9:05 ` [Qemu-devel] [PULL 2/7] display: add separate config option for bochs-display Gerd Hoffmann
2018-10-15 9:05 ` [Qemu-devel] [PULL 3/7] bochs-display: wire up edid support Gerd Hoffmann
2018-10-15 9:05 ` [Qemu-devel] [PULL 4/7] qxl: check qxl_phys2virt return value Gerd Hoffmann
2018-10-15 9:05 ` [Qemu-devel] [PULL 5/7] i2c: switch ddc to use the new edid generator Gerd Hoffmann
2018-10-15 9:05 ` [Qemu-devel] [PULL 6/7] hw/display/cirrus_vga: Move "isa-cirrus-vga" device into a separate file Gerd Hoffmann
2018-10-15 9:05 ` [Qemu-devel] [PULL 7/7] Makefile: Install new vgabios binaries Gerd Hoffmann
2018-10-15 16:01 ` [Qemu-devel] [PULL 0/7] Vga 20181015 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=20181015090517.26884-2-kraxel@redhat.com \
--to=kraxel@redhat.com \
--cc=marcel.apfelbaum@gmail.com \
--cc=mst@redhat.com \
--cc=qemu-devel@nongnu.org \
/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).