[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-trivial] [PATCH v3 40/41] hw/loader: Use the BYTE-based definition
From: |
Philippe Mathieu-Daudé |
Subject: |
[Qemu-trivial] [PATCH v3 40/41] hw/loader: Use the BYTE-based definitions |
Date: |
Sun, 15 Apr 2018 20:43:06 -0300 |
It eases code review, unit is explicit.
Patch generated using:
$ git grep -E '(1024|2048|4096|8192|(<<|>>).?(10|20|30))' hw/ include/hw/
and modified manually.
Signed-off-by: Philippe Mathieu-Daudé <address@hidden>
---
include/hw/loader.h | 5 +++--
hw/core/loader-fit.c | 2 +-
2 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/include/hw/loader.h b/include/hw/loader.h
index 5ed3fd8ae6..2222ca4184 100644
--- a/include/hw/loader.h
+++ b/include/hw/loader.h
@@ -1,5 +1,6 @@
#ifndef LOADER_H
#define LOADER_H
+#include "qemu/units.h"
#include "hw/nvram/fw_cfg.h"
/* loader.c */
@@ -52,7 +53,7 @@ int load_image_mr(const char *filename, MemoryRegion *mr);
* load_image_gzipped_buffer() and load_image_gzipped() will read. It prevents
* g_malloc() in those functions from allocating a huge amount of memory.
*/
-#define LOAD_IMAGE_MAX_GUNZIP_BYTES (256 << 20)
+#define LOAD_IMAGE_MAX_GUNZIP_BYTES (256 * M_BYTE)
int load_image_gzipped_buffer(const char *filename, uint64_t max_sz,
uint8_t **buffer);
@@ -253,6 +254,6 @@ int rom_add_option(const char *file, int32_t bootindex);
/* This is the usual maximum in uboot, so if a uImage overflows this, it would
* overflow on real hardware too. */
-#define UBOOT_MAX_GUNZIP_BYTES (64 << 20)
+#define UBOOT_MAX_GUNZIP_BYTES (64 * M_BYTE)
#endif
diff --git a/hw/core/loader-fit.c b/hw/core/loader-fit.c
index 0c4a7207f4..0117104d69 100644
--- a/hw/core/loader-fit.c
+++ b/hw/core/loader-fit.c
@@ -22,7 +22,7 @@
#include "exec/memory.h"
#include "hw/loader.h"
#include "hw/loader-fit.h"
-#include "qemu/cutils.h"
+#include "qemu/units.h"
#include "qemu/error-report.h"
#include "sysemu/device_tree.h"
#include "sysemu/sysemu.h"
--
2.17.0
- Re: [Qemu-trivial] [Qemu-devel] [PATCH v3 33/41] hw/net: Use the BYTE-based definitions, (continued)
- [Qemu-trivial] [PATCH v3 34/41] hw/usb: Use the BYTE-based definitions, Philippe Mathieu-Daudé, 2018/04/15
- [Qemu-trivial] [PATCH v3 35/41] hw/sd: Use the BYTE-based definitions, Philippe Mathieu-Daudé, 2018/04/15
- [Qemu-trivial] [PATCH v3 36/41] hw/vfio: Use the BYTE-based definitions, Philippe Mathieu-Daudé, 2018/04/15
- [Qemu-trivial] [PATCH v3 37/41] hw/virtio: Use the BYTE-based definitions, Philippe Mathieu-Daudé, 2018/04/15
- [Qemu-trivial] [PATCH v3 38/41] hw/rdma: Use the BYTE-based definitions, Philippe Mathieu-Daudé, 2018/04/15
- [Qemu-trivial] [PATCH v3 39/41] hw/nvdimm: Use the BYTE-based definitions, Philippe Mathieu-Daudé, 2018/04/15
- [Qemu-trivial] [PATCH v3 40/41] hw/loader: Use the BYTE-based definitions,
Philippe Mathieu-Daudé <=
- [Qemu-trivial] [PATCH v3 41/41] cutils: Do not include "qemu/units.h" directly, Philippe Mathieu-Daudé, 2018/04/15
- Message not available
- Message not available