[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-block] [PATCH 03/13] tests/pflash-cfi02: Use IEC binary prefixes f
From: |
Philippe Mathieu-Daudé |
Subject: |
[Qemu-block] [PATCH 03/13] tests/pflash-cfi02: Use IEC binary prefixes for size constants |
Date: |
Mon, 6 May 2019 00:15:34 +0200 |
Using IEC binary prefixes in order to make the code more readable.
Signed-off-by: Philippe Mathieu-Daudé <address@hidden>
---
tests/pflash-cfi02-test.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/tests/pflash-cfi02-test.c b/tests/pflash-cfi02-test.c
index ff775618c02..3c37465499a 100644
--- a/tests/pflash-cfi02-test.c
+++ b/tests/pflash-cfi02-test.c
@@ -8,6 +8,7 @@
*/
#include "qemu/osdep.h"
+#include "qemu/units.h"
#include "libqtest.h"
/*
@@ -16,7 +17,7 @@
* all. In particular, we're limited to a 16-bit wide flash device.
*/
-#define MP_FLASH_SIZE_MAX (32 * 1024 * 1024)
+#define MP_FLASH_SIZE_MAX (32 * MiB)
#define BASE_ADDR (0x100000000ULL - MP_FLASH_SIZE_MAX)
#define FLASH_WIDTH 2
@@ -205,7 +206,7 @@ int main(int argc, char **argv)
char *image_path;
int fd = g_file_open_tmp("pflash-cfi02-XXXXXX.raw", &image_path, &error);
g_assert_no_error(error);
- if (ftruncate(fd, 8 * 1024 * 1024) < 0) {
+ if (ftruncate(fd, 8 * MiB) < 0) {
g_printerr("Failed to truncate file %s to 8 MB: %s\n", image_path,
strerror(errno));
close(fd);
--
2.20.1
- [Qemu-block] [PATCH 09/13] hw/block/pflash_cfi02: Use the ldst API in pflash_read(), (continued)
- [Qemu-block] [PATCH 09/13] hw/block/pflash_cfi02: Use the ldst API in pflash_read(), Philippe Mathieu-Daudé, 2019/05/05
- [Qemu-block] [PATCH 10/13] hw/block/pflash_cfi02: Extract the pflash_data_read() function, Philippe Mathieu-Daudé, 2019/05/05
- [Qemu-block] [PATCH 01/13] tests/pflash-cfi02: Add test for supported CFI commands, Philippe Mathieu-Daudé, 2019/05/05
- [Qemu-block] [PATCH 08/13] hw/block/pflash_cfi02: Use the ldst API in pflash_write(), Philippe Mathieu-Daudé, 2019/05/05
- [Qemu-block] [PATCH 07/13] hw/block/pflash_cfi02: Simplify a statement using fall through, Philippe Mathieu-Daudé, 2019/05/05
- [Qemu-block] [PATCH 11/13] hw/block/pflash_cfi02: Unify the MemoryRegionOps, Philippe Mathieu-Daudé, 2019/05/05
- [Qemu-block] [PATCH 04/13] hw/block/pflash_cfi02: Fix debug format string, Philippe Mathieu-Daudé, 2019/05/05
- [Qemu-block] [PATCH 05/13] hw/block/pflash_cfi02: Add an enum to define the write cycles, Philippe Mathieu-Daudé, 2019/05/05
- [Qemu-block] [PATCH 13/13] hw/block/pflash_cfi02: Use the chip erase time specified in the CFI table, Philippe Mathieu-Daudé, 2019/05/05
- [Qemu-block] [PATCH 12/13] hw/block/pflash_cfi02: Fix command address comparison, Philippe Mathieu-Daudé, 2019/05/05
- [Qemu-block] [PATCH 03/13] tests/pflash-cfi02: Use IEC binary prefixes for size constants,
Philippe Mathieu-Daudé <=
- [Qemu-block] [PATCH 06/13] hw/block/pflash_cfi02: Add helpers to manipulate the status bits, Philippe Mathieu-Daudé, 2019/05/05