[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v4 15/40] hw/misc: Use the IEC binary prefix definit
From: |
Philippe Mathieu-Daudé |
Subject: |
[Qemu-devel] [PATCH v4 15/40] hw/misc: Use the IEC binary prefix definitions |
Date: |
Sun, 10 Jun 2018 22:14:36 -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>
---
hw/misc/auxbus.c | 3 ++-
hw/misc/edu.c | 3 ++-
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/hw/misc/auxbus.c b/hw/misc/auxbus.c
index b4cacd664b..b8a8721201 100644
--- a/hw/misc/auxbus.c
+++ b/hw/misc/auxbus.c
@@ -27,6 +27,7 @@
*/
#include "qemu/osdep.h"
+#include "qemu/units.h"
#include "qemu/log.h"
#include "hw/misc/auxbus.h"
#include "hw/i2c/i2c.h"
@@ -68,7 +69,7 @@ AUXBus *aux_init_bus(DeviceState *parent, const char *name)
/* Memory related. */
bus->aux_io = g_malloc(sizeof(*bus->aux_io));
- memory_region_init(bus->aux_io, OBJECT(bus), "aux-io", (1 << 20));
+ memory_region_init(bus->aux_io, OBJECT(bus), "aux-io", 1 * MiB);
address_space_init(&bus->aux_addr_space, bus->aux_io, "aux-io");
return bus;
}
diff --git a/hw/misc/edu.c b/hw/misc/edu.c
index 34eb05d213..df26a4d046 100644
--- a/hw/misc/edu.c
+++ b/hw/misc/edu.c
@@ -23,6 +23,7 @@
*/
#include "qemu/osdep.h"
+#include "qemu/units.h"
#include "hw/pci/pci.h"
#include "hw/pci/msi.h"
#include "qemu/timer.h"
@@ -357,7 +358,7 @@ static void pci_edu_realize(PCIDevice *pdev, Error **errp)
edu, QEMU_THREAD_JOINABLE);
memory_region_init_io(&edu->mmio, OBJECT(edu), &edu_mmio_ops, edu,
- "edu-mmio", 1 << 20);
+ "edu-mmio", 1 * MiB);
pci_register_bar(pdev, 0, PCI_BASE_ADDRESS_SPACE_MEMORY, &edu->mmio);
}
--
2.17.1
- [Qemu-devel] [PATCH v4 04/40] checkpatch: Recognize IEC binary prefix definitions, (continued)
- [Qemu-devel] [PATCH v4 04/40] checkpatch: Recognize IEC binary prefix definitions, Philippe Mathieu-Daudé, 2018/06/10
- [Qemu-devel] [PATCH v4 05/40] hw: Use IEC binary prefix definitions from "qemu/units.h", Philippe Mathieu-Daudé, 2018/06/10
- [Qemu-devel] [PATCH v4 06/40] hw: Directly use "qemu/units.h" instead of "qemu/cutils.h", Philippe Mathieu-Daudé, 2018/06/10
- [Qemu-devel] [PATCH v4 07/40] hw/ivshmem: Use the IEC binary prefix definitions, Philippe Mathieu-Daudé, 2018/06/10
- [Qemu-devel] [PATCH v4 08/40] hw/ipack: Use the IEC binary prefix definitions, Philippe Mathieu-Daudé, 2018/06/10
- [Qemu-devel] [PATCH v4 09/40] hw/scsi: Use the IEC binary prefix definitions, Philippe Mathieu-Daudé, 2018/06/10
- [Qemu-devel] [PATCH v4 10/40] hw/smbios: Use the IEC binary prefix definitions, Philippe Mathieu-Daudé, 2018/06/10
- [Qemu-devel] [PATCH v4 11/40] hw/xen: Use the IEC binary prefix definitions, Philippe Mathieu-Daudé, 2018/06/10
- [Qemu-devel] [PATCH v4 12/40] hw/tpm: Use the IEC binary prefix definitions, Philippe Mathieu-Daudé, 2018/06/10
- [Qemu-devel] [PATCH v4 13/40] hw/block: Use the IEC binary prefix definitions, Philippe Mathieu-Daudé, 2018/06/10
- [Qemu-devel] [PATCH v4 15/40] hw/misc: Use the IEC binary prefix definitions,
Philippe Mathieu-Daudé <=
- [Qemu-devel] [PATCH v4 14/40] hw/display: Use the IEC binary prefix definitions, Philippe Mathieu-Daudé, 2018/06/10
- [Qemu-devel] [PATCH v4 16/40] hw/riscv: Use the IEC binary prefix definitions, Philippe Mathieu-Daudé, 2018/06/10
- [Qemu-devel] [PATCH v4 17/40] hw/m68k: Use the IEC binary prefix definitions, Philippe Mathieu-Daudé, 2018/06/10
- [Qemu-devel] [PATCH v4 18/40] hw/sparc: Use the IEC binary prefix definitions, Philippe Mathieu-Daudé, 2018/06/10
- [Qemu-devel] [PATCH v4 20/40] hw/hppa: Use the IEC binary prefix definitions, Philippe Mathieu-Daudé, 2018/06/10
- [Qemu-devel] [PATCH v4 19/40] hw/s390x: Use the IEC binary prefix definitions, Philippe Mathieu-Daudé, 2018/06/10
- [Qemu-devel] [PATCH v4 21/40] hw/xtensa: Use the IEC binary prefix definitions, Philippe Mathieu-Daudé, 2018/06/10
- [Qemu-devel] [PATCH v4 22/40] hw/alpha: Use the IEC binary prefix definitions, Philippe Mathieu-Daudé, 2018/06/10
- [Qemu-devel] [PATCH v4 23/40] hw/tricore: Use the IEC binary prefix definitions, Philippe Mathieu-Daudé, 2018/06/10