qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] virtio-mem: Work around format specifier mismatch for RISC-V


From: Bruce Rogers
Subject: [PATCH] virtio-mem: Work around format specifier mismatch for RISC-V
Date: Wed, 29 Jul 2020 18:54:38 -0600

This likely affects other, less popular host architectures as well.
Less common host architectures under linux get QEMU_VMALLOC_ALIGN (from
which VIRTIO_MEM_MIN_BLOCK_SIZE is derived) define to a variable of
type uintptr, which isn't compatible with the format specifier used to
print a user message. Since this particular usage of the underlying data
seems unique, the simple fix is to just cast it to the corresponding
format specifier.

Signed-off-by: Bruce Rogers <brogers@suse.com>
---
 hw/virtio/virtio-mem.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/hw/virtio/virtio-mem.c b/hw/virtio/virtio-mem.c
index c12e9f79b0..fd01ffd83e 100644
--- a/hw/virtio/virtio-mem.c
+++ b/hw/virtio/virtio-mem.c
@@ -754,7 +754,7 @@ static void virtio_mem_set_block_size(Object *obj, Visitor 
*v, const char *name,
 
     if (value < VIRTIO_MEM_MIN_BLOCK_SIZE) {
         error_setg(errp, "'%s' property has to be at least 0x%" PRIx32, name,
-                   VIRTIO_MEM_MIN_BLOCK_SIZE);
+                   (unsigned int)VIRTIO_MEM_MIN_BLOCK_SIZE);
         return;
     } else if (!is_power_of_2(value)) {
         error_setg(errp, "'%s' property has to be a power of two", name);
-- 
2.27.0




reply via email to

[Prev in Thread] Current Thread [Next in Thread]