]> Git Repo - qemu.git/commitdiff
hw/nvram/fw_cfg: Use the ldst API
authorPhilippe Mathieu-Daudé <[email protected]>
Sat, 9 Mar 2019 18:19:20 +0000 (19:19 +0100)
committerLaurent Vivier <[email protected]>
Mon, 11 Mar 2019 17:48:20 +0000 (18:48 +0100)
The load/store API eases code review.

Reviewed-by: Laszlo Ersek <[email protected]>
Signed-off-by: Philippe Mathieu-Daudé <[email protected]>
Message-Id: <20190309181920[email protected]>
Signed-off-by: Laurent Vivier <[email protected]>
hw/nvram/fw_cfg.c

index 13aab122889da62a0173241bc2792d30ec719f9d..5c3a46ce6f2ac418f5fc1dbd4bea88b5a74d94ea 100644 (file)
@@ -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;
         }
This page took 0.031164 seconds and 4 git commands to generate.