Skip to content

Commit

Permalink
[virtio] Fix virtio-pci logging
Browse files Browse the repository at this point in the history
iPXE debug logging doesn't support %u.  This commit replaces it with
%d in virtio-pci debug format strings.

Signed-off-by: Ladi Prosek <lprosek@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
  • Loading branch information
ladipro authored and mcb30 committed Jun 20, 2016
1 parent fbbc895 commit 040aa98
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/drivers/bus/virtio-pci.c
Expand Up @@ -253,21 +253,21 @@ int virtio_pci_map_capability(struct pci_device *pci, int cap, size_t minlen,
&length);

if (length <= start) {
DBG("VIRTIO-PCI bad capability len %u (>%u expected)\n", length, start);
DBG("VIRTIO-PCI bad capability len %d (>%d expected)\n", length, start);
return -EINVAL;
}
if (length - start < minlen) {
DBG("VIRTIO-PCI bad capability len %u (>=%zu expected)\n", length, minlen);
DBG("VIRTIO-PCI bad capability len %d (>=%zd expected)\n", length, minlen);
return -EINVAL;
}
length -= start;
if (start + offset < offset) {
DBG("VIRTIO-PCI map wrap-around %u+%u\n", start, offset);
DBG("VIRTIO-PCI map wrap-around %d+%d\n", start, offset);
return -EINVAL;
}
offset += start;
if (offset & (align - 1)) {
DBG("VIRTIO-PCI offset %u not aligned to %u\n", offset, align);
DBG("VIRTIO-PCI offset %d not aligned to %d\n", offset, align);
return -EINVAL;
}
if (length > size) {
Expand All @@ -276,9 +276,9 @@ int virtio_pci_map_capability(struct pci_device *pci, int cap, size_t minlen,

if (minlen + offset < minlen ||
minlen + offset > pci_bar_size(pci, PCI_BASE_ADDRESS(bar))) {
DBG("VIRTIO-PCI map virtio %zu@%u out of range on bar %i length %lu\n",
DBG("VIRTIO-PCI map virtio %zd@%d out of range on bar %i length %ld\n",
minlen, offset,
bar, (unsigned long)pci_bar_size(pci, PCI_BASE_ADDRESS(bar)));
bar, pci_bar_size(pci, PCI_BASE_ADDRESS(bar)));
return -EINVAL;
}

Expand Down Expand Up @@ -354,7 +354,7 @@ int vpm_find_vqs(struct virtio_pci_modern_device *vdev,
return -ENOENT;

if (size & (size - 1)) {
DBG("VIRTIO-PCI %p: bad queue size %u", vdev, size);
DBG("VIRTIO-PCI %p: bad queue size %d", vdev, size);
return -EINVAL;
}

Expand Down

0 comments on commit 040aa98

Please sign in to comment.