virtio_blk: fix snprintf truncation compiler warning
[linux-2.6-microblaze.git] / drivers / block / virtio_blk.c
index d53d6aa..47556d8 100644 (file)
@@ -1019,12 +1019,12 @@ static void virtblk_config_changed(struct virtio_device *vdev)
 static int init_vq(struct virtio_blk *vblk)
 {
        int err;
-       int i;
+       unsigned short i;
        vq_callback_t **callbacks;
        const char **names;
        struct virtqueue **vqs;
        unsigned short num_vqs;
-       unsigned int num_poll_vqs;
+       unsigned short num_poll_vqs;
        struct virtio_device *vdev = vblk->vdev;
        struct irq_affinity desc = { 0, };
 
@@ -1068,13 +1068,13 @@ static int init_vq(struct virtio_blk *vblk)
 
        for (i = 0; i < num_vqs - num_poll_vqs; i++) {
                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;
        }
 
        for (; i < num_vqs; i++) {
                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;
        }