]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - drivers/s390/virtio/virtio_ccw.c
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hid
[karo-tx-linux.git] / drivers / s390 / virtio / virtio_ccw.c
index bf2d1300a9578817d5b14df9cd8664838d0189e5..8688ad4c825f0e3a0bc2644ee9f5784b030ed36b 100644 (file)
@@ -342,13 +342,14 @@ static void virtio_ccw_drop_indicator(struct virtio_ccw_device *vcdev,
                ccw->count = sizeof(*thinint_area);
                ccw->cda = (__u32)(unsigned long) thinint_area;
        } else {
+               /* payload is the address of the indicators */
                indicatorp = kmalloc(sizeof(&vcdev->indicators),
                                     GFP_DMA | GFP_KERNEL);
                if (!indicatorp)
                        return;
                *indicatorp = 0;
                ccw->cmd_code = CCW_CMD_SET_IND;
-               ccw->count = sizeof(vcdev->indicators);
+               ccw->count = sizeof(&vcdev->indicators);
                ccw->cda = (__u32)(unsigned long) indicatorp;
        }
        /* Deregister indicators from host. */
@@ -656,7 +657,10 @@ static int virtio_ccw_find_vqs(struct virtio_device *vdev, unsigned nvqs,
                }
        }
        ret = -ENOMEM;
-       /* We need a data area under 2G to communicate. */
+       /*
+        * We need a data area under 2G to communicate. Our payload is
+        * the address of the indicators.
+       */
        indicatorp = kmalloc(sizeof(&vcdev->indicators), GFP_DMA | GFP_KERNEL);
        if (!indicatorp)
                goto out;
@@ -672,7 +676,7 @@ static int virtio_ccw_find_vqs(struct virtio_device *vdev, unsigned nvqs,
                vcdev->indicators = 0;
                ccw->cmd_code = CCW_CMD_SET_IND;
                ccw->flags = 0;
-               ccw->count = sizeof(vcdev->indicators);
+               ccw->count = sizeof(&vcdev->indicators);
                ccw->cda = (__u32)(unsigned long) indicatorp;
                ret = ccw_io_helper(vcdev, ccw, VIRTIO_CCW_DOING_SET_IND);
                if (ret)
@@ -683,7 +687,7 @@ static int virtio_ccw_find_vqs(struct virtio_device *vdev, unsigned nvqs,
        vcdev->indicators2 = 0;
        ccw->cmd_code = CCW_CMD_SET_CONF_IND;
        ccw->flags = 0;
-       ccw->count = sizeof(vcdev->indicators2);
+       ccw->count = sizeof(&vcdev->indicators2);
        ccw->cda = (__u32)(unsigned long) indicatorp;
        ret = ccw_io_helper(vcdev, ccw, VIRTIO_CCW_DOING_SET_CONF_IND);
        if (ret)
@@ -945,8 +949,7 @@ static struct virtio_config_ops virtio_ccw_config_ops = {
 
 static void virtio_ccw_release_dev(struct device *_d)
 {
-       struct virtio_device *dev = container_of(_d, struct virtio_device,
-                                                dev);
+       struct virtio_device *dev = dev_to_virtio(_d);
        struct virtio_ccw_device *vcdev = to_vc_device(dev);
 
        kfree(vcdev->status);