[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 5/5] hw/nvram/fw_cfg: Use the ldst API
From: |
Laurent Vivier |
Subject: |
[Qemu-devel] [PULL 5/5] hw/nvram/fw_cfg: Use the ldst API |
Date: |
Mon, 11 Mar 2019 20:11:28 +0100 |
From: Philippe Mathieu-Daudé <address@hidden>
The load/store API eases code review.
Reviewed-by: Laszlo Ersek <address@hidden>
Signed-off-by: Philippe Mathieu-Daudé <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Laurent Vivier <address@hidden>
---
hw/nvram/fw_cfg.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/hw/nvram/fw_cfg.c b/hw/nvram/fw_cfg.c
index 13aab122889d..5c3a46ce6f2a 100644
--- a/hw/nvram/fw_cfg.c
+++ b/hw/nvram/fw_cfg.c
@@ -85,7 +85,7 @@ static char *read_splashfile(char *filename, gsize
*file_sizep,
}
/* check magic ID */
- filehead = ((content[0] & 0xff) + (content[1] << 8)) & 0xffff;
+ filehead = lduw_le_p(content);
if (filehead == 0xd8ff) {
file_type = JPG_FILE;
} else if (filehead == 0x4d42) {
@@ -96,7 +96,7 @@ static char *read_splashfile(char *filename, gsize
*file_sizep,
/* check BMP bpp */
if (file_type == BMP_FILE) {
- bmp_bpp = (content[28] + (content[29] << 8)) & 0xffff;
+ bmp_bpp = lduw_le_p(&content[28]);
if (bmp_bpp != 24) {
goto error;
}
--
2.20.1
- [Qemu-devel] [PULL 0/5] Trivial branch patches, Laurent Vivier, 2019/03/11
- [Qemu-devel] [PULL 1/5] thunk: improve readability of allocation loop, Laurent Vivier, 2019/03/11
- [Qemu-devel] [PULL 3/5] hw/i386: Remove unused include, Laurent Vivier, 2019/03/11
- [Qemu-devel] [PULL 4/5] hw/arm/virt: Remove null-check in virt_build_smbios(), Laurent Vivier, 2019/03/11
- [Qemu-devel] [PULL 2/5] hw/nvram/fw_cfg: Remove the unnecessary boot_splash_filedata_size, Laurent Vivier, 2019/03/11
- [Qemu-devel] [PULL 5/5] hw/nvram/fw_cfg: Use the ldst API,
Laurent Vivier <=
- Re: [Qemu-devel] [PULL 0/5] Trivial branch patches, Peter Maydell, 2019/03/12