@@ -23,6 +23,7 @@
#ifndef QEMU_NVDIMM_H
#define QEMU_NVDIMM_H
+#include "qemu/units.h"
#include "hw/mem/pc-dimm.h"
#include "hw/acpi/bios-linker-loader.h"
@@ -40,7 +41,7 @@
* "NVDIMMs following the NVDIMM Block Mode Specification use an area
* at least 128KB in size, which holds around 1000 labels."
*/
-#define MIN_NAMESPACE_LABEL_SIZE (128UL << 10)
+#define MIN_NAMESPACE_LABEL_SIZE (128 * K_BYTE)
#define TYPE_NVDIMM "nvdimm"
#define NVDIMM(obj) OBJECT_CHECK(NVDIMMDevice, (obj), TYPE_NVDIMM)
@@ -54,7 +54,7 @@ static void nvdimm_set_label_size(Object *obj, Visitor *v, const char *name,
}
if (value < MIN_NAMESPACE_LABEL_SIZE) {
error_setg(&local_err, "Property '%s.%s' (0x%" PRIx64 ") is required"
- " at least 0x%lx", object_get_typename(obj),
+ " at least 0x%llx", object_get_typename(obj),
name, value, MIN_NAMESPACE_LABEL_SIZE);
goto out;
}
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é <f4bug@amsat.org> --- include/hw/mem/nvdimm.h | 3 ++- hw/mem/nvdimm.c | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-)