From e50948bf06282d6c2e3e862a8be55d5d82d405b9 Mon Sep 17 00:00:00 2001 From: Travis Geiselbrecht Date: Sun, 31 Aug 2025 12:41:30 -0700 Subject: [PATCH] [dev][virtio-block] fix a printf formatting warning on 32bit ssize_t is annoying with formatting, since %zd doesn't really know how to match it, so the usual strategy is to use %ld, since ssize_t is always defined as a signed long on LK. --- dev/virtio/block/virtio-block.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/dev/virtio/block/virtio-block.c b/dev/virtio/block/virtio-block.c index a699aa69..d5fdddb7 100644 --- a/dev/virtio/block/virtio-block.c +++ b/dev/virtio/block/virtio-block.c @@ -264,10 +264,10 @@ status_t virtio_block_init(struct virtio_device *dev, uint32_t host_features) { static enum handler_return virtio_block_irq_driver_callback(struct virtio_device *dev, uint ring, const struct vring_used_elem *e) { struct virtio_block_dev *bdev = (struct virtio_block_dev *)dev->priv; - + struct virtio_block_txn *txn = &bdev->txns[e->id]; LTRACEF("dev %p, ring %u, e %p, id %u, len %u, status %d\n", dev, ring, e, e->id, e->len, txn->status); - + /* parse our descriptor chain, add back to the free queue */ uint16_t i = e->id; for (;;) { @@ -294,7 +294,7 @@ static enum handler_return virtio_block_irq_driver_callback(struct virtio_device // async ssize_t result = (txn->status == VIRTIO_BLK_S_OK) ? (ssize_t)txn->len : ERR_IO; - LTRACEF("calling callback %p with cookie %p, len %zu\n", txn->callback, + LTRACEF("calling callback %p with cookie %p, len %ld\n", txn->callback, txn->cookie, result); txn->callback(txn->cookie, &bdev->bdev, result); } @@ -337,7 +337,7 @@ static status_t virtio_block_do_txn(struct virtio_device *dev, void *buf, // XXX not cache safe. // At the moment only tested on arm qemu, which doesn't emulate cache. - /* set up the descriptor pointing to the head */ + /* set up the descriptor pointing to the head */ #if WITH_KERNEL_VM paddr_t req_phys = vaddr_to_paddr(&txn->req); #else