search for: virtio32_to_cpu

Displaying 20 results from an estimated 320 matches for "virtio32_to_cpu".

2014 Nov 30
2
[PATCH v7 42/46] virtio_scsi: v1.0 support
...++ b/drivers/scsi/virtio_scsi.c @@ -158,7 +158,7 @@ static void virtscsi_complete_cmd(struct virtio_scsi *vscsi, void *buf) sc, resp->response, resp->status, resp->sense_len); sc->result = resp->status; - virtscsi_compute_resid(sc, resp->resid); + virtscsi_compute_resid(sc, virtio32_to_cpu(vscsi->vdev, resp->resid)); switch (resp->response) { case VIRTIO_SCSI_S_OK: set_host_byte(sc, DID_OK); @@ -196,10 +196,13 @@ static void virtscsi_complete_cmd(struct virtio_scsi *vscsi, void *buf) break; } - WARN_ON(resp->sense_len > VIRTIO_SCSI_SENSE_SIZE); + WARN_ON(...
2014 Nov 30
2
[PATCH v7 42/46] virtio_scsi: v1.0 support
...++ b/drivers/scsi/virtio_scsi.c @@ -158,7 +158,7 @@ static void virtscsi_complete_cmd(struct virtio_scsi *vscsi, void *buf) sc, resp->response, resp->status, resp->sense_len); sc->result = resp->status; - virtscsi_compute_resid(sc, resp->resid); + virtscsi_compute_resid(sc, virtio32_to_cpu(vscsi->vdev, resp->resid)); switch (resp->response) { case VIRTIO_SCSI_S_OK: set_host_byte(sc, DID_OK); @@ -196,10 +196,13 @@ static void virtscsi_complete_cmd(struct virtio_scsi *vscsi, void *buf) break; } - WARN_ON(resp->sense_len > VIRTIO_SCSI_SENSE_SIZE); + WARN_ON(...
2020 Jul 10
2
[PATCH] virtio_balloon: fix sparse warning
balloon uses virtio32_to_cpu instead of cpu_to_virtio32 to convert a native endian number to virtio. No practical difference but makes sparse warn. Fix it up. Signed-off-by: Michael S. Tsirkin <mst at redhat.com> --- drivers/virtio/virtio_balloon.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dri...
2014 Nov 27
0
[PATCH v5 41/45] virtio_scsi: v1.0 support
...++ b/drivers/scsi/virtio_scsi.c @@ -158,7 +158,7 @@ static void virtscsi_complete_cmd(struct virtio_scsi *vscsi, void *buf) sc, resp->response, resp->status, resp->sense_len); sc->result = resp->status; - virtscsi_compute_resid(sc, resp->resid); + virtscsi_compute_resid(sc, virtio32_to_cpu(vscsi->vdev, resp->resid)); switch (resp->response) { case VIRTIO_SCSI_S_OK: set_host_byte(sc, DID_OK); @@ -196,10 +196,13 @@ static void virtscsi_complete_cmd(struct virtio_scsi *vscsi, void *buf) break; } - WARN_ON(resp->sense_len > VIRTIO_SCSI_SENSE_SIZE); + WARN_ON(...
2014 Nov 27
0
[PATCH v6 42/46] virtio_scsi: v1.0 support
...++ b/drivers/scsi/virtio_scsi.c @@ -158,7 +158,7 @@ static void virtscsi_complete_cmd(struct virtio_scsi *vscsi, void *buf) sc, resp->response, resp->status, resp->sense_len); sc->result = resp->status; - virtscsi_compute_resid(sc, resp->resid); + virtscsi_compute_resid(sc, virtio32_to_cpu(vscsi->vdev, resp->resid)); switch (resp->response) { case VIRTIO_SCSI_S_OK: set_host_byte(sc, DID_OK); @@ -196,10 +196,13 @@ static void virtscsi_complete_cmd(struct virtio_scsi *vscsi, void *buf) break; } - WARN_ON(resp->sense_len > VIRTIO_SCSI_SENSE_SIZE); + WARN_ON(...
2014 Dec 01
0
[PATCH v8 42/50] virtio_scsi: v1.0 support
...++ b/drivers/scsi/virtio_scsi.c @@ -158,7 +158,7 @@ static void virtscsi_complete_cmd(struct virtio_scsi *vscsi, void *buf) sc, resp->response, resp->status, resp->sense_len); sc->result = resp->status; - virtscsi_compute_resid(sc, resp->resid); + virtscsi_compute_resid(sc, virtio32_to_cpu(vscsi->vdev, resp->resid)); switch (resp->response) { case VIRTIO_SCSI_S_OK: set_host_byte(sc, DID_OK); @@ -196,10 +196,13 @@ static void virtscsi_complete_cmd(struct virtio_scsi *vscsi, void *buf) break; } - WARN_ON(resp->sense_len > VIRTIO_SCSI_SENSE_SIZE); + WARN_ON(...
2014 Nov 27
0
[PATCH v5 41/45] virtio_scsi: v1.0 support
...++ b/drivers/scsi/virtio_scsi.c @@ -158,7 +158,7 @@ static void virtscsi_complete_cmd(struct virtio_scsi *vscsi, void *buf) sc, resp->response, resp->status, resp->sense_len); sc->result = resp->status; - virtscsi_compute_resid(sc, resp->resid); + virtscsi_compute_resid(sc, virtio32_to_cpu(vscsi->vdev, resp->resid)); switch (resp->response) { case VIRTIO_SCSI_S_OK: set_host_byte(sc, DID_OK); @@ -196,10 +196,13 @@ static void virtscsi_complete_cmd(struct virtio_scsi *vscsi, void *buf) break; } - WARN_ON(resp->sense_len > VIRTIO_SCSI_SENSE_SIZE); + WARN_ON(...
2014 Nov 27
0
[PATCH v6 42/46] virtio_scsi: v1.0 support
...++ b/drivers/scsi/virtio_scsi.c @@ -158,7 +158,7 @@ static void virtscsi_complete_cmd(struct virtio_scsi *vscsi, void *buf) sc, resp->response, resp->status, resp->sense_len); sc->result = resp->status; - virtscsi_compute_resid(sc, resp->resid); + virtscsi_compute_resid(sc, virtio32_to_cpu(vscsi->vdev, resp->resid)); switch (resp->response) { case VIRTIO_SCSI_S_OK: set_host_byte(sc, DID_OK); @@ -196,10 +196,13 @@ static void virtscsi_complete_cmd(struct virtio_scsi *vscsi, void *buf) break; } - WARN_ON(resp->sense_len > VIRTIO_SCSI_SENSE_SIZE); + WARN_ON(...
2014 Dec 01
0
[PATCH v8 42/50] virtio_scsi: v1.0 support
...++ b/drivers/scsi/virtio_scsi.c @@ -158,7 +158,7 @@ static void virtscsi_complete_cmd(struct virtio_scsi *vscsi, void *buf) sc, resp->response, resp->status, resp->sense_len); sc->result = resp->status; - virtscsi_compute_resid(sc, resp->resid); + virtscsi_compute_resid(sc, virtio32_to_cpu(vscsi->vdev, resp->resid)); switch (resp->response) { case VIRTIO_SCSI_S_OK: set_host_byte(sc, DID_OK); @@ -196,10 +196,13 @@ static void virtscsi_complete_cmd(struct virtio_scsi *vscsi, void *buf) break; } - WARN_ON(resp->sense_len > VIRTIO_SCSI_SENSE_SIZE); + WARN_ON(...
2014 Dec 01
2
[PATCH v7 42/46] virtio_scsi: v1.0 support
...s changed, 49 insertions(+), 34 deletions(-) > > > > > @@ -196,10 +196,13 @@ static void virtscsi_complete_cmd(struct virtio_scsi *vscsi, void *buf) > > break; > > } > > > > - WARN_ON(resp->sense_len > VIRTIO_SCSI_SENSE_SIZE); > > + WARN_ON(virtio32_to_cpu(vscsi->vdev, resp->sense_len) > > > + VIRTIO_SCSI_SENSE_SIZE); > > Introduce a local variable for this? Might make this statement and the > min_t statement below easier to read. I prefer 1:1 code conversions. We can do refactorings on top. Since you mention this line as h...
2014 Dec 01
2
[PATCH v7 42/46] virtio_scsi: v1.0 support
...s changed, 49 insertions(+), 34 deletions(-) > > > > > @@ -196,10 +196,13 @@ static void virtscsi_complete_cmd(struct virtio_scsi *vscsi, void *buf) > > break; > > } > > > > - WARN_ON(resp->sense_len > VIRTIO_SCSI_SENSE_SIZE); > > + WARN_ON(virtio32_to_cpu(vscsi->vdev, resp->sense_len) > > > + VIRTIO_SCSI_SENSE_SIZE); > > Introduce a local variable for this? Might make this statement and the > min_t statement below easier to read. I prefer 1:1 code conversions. We can do refactorings on top. Since you mention this line as h...
2016 Aug 20
0
[PATCH 1/3] virtio: Basic implementation of virtio pstore driver
...q->vdev->priv; + + wake_up(&vps->acked); +} + +static void virtpstore_check(struct virtqueue *vq) +{ + struct virtio_pstore *vps = vq->vdev->priv; + struct virtio_pstore_res *res; + unsigned int len; + + res = virtqueue_get_buf(vq, &len); + if (res == NULL) + return; + + if (virtio32_to_cpu(vq->vdev, res->ret) < 0) + vps->failed = 1; +} + +static void virt_pstore_get_reqs(struct virtio_pstore *vps, + struct virtio_pstore_req **preq, + struct virtio_pstore_res **pres) +{ + unsigned int idx = vps->req_id++ % VIRT_PSTORE_NR_REQ; + + *preq = &vps->req[idx];...
2016 Aug 31
0
[PATCH 1/3] virtio: Basic implementation of virtio pstore driver
...q->vdev->priv; + + wake_up(&vps->acked); +} + +static void virtpstore_check(struct virtqueue *vq) +{ + struct virtio_pstore *vps = vq->vdev->priv; + struct virtio_pstore_res *res; + unsigned int len; + + res = virtqueue_get_buf(vq, &len); + if (res == NULL) + return; + + if (virtio32_to_cpu(vq->vdev, res->ret) < 0) + vps->failed = 1; +} + +static void virt_pstore_get_reqs(struct virtio_pstore *vps, + struct virtio_pstore_req **preq, + struct virtio_pstore_res **pres) +{ + unsigned int idx = vps->req_id++ % VIRT_PSTORE_NR_REQ; + + *preq = &vps->req[idx];...
2016 Aug 31
1
[PATCH 1/3] virtio: Basic implementation of virtio pstore driver
...; + > +static void virtpstore_check(struct virtqueue *vq) > +{ > + struct virtio_pstore *vps = vq->vdev->priv; > + struct virtio_pstore_res *res; > + unsigned int len; > + > + res = virtqueue_get_buf(vq, &len); > + if (res == NULL) > + return; > + > + if (virtio32_to_cpu(vq->vdev, res->ret) < 0) > + vps->failed = 1; > +} > + > +static void virt_pstore_get_reqs(struct virtio_pstore *vps, > + struct virtio_pstore_req **preq, > + struct virtio_pstore_res **pres) > +{ > + unsigned int idx = vps->req_id++ % VIRT_PSTORE_NR_...
2016 Aug 31
1
[PATCH 1/3] virtio: Basic implementation of virtio pstore driver
...; + > +static void virtpstore_check(struct virtqueue *vq) > +{ > + struct virtio_pstore *vps = vq->vdev->priv; > + struct virtio_pstore_res *res; > + unsigned int len; > + > + res = virtqueue_get_buf(vq, &len); > + if (res == NULL) > + return; > + > + if (virtio32_to_cpu(vq->vdev, res->ret) < 0) > + vps->failed = 1; > +} > + > +static void virt_pstore_get_reqs(struct virtio_pstore *vps, > + struct virtio_pstore_req **preq, > + struct virtio_pstore_res **pres) > +{ > + unsigned int idx = vps->req_id++ % VIRT_PSTORE_NR_...
2019 Jan 04
4
[PATCH v2 0/2] virtio-balloon: tweak config_changed
Since virtio-ccw doesn't work with accessing to the config space inside an interrupt context, this patch series avoids that issue by moving the config register accesses to the related workqueue contexts. v1->v2 ChangeLog: - add config_read_bitmap to indicate to the workqueue callbacks about the necessity of reading the related config fields. Wei Wang (2): virtio-balloon: tweak
2016 Nov 10
2
[PATCH 1/3] virtio: Basic implementation of virtio pstore driver
...; + > +static void virtpstore_check(struct virtqueue *vq) > +{ > + struct virtio_pstore *vps = vq->vdev->priv; > + struct virtio_pstore_res *res; > + unsigned int len; > + > + res = virtqueue_get_buf(vq, &len); > + if (res == NULL) > + return; > + > + if (virtio32_to_cpu(vq->vdev, res->ret) < 0) > + vps->failed = 1; > +} > + > +static void virt_pstore_get_reqs(struct virtio_pstore *vps, > + struct virtio_pstore_req **preq, > + struct virtio_pstore_res **pres) > +{ > + unsigned int idx = vps->req_id++ % VIRT_PSTORE_NR_...
2016 Nov 10
2
[PATCH 1/3] virtio: Basic implementation of virtio pstore driver
...; + > +static void virtpstore_check(struct virtqueue *vq) > +{ > + struct virtio_pstore *vps = vq->vdev->priv; > + struct virtio_pstore_res *res; > + unsigned int len; > + > + res = virtqueue_get_buf(vq, &len); > + if (res == NULL) > + return; > + > + if (virtio32_to_cpu(vq->vdev, res->ret) < 0) > + vps->failed = 1; > +} > + > +static void virt_pstore_get_reqs(struct virtio_pstore *vps, > + struct virtio_pstore_req **preq, > + struct virtio_pstore_res **pres) > +{ > + unsigned int idx = vps->req_id++ % VIRT_PSTORE_NR_...
2019 Jan 04
2
[PATCH v2 1/2] virtio-balloon: tweak config_changed implementation
...vb->cmd_id_received == VIRTIO_BALLOON_CMD_ID_DONE) { > - /* Pass ULONG_MAX to give back all the free pages */ > - return_free_pages_to_mm(vb, ULONG_MAX); > - } else if (vb->cmd_id_received != VIRTIO_BALLOON_CMD_ID_STOP && > - vb->cmd_id_received != > - virtio32_to_cpu(vdev, vb->cmd_id_active)) { > - spin_lock_irqsave(&vb->stop_update_lock, flags); > - if (!vb->stop_update) { > - queue_work(vb->balloon_wq, > - &vb->report_free_page_work); > - } > - spin_unlock_irqrestore(&vb->stop_update_lock, flag...
2019 Jan 04
2
[PATCH v2 1/2] virtio-balloon: tweak config_changed implementation
...vb->cmd_id_received == VIRTIO_BALLOON_CMD_ID_DONE) { > - /* Pass ULONG_MAX to give back all the free pages */ > - return_free_pages_to_mm(vb, ULONG_MAX); > - } else if (vb->cmd_id_received != VIRTIO_BALLOON_CMD_ID_STOP && > - vb->cmd_id_received != > - virtio32_to_cpu(vdev, vb->cmd_id_active)) { > - spin_lock_irqsave(&vb->stop_update_lock, flags); > - if (!vb->stop_update) { > - queue_work(vb->balloon_wq, > - &vb->report_free_page_work); > - } > - spin_unlock_irqrestore(&vb->stop_update_lock, flag...