Commit fbafc3e6 authored by Linus Torvalds's avatar Linus Torvalds

Merge tag 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost

Pull virtio fixes from Michael Tsirkin:
 "A couple of bugfixes: one for a regression"

* tag 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost:
  virtio_blk: fix snprintf truncation compiler warning
  virtio_ring: fix syncs DMA memory with different direction
parents 861deac3 b8e07924
...@@ -1019,12 +1019,12 @@ static void virtblk_config_changed(struct virtio_device *vdev) ...@@ -1019,12 +1019,12 @@ static void virtblk_config_changed(struct virtio_device *vdev)
static int init_vq(struct virtio_blk *vblk) static int init_vq(struct virtio_blk *vblk)
{ {
int err; int err;
int i; unsigned short i;
vq_callback_t **callbacks; vq_callback_t **callbacks;
const char **names; const char **names;
struct virtqueue **vqs; struct virtqueue **vqs;
unsigned short num_vqs; unsigned short num_vqs;
unsigned int num_poll_vqs; unsigned short num_poll_vqs;
struct virtio_device *vdev = vblk->vdev; struct virtio_device *vdev = vblk->vdev;
struct irq_affinity desc = { 0, }; struct irq_affinity desc = { 0, };
...@@ -1068,13 +1068,13 @@ static int init_vq(struct virtio_blk *vblk) ...@@ -1068,13 +1068,13 @@ static int init_vq(struct virtio_blk *vblk)
for (i = 0; i < num_vqs - num_poll_vqs; i++) { for (i = 0; i < num_vqs - num_poll_vqs; i++) {
callbacks[i] = virtblk_done; callbacks[i] = virtblk_done;
snprintf(vblk->vqs[i].name, VQ_NAME_LEN, "req.%d", i); snprintf(vblk->vqs[i].name, VQ_NAME_LEN, "req.%u", i);
names[i] = vblk->vqs[i].name; names[i] = vblk->vqs[i].name;
} }
for (; i < num_vqs; i++) { for (; i < num_vqs; i++) {
callbacks[i] = NULL; callbacks[i] = NULL;
snprintf(vblk->vqs[i].name, VQ_NAME_LEN, "req_poll.%d", i); snprintf(vblk->vqs[i].name, VQ_NAME_LEN, "req_poll.%u", i);
names[i] = vblk->vqs[i].name; names[i] = vblk->vqs[i].name;
} }
......
...@@ -3219,8 +3219,7 @@ void virtqueue_dma_sync_single_range_for_cpu(struct virtqueue *_vq, ...@@ -3219,8 +3219,7 @@ void virtqueue_dma_sync_single_range_for_cpu(struct virtqueue *_vq,
if (!vq->use_dma_api) if (!vq->use_dma_api)
return; return;
dma_sync_single_range_for_cpu(dev, addr, offset, size, dma_sync_single_range_for_cpu(dev, addr, offset, size, dir);
DMA_BIDIRECTIONAL);
} }
EXPORT_SYMBOL_GPL(virtqueue_dma_sync_single_range_for_cpu); EXPORT_SYMBOL_GPL(virtqueue_dma_sync_single_range_for_cpu);
...@@ -3246,8 +3245,7 @@ void virtqueue_dma_sync_single_range_for_device(struct virtqueue *_vq, ...@@ -3246,8 +3245,7 @@ void virtqueue_dma_sync_single_range_for_device(struct virtqueue *_vq,
if (!vq->use_dma_api) if (!vq->use_dma_api)
return; return;
dma_sync_single_range_for_device(dev, addr, offset, size, dma_sync_single_range_for_device(dev, addr, offset, size, dir);
DMA_BIDIRECTIONAL);
} }
EXPORT_SYMBOL_GPL(virtqueue_dma_sync_single_range_for_device); EXPORT_SYMBOL_GPL(virtqueue_dma_sync_single_range_for_device);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment