Skip to content

Commit b037cef

Browse files
bruce-richardsontmonjalo
authored andcommitted
vhost: fix build for PowerPC
When building on Ubuntu using the packaged powerpc compiler[1], a warning is issued about the print format of the __u64 values. ../../lib/vhost/vduse.c: In function ‘vduse_vring_setup’: ../../lib/vhost/vhost.h:676:17: error: format ‘%llx’ expects argument of type ‘long long unsigned int’, but argument 5 has type ‘__u64’ {aka ‘long unsigned int’} [-Werror=format=] 676 | "VHOST_CONFIG: (%s) " fmt, prefix, ##args) | ^~~~~~~~~~~~~~~~~~~~~ Changing the format specifier to %lx, or to use PRIx64 breaks other builds, so the safest solution is to explicitly typecast the printed values to match the format string. [1] powerpc64le-linux-gnu-gcc (Ubuntu 12.3.0-1ubuntu1~23.04) 12.3.0 Fixes: a9120db ("vhost: add VDUSE device startup") Cc: [email protected] Signed-off-by: Bruce Richardson <[email protected]> Acked-by: Maxime Coquelin <[email protected]> Tested-by: David Christensen <[email protected]>
1 parent 69e1a90 commit b037cef

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

lib/vhost/vduse.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -163,9 +163,12 @@ vduse_vring_setup(struct virtio_net *dev, unsigned int index)
163163

164164
VHOST_LOG_CONFIG(dev->ifname, INFO, "VQ %u info:\n", index);
165165
VHOST_LOG_CONFIG(dev->ifname, INFO, "\tnum: %u\n", vq_info.num);
166-
VHOST_LOG_CONFIG(dev->ifname, INFO, "\tdesc_addr: %llx\n", vq_info.desc_addr);
167-
VHOST_LOG_CONFIG(dev->ifname, INFO, "\tdriver_addr: %llx\n", vq_info.driver_addr);
168-
VHOST_LOG_CONFIG(dev->ifname, INFO, "\tdevice_addr: %llx\n", vq_info.device_addr);
166+
VHOST_LOG_CONFIG(dev->ifname, INFO, "\tdesc_addr: %llx\n",
167+
(unsigned long long)vq_info.desc_addr);
168+
VHOST_LOG_CONFIG(dev->ifname, INFO, "\tdriver_addr: %llx\n",
169+
(unsigned long long)vq_info.driver_addr);
170+
VHOST_LOG_CONFIG(dev->ifname, INFO, "\tdevice_addr: %llx\n",
171+
(unsigned long long)vq_info.device_addr);
169172
VHOST_LOG_CONFIG(dev->ifname, INFO, "\tavail_idx: %u\n", vq_info.split.avail_index);
170173
VHOST_LOG_CONFIG(dev->ifname, INFO, "\tready: %u\n", vq_info.ready);
171174

0 commit comments

Comments
 (0)