aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/s390/kvm/virtio_ccw.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/s390/kvm/virtio_ccw.c')
-rw-r--r--drivers/s390/kvm/virtio_ccw.c23
1 files changed, 9 insertions, 14 deletions
diff --git a/drivers/s390/kvm/virtio_ccw.c b/drivers/s390/kvm/virtio_ccw.c
index bda52f18e967..1dbee95838fe 100644
--- a/drivers/s390/kvm/virtio_ccw.c
+++ b/drivers/s390/kvm/virtio_ccw.c
@@ -701,7 +701,6 @@ static void virtio_ccw_finalize_features(struct virtio_device *vdev)
701{ 701{
702 struct virtio_ccw_device *vcdev = to_vc_device(vdev); 702 struct virtio_ccw_device *vcdev = to_vc_device(vdev);
703 struct virtio_feature_desc *features; 703 struct virtio_feature_desc *features;
704 int i;
705 struct ccw1 *ccw; 704 struct ccw1 *ccw;
706 705
707 ccw = kzalloc(sizeof(*ccw), GFP_DMA | GFP_KERNEL); 706 ccw = kzalloc(sizeof(*ccw), GFP_DMA | GFP_KERNEL);
@@ -715,19 +714,15 @@ static void virtio_ccw_finalize_features(struct virtio_device *vdev)
715 /* Give virtio_ring a chance to accept features. */ 714 /* Give virtio_ring a chance to accept features. */
716 vring_transport_features(vdev); 715 vring_transport_features(vdev);
717 716
718 for (i = 0; i < sizeof(*vdev->features) / sizeof(features->features); 717 features->index = 0;
719 i++) { 718 features->features = cpu_to_le32(vdev->features);
720 int highbits = i % 2 ? 32 : 0; 719 /* Write the feature bits to the host. */
721 features->index = i; 720 ccw->cmd_code = CCW_CMD_WRITE_FEAT;
722 features->features = cpu_to_le32(vdev->features[i / 2] 721 ccw->flags = 0;
723 >> highbits); 722 ccw->count = sizeof(*features);
724 /* Write the feature bits to the host. */ 723 ccw->cda = (__u32)(unsigned long)features;
725 ccw->cmd_code = CCW_CMD_WRITE_FEAT; 724 ccw_io_helper(vcdev, ccw, VIRTIO_CCW_DOING_WRITE_FEAT);
726 ccw->flags = 0; 725
727 ccw->count = sizeof(*features);
728 ccw->cda = (__u32)(unsigned long)features;
729 ccw_io_helper(vcdev, ccw, VIRTIO_CCW_DOING_WRITE_FEAT);
730 }
731out_free: 726out_free:
732 kfree(features); 727 kfree(features);
733 kfree(ccw); 728 kfree(ccw);