[v3,39/41] hw/nvdimm: Use the BYTE-based definitions

Message ID 20180415234307.28132-40-f4bug@amsat.org
State New
Headers show
Series
  • hw: Use the BYTE-based definitions when useful
Related show

Commit Message

Philippe Mathieu-Daudé April 15, 2018, 11:43 p.m.
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(-)

Patch

diff --git a/include/hw/mem/nvdimm.h b/include/hw/mem/nvdimm.h
index 7fd87c4e1c..fda855ad1a 100644
--- a/include/hw/mem/nvdimm.h
+++ b/include/hw/mem/nvdimm.h
@@ -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)
diff --git a/hw/mem/nvdimm.c b/hw/mem/nvdimm.c
index acb656b672..0f83e9fb4c 100644
--- a/hw/mem/nvdimm.c
+++ b/hw/mem/nvdimm.c
@@ -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;
     }